Re: [Tutor] folder and file list

2011-05-10 Thread Tommy Bell
On 11-05-2011 00:08, Jorge Romero wrote: Is there any special reason for deploying that functionality from scratch by yourself? Can't you use os bulit-in module? Perhaps you can find this useful http://docs.python.org/library/os.html#os.listdir. That way you don't deal with OS peculiarities s

Re: [Tutor] folder and file list (Jorge Romero)

2011-05-10 Thread Robert Sjöblom
>> >> >> >> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >> >> >> > Can't you use os bulit-in module? > > Perhaps you can find this useful > http://docs.python.org/library/os.html#os.listdir. That way you don't deal > with OS peculiarities such as the one Bret

Re: [Tutor] folder and file list

2011-05-10 Thread Jorge Romero
Is there any special reason for deploying that functionality from scratch by yourself? Can't you use os bulit-in module? Perhaps you can find this useful http://docs.python.org/library/os.html#os.listdir. That way you don't deal with OS peculiarities such as the one Brett Ritter pointed. On Tue,

Re: [Tutor] folder and file list

2011-05-10 Thread Brett Ritter
On Tue, May 10, 2011 at 8:17 AM, Tommy Bell wrote: > scandir('c:\tmp') > this doesnt work, I know why - but i dont know how to fix it. > The reason it doesnt work is because isfile requires a file, but current > contains a path. Not quite. Stick a "print path" as the first line in scandir. No

[Tutor] folder and file list

2011-05-10 Thread Tommy Bell
Hey, quite new at python and I have been trying to make a script that will list folders and files, but so far its not working import os, glob def scandir(path): direc = [] file = [] for current in glob.glob(os.path.join(path,'*')): if os.path.isdir(current): direc