Even its from one or two external libraries like Tkinter and pygame? I prefer to load what I need, not to constantly have to call it by its library dot its_name. It makes easier coding for me. I try to keep my code as simply as possible. Wonder if its possible to use a Tkinter question to make a pygame run again (example being you get killed on a level and you want to play again without exiting)?
-- For great sites go to: http://www.the-web-surfers-store.com MSN Messenger: [EMAIL PROTECTED],com Yahoo! Messenger: spam_swatter31 ICQ: 199020705 AIM: f3mighty "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Nathan Pinno wrote: > >> It's a warning that says: >> >> Can only use * in top level or something like that. >> >> It's kind of annoying > > why? importing tons of unknown stuff into a local namespace is > rather silly, and makes it impossible for the compiler to properly > analyze your code -- which means that you cannot use nested > scoping. the language reference says: > > The from form with "*" may only occur in a module scope. > If the wild card form of import -- "import *" -- is used in a > function and the function contains or is a nested block with > free variables, the compiler will raise a SyntaxError. > > future versions of Python will most likely issue a SyntaxError also > for "import *" in non-nested functions. > >> but the program still ran after I made the import * lines top level, >> and removed the def's. > > moving the "import *" line to the module scope would have been > enough; functions can refer to module-level variables just fine. > > you might wish to read up on Python scoping rules: > > http://docs.python.org/ref/naming.html > > </F> > > -- ............................................................. > Posted thru AtlantisNews - Explore EVERY Newsgroup < > http://www.AtlantisNews.com -- Lightning Fast!!! < > Access the Most Content * No Limits * Best Service < -- http://mail.python.org/mailman/listinfo/python-list