Global help
Shaun Allen Dishman
gte838h at prism.gatech.edu
Mon Jan 17 11:18:01 EST 2000
Hello,
I have something like the following situation:
----- x.py -----
from y import *
def x(filename):
file = open(filename, 'w')
y()
----------------
----- y.py -----
def y():
# must be the same file object as in x.py
file.write('blah blah blah \n')
----------------
I have fiddled around with the global settings for the file object but
cannot seem to get things to work. All I need is to be able to access the
file object from one module inside of another one, without passing it as a
parameter. Is this even possible? Thanks in advance.
Shaun
More information about the Python-list
mailing list