interaction between modules... globals?
Gerrit Holl
gerrit.holl at pobox.com
Wed Jul 7 04:05:32 EDT 1999
Hello,
I have a program which consists of several little modules, but I encounter a
problem with that. I have one module which returns a class instance, with
messages as members, either Dutch or English. Every module needs that instance,
but I don't want to pass it as an argument to every little function, the
modules should find out theirselves. But I _also_ don't want to make that
instance 5 times.
So I thougt: I need a sort of global between the modules. Is this possible?
I'm now pickling and unpickling it, but that _very_ slow, of course:
bash:gerrit at gerrit:~/project/python/discoverb>>> time ./discoverb.py </dev/null
Welke file zal ik de woorden uit halen? Traceback (innermost last):
File "./discoverb.py", line 168, in ?
run()
File "./discoverb.py", line 145, in run
file = raw_input(mes.whichfile + " ")
EOFError: EOF when reading a line
real 0m2.504s
user 0m2.060s
sys 0m0.190s
more than 2 seconds, it _has_ to be possible faster to find out a language!
regards,
Gerrit.
--
The Dutch Linuxgames homepage: http://linuxgames.nl.linux.org
Personal homepage: http://www.nl.linux.org/~gerrit/
Discoverb is a python program (in several languages) which tests the words you
learned by asking it. Homepage: http://www.nl.linux.org/~gerrit/discoverb/
Oh my god! They killed init! You bastards!
More information about the Python-list
mailing list