Get the path of current executing .py file
Get the path of current directory under which the .py file is executing.
file_path = os.path.dirname(os.path.abspath(__file__))
Written by Michael Ma
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Related Tags
#python
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#