"Garry Willgoose" wrote
For a while now I have been using the command below in a python file
to determine the name of the python file that I use to launch an
application
sys.modules['__main__'].__dict__['__file__']
The usual way to do that would be via sys.argv[0]
Is there any reason why
On 05-Nov-2010, at 4:45 PM, Garry Willgoose wrote:
> For a while now I have been using the command below in a python file to
> determine the name of the python file that I use to launch an application
> (i.e.IF I go 'python junk.py' I want to get 'junk.py'). The command I have
> use that I cam
For a while now I have been using the command below in a python file to
determine the name of the python file that I use to launch an application
(i.e.IF I go 'python junk.py' I want to get 'junk.py'). The command I have use
that I came across somewhere some time ago was
sys.modules['__main__']