'Unable to run commands in computer command line with python

Before I get into the issue, I understand that os is not considered to be the ideal way of running shell commands, but subprocess is having the same issues.

I am trying to 1. open the cmd line and 2. navigate to a directory from a given path in order to run further commands to modify the files in that given directory. The following block of code;

import os

os.system("start cmd")
syspath = str(r"cd C:\Users\chris\Desktop\Ligands")
os.system(syspath)

Opens the command line (which defaults to the location of the Downloads folder) but does nothing else, while running the syspath command in the command line manually opens that directory. What am I missing?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source