尝试在Kali Linux中轻松打开pyCharm。我一直在学习在线课程,打开pyCharm的方法是导航到.sh
文件并打开它。我尝试使用subprocess模块自动执行该过程,但出现错误:
没有这样的文件或目录:'cd':'cd'
我的代码:
import subprocess
subprocess.call("cd")
subprocess.call("cd", "Downloads/pycharm-community-2019.2.3/bin")
subprocess.call("/.pycharm.sh")
答案 0 :(得分:0)
将外壳设置为True:
import subprocess
subprocess.call("cd", shell=True)
subprocess.call("cd", "Downloads/pycharm-community-2019.2.3/bin", shell=True)
subprocess.call("/.pycharm.sh", shell=True)
#it is "./pycharm.sh"