Re: Unable to write output from os.path.walk to a file.

2008-06-04 Thread Jeff McNeil
> > > > --- 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

Re: Unable to write output from os.path.walk to a file.

2008-06-04 Thread Paul Lemelle
/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

Re: Unable to write output from os.path.walk to a file.

2008-06-04 Thread Jeff McNeil
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

Re: Unable to write output from os.path.walk to a file.

2008-06-04 Thread Larry Bates
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: ")

Unable to write output from os.path.walk to a file.

2008-06-04 Thread Paul Lemelle
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