os.path.dirname(sys.argv) always returns nothing
thijs at buckazoids.com
Mon Aug 1 19:55:11 CEST 2011
On Mon, 01 Aug 2011 10:38 -0700, "happykid" <psyking841 at gmail.com>
> I want to use this function to get the directory path of the running
> script, but it always returns empty string. Can anyone help me solve
> this? Thank you.
I think this is what you are after:
path = os.path.abspath(os.path.dirname(__file__))
argv returns the name of the current file (string), but no path
information if I recall correct.
More information about the Python-list