Re: [Tutor] glob in order of the file numbers

2009-03-07 Thread عماد نوفل
On Fri, Mar 6, 2009 at 11:34 PM, Kent Johnson wrote: > On Fri, Mar 6, 2009 at 9:52 PM, Emad Nawfal (عماد نوفل) > wrote: > > Hi Tutors, > > suppose I have four files in the current directory: 1.temp, 2.temp, > 3.temp, > > and 4.temp. I want to use glob, or anything else, to print the contents > o

Re: [Tutor] glob in order of the file numbers

2009-03-06 Thread Kent Johnson
On Fri, Mar 6, 2009 at 9:52 PM, Emad Nawfal (عماد نوفل) wrote: > Hi Tutors, > suppose I have four files in the current directory: 1.temp, 2.temp, 3.temp, > and 4.temp. I want to use glob, or anything else, to print the contents of > the files in their respective orders, where the content of 1.temp

Re: [Tutor] glob in order of the file numbers

2009-03-06 Thread Senthil Kumaran
2009/3/7 Emad Nawfal (عماد نوفل) : > import glob > for path in glob.iglob("*.temp"): >     infile = open(path) >     for line in infile: >         print line.strip() import glob files = sorted(glob.glob("*.temp")) for each in files: print open(each).read() Note couple of things: - glob.glob

Re: [Tutor] glob in order of the file numbers

2009-03-06 Thread Bill Campbell
On Fri, Mar 06, 2009, Emad Nawfal ( ) wrote: > > Hi Tutors, > suppose I have four files in the current directory: 1.temp, 2.temp, > 3.temp, and 4.temp. I want to use glob, or anything else, to print the > contents of the files in their respective orders, where the content of > 1.t

[Tutor] glob in order of the file numbers

2009-03-06 Thread عماد نوفل
Hi Tutors, suppose I have four files in the current directory: 1.temp, 2.temp, 3.temp, and 4.temp. I want to use glob, or anything else, to print the contents of the files in their respective orders, where the content of 1.temp gets printed, then 2.temp, then 3.temp, then 4.temp. I write the follow