我遇到了bpython
並試圖在cygwin
的幫助下將其安裝在我的Windows系統上。現在,無論何時我必須訪問bpython
程序,我必須打開cygwin並在cygwin shell內寫入bpython。通過Python程序將參數傳遞給Cygwin
現在我想自動使用蟒蛇script.So上述過程中,只要我在窗戶command prompt
它應該直接開bpython shell
我寫bpython.py
。
我的代碼:
import subprocess
subprocess.call('F:\cygwin\Cygwin.bat')
使用上面的代碼中,我能夠創造cygwin
的過程,但不是一次我在Cygwin的終端寫bpython
得到它的工作。
所以,我想知道我可以直接通過bpython
爲argument
到F:\cygwin\Cygwin.bat
像
F:\cygwin\Cygwin.bat bpython
可以直接打開bpython外殼。
或者是有可能的是
1)首先,我創建cygwin
過程與subprocess
模塊的幫助。
2)比我通過bpython
作爲參數。
上述任務都由python程序完成,以便最終結果是bpython shell。
輸出的which bpython
是什麼'這bpython'返回內部Cygwin外殼? – 2012-03-31 05:15:06
@ IgnacioVazquez-Abrams:它返回'/ usr/bin/bpython'。請參閱編輯。 – RanRag 2012-03-31 05:24:11