Perl2Python: Get the current working path
Perl
Cwd can be used to get pathname of current working directory.
To get the current working directory use os.getcwd()
The question asked for the directory of a given file, so the proper answer is:
- import os
- os.path.dirname(os.path.realpath(__file__))
Comments
Post a Comment