[Answer]-Issuing commands to the command line in Python

1👍

If you want to change the working directory of the Python process you can use chdir from the os module:

import os

os.chdir('/etc/apache2')
👤Matt

0👍

First of all, you will not get what you expect if you run this. Try

import os
os.chdir('/etc/apache2')

Second, try /path/to/cd as process may not know cd alias.

Leave a comment