Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

How to go up in a path in python

import os

print(os.getcwd())
OUTPUT: /kite/run

path_parent = os.path.dirname(os.getcwd())
os.chdir(path_parent)
print(os.getcwd())
OUTPUT: /kite
 
PREVIOUS NEXT
Tagged: #How #path #python
ADD COMMENT
Topic
Name
7+1 =