Answers for "how to open a file and get current folder py"

12

python get current file location

import os
os.path.dirname(os.path.abspath(__file__))
Posted by: Guest on May-11-2020
0

how to make py file open in current directory

sys.path[0]
Posted by: Guest on December-22-2021

Python Answers by Framework

Browse Popular Code Answers by Language