>
>
>
> --- On Wed, 6/4/08, Jeff McNeil <[EMAIL PROTECTED]> wrote:
>
>> From: Jeff McNeil <[EMAIL PROTECTED]>
>> Subject: Re: Unable to write output from os.path.walk to a file.
>> To: [EMAIL PROTECTED]
>> Cc: python-list@python.org
>> Date: Wedn
/08, Jeff McNeil <[EMAIL PROTECTED]> wrote:
> From: Jeff McNeil <[EMAIL PROTECTED]>
> Subject: Re: Unable to write output from os.path.walk to a file.
> To: [EMAIL PROTECTED]
> Cc: python-list@python.org
> Date: Wednesday, June 4, 2008, 3:26 PM
> What exactly are you t
What exactly are you trying to accomplish? If you're just looking for
the contents of a directory, it would be much easier to simply call
os.listdir(dirinput) as that will return a list of strings that
represent the entries in dirinput.
As it stands, 'os.path.walk' will return None in your example
Paul Lemelle wrote:
I Am trying to output the os.path.walk to a file, but the writelines method
complains
Below is the code, any helpful suggestions would be appreciated.
def visit(arg, dirnames, names):
print dirnames
dirinput = raw_input("Enter directory to read: ")
I Am trying to output the os.path.walk to a file, but the writelines method
complains
Below is the code, any helpful suggestions would be appreciated.
def visit(arg, dirnames, names):
print dirnames
dirinput = raw_input("Enter directory to read: ")
listdir = os.path.wal