You can get the current directory with ** os.getcwd () **.
import os
path = os.getcwd() #Get current directory
print(path)
# C:\Users\hiro22
You can move to the specified directory with ** os.chdir (r'path of the specified directory') **.
import os
os.chdir(r"C:\Users\hiro22\Desktop\test") #Move directory
path= os.getcwd() #Get current directory
print(path)
# C:\Users\hiro22\Desktop\test
Recommended Posts