【发布时间】:2013-01-26 20:10:48
【问题描述】:
我想用 python cd 到另一个目录,我想在它运行的 shell 上执行这个命令以导航到该目录。
command = 'cd ../../../'
os.popen(command)
这应该将我的 shell 导航到新目录
【问题讨论】:
-
您的目标仅仅是复制 cd 命令,还是更改脚本其余部分的工作目录?
标签: python linux shell navigation popen