문제

I've written a small Python script to test my Visual Basic scripts function correctly before deploying them -

import subprocess
subprocess.call("cmd /c MyScript.vbs")

Rather than running the Visual Basic script, my script opens in Sublime Text (the default program).

How can I run the scripts rather than Opening them?

도움이 되었습니까?

해결책

Use one of these, cscript is more appropriate for a console application.

subprocess.call("cmd /c wscript MyScript.vbs")

or

subprocess.call("cmd /c cscript MyScript.vbs")

An excellent answer as to what the difference is can be found here: Difference between wscript and cscript

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top