Run ❯
Get your
own Python
server
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#import os module import os #set up test workspace with permissions in editor testfolder = "WORKSPACE" value = os.getenv(testfolder) #Change directory to test workspace os.chdir(value) print ("Current directory:" , os.getcwd()) #create a new directory os.mkdir("mydir") #open a directory with os.open method fd = os.open("mydir", os.O_RDONLY) #change the currently running directory os.fchdir(fd) #Print the updated directory path print ("Updated directory:" , os.getcwd())
Current directory: /tmp/b8de6684-70a2-4b74-a2a8-a21087c01237
Updated directory: /tmp/b8de6684-70a2-4b74-a2a8-a21087c01237/mydir