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
>>
>>
>>
>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
> 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
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,
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
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