I am very new to python and have been going through all over the web to try to figure out my problem. I have small script that I would like to do something simple with. I have a number of files called soemthing like (myFile00.txt, myFile01.txt,...). Mainly this is what I would like for my scrip to do: 1) I would like it to read in the files without them being arguments when the script is called. Each file contains numbers and colors and 2) I want to see which ones are in common. Right now I am trying to use a kind of indexing but I think I have the syntax all wrong or somehting

fileOpen = open("myFile2%.txt", % fileIndex, "r")

Recommended Answers

 fileOpen = open("myFile%2i.txt" % fileIndex, "r")

Jump to Post

All 2 Replies

 fileOpen = open("myFile%2i.txt" % fileIndex, "r")

Oh wow! Thank you sos so much!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.