Answers for "how to give path of folder in python"

1

python file location path

import os

print('getcwd:      ', os.getcwd())
print('__file__:    ', __file__)
Posted by: Guest on August-23-2020
1

python how to open a file in a different directory in mac

import os
f = open (os.path.expanduser("~/Desktop/somedir/somefile.txt"))
Posted by: Guest on August-16-2020
0

add dir to path python

import sys
sys.path.insert(0,'/path/to/mod_directory')
Posted by: Guest on August-26-2021

Code answers related to "how to give path of folder in python"

Python Answers by Framework

Browse Popular Code Answers by Language