function to check whether a variable already exists?

Graham Guttocks graham_guttocks at yahoo.co.nz
Tue May 1 20:10:26 EDT 2001


Lyle Johnson <ljohnson at resgen.com> wrote:

>     if not globals().has_key("NEWSRC"):
>         NEWSRC = os.path.expanduser("~/.newsrc")

This is easy enough I suppose, thanks all!

Regards,
Graham

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/




More information about the Python-list mailing list