I want to cd to another directory with python which I want to execute this command on the shell its run in to navigate to the directory.
command = 'cd ../../../'
os.popen(command)
this should navigate my shell to the new directory
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The docs for os.chdir are here.