On Sat, Aug 11, 2007 at 03:40:18PM -0600, Ara Kooser wrote:
> Hello,
> 
>    I am back working on a text adventure game using functions. I broke
> down the game into areas (modules) but I am having trouble getting the
> other modules to recognize the globals I have set in the main program.
> 

If you want your globals available to multiple modules, then put
your "globals" in a separate module, and import that module in each
module that needs access to the globals. 

##################################

# globals.py

stre = 9
con = 8
inte = 11
agl = 14

# etc

##################################

# outside1.py

import globals

def whatever():
    x = globals.stre

# etc

##################################

Dave




-- 
Dave Kuhlman
http://www.rexx.com/~dkuhlman
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to