Currently, I am using a python script to run commands in Linux shell. When I change the directory it doesn't seem to work (when I ran the command ls
it listed files of the initial directory). I want to change the directory to the desktop.
My Code:
import os
os.popen("cd Desktop")
d = os.popen("ls")
x = d.read()
print (x)