Actually need to go some path and execute some command and below is the code
code:
import os present_working_directory = \'/home/Desktop
think about using absolute paths
import os pwd = '/home/Desktop/folder' if some_condition == true : path = os.path.join(pwd, "nodes/hellofolder") os.chdir(path) print os.getcwd() if another_condition == true: path = os.path.join(pwd, "nodes") os.chdir(path) print os.getcwd()