Re: How would you open this file?

2006-02-23 Thread Bob
Thanks all! That helps out a lot! Python is kinda' cool... -- http://mail.python.org/mailman/listinfo/python-list

Re: How would you open this file?

2006-02-23 Thread Larry Bates
Bob wrote: > I want to open a file in a function and pass the file back to main so > another function can manipulate the file, something like this: > > # begin > def open_file() > filename=open(options.filename_input,'r') > return filename > > open_file() > print filename.read() > filename.cl

Re: How would you open this file?

2006-02-23 Thread Dave Hansen
On Thu, 23 Feb 2006 18:01:32 -0500 in comp.lang.python, Kent Johnson <[EMAIL PROTECTED]> wrote: [...] > >filename = open_file() > >By the way 'filename' is a pretty bad name, since it contains a file >object, not a string. Maybe call it f instead. ('file' is also a bad >name because it is the na

Re: How would you open this file?

2006-02-23 Thread Kent Johnson
Bob wrote: > I want to open a file in a function and pass the file back to main so > another function can manipulate the file, something like this: > > # begin > def open_file() > filename=open(options.filename_input,'r') > return filename > > open_file() > print filename.read() > filename.cl

How would you open this file?

2006-02-23 Thread Bob
I want to open a file in a function and pass the file back to main so another function can manipulate the file, something like this: # begin def open_file() filename=open(options.filename_input,'r') return filename open_file() print filename.read() filename.close() # end But this doesn't wor