Thanks all! That helps out a lot!
Python is kinda' cool...
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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