Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Python :: Django Redirect Depending On Request Method 
Python :: python order list by multiple index 
Python :: RMSE value from cross validation 
Python :: python global lists 
Python :: what is fn.call 
Python :: transform dictionary keys python 
Python :: how to format a file in python 
Python :: how to stop python for certain time in python 
Python :: programmer tool 
Python :: update matplotlib params 
Python :: python send email from icloud 
Python :: combinations 
Python :: python function 
Python :: python django adding category 
Python :: 151 uva problem solution 
Python :: how draw shell in python 
Python :: create feature dataset arcpy 
Python :: minio python make an object 
Python :: python split string on char 
Python :: bag of word scikit learn 
Python :: how to pass primary key to url django 
Python :: newtorkx remove node 
Python :: python create pem file 
Python :: python greater than dunder 
Python :: program python factorial 
Python :: convert to lwercase in df column 
Python :: index.py:14: RuntimeWarning: invalid value encountered in true_divide return np.dot(user, user2) / (norm(user) * norm(user2)) 
Python :: list in python 3 
Python :: matplotlib colormap transparent white to black 
Python :: python terminal ui 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =