Handling global variables (Newbie)

David S davids at evertech.com.au
Thu Mar 13 05:25:12 CET 2008


    Hi,

I have an error occurring at
    self.build_root = os.path.abspath(os.path.split(__file__)[0])

The error states 'NameError: global name '__file__' is not defined'

In Python 2.5 I ran my script as a module in IDLE gui. How does _file_ get 
defined?

Yours,
David 





More information about the Python-list mailing list