R
ron.longo
Is there any way that I can find the path of the main .py file of my
application?
For example, I have an application with some resources which are in a
subdirectory:
myPythonApp.py
/resources
image1
image2
etc.
If i just do a call to os.getcwd() I get back the directory I was in when I
typed 'python myPythonApp.py' which could be any directory. What I want is
the directory that contains the file myPythonApp.py. Then I can use this
directory to construct the path to the resources directory.
(Actually, the app I'm writing has several subdirectories with stuff that it
needs such as plugins, configuration files, workspaces, etc.
Thanks for the help.
Ron
application?
For example, I have an application with some resources which are in a
subdirectory:
myPythonApp.py
/resources
image1
image2
etc.
If i just do a call to os.getcwd() I get back the directory I was in when I
typed 'python myPythonApp.py' which could be any directory. What I want is
the directory that contains the file myPythonApp.py. Then I can use this
directory to construct the path to the resources directory.
(Actually, the app I'm writing has several subdirectories with stuff that it
needs such as plugins, configuration files, workspaces, etc.
Thanks for the help.
Ron