Etc |
vbs이용, 검은창 (command창) 없이 python 실행홍사훈 0건 418회 20-04-12 20:46 |
---|
관련링크
본문
## 메모장에 다음을 작성하고 test.vbs 파일로 저장
Set WshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strPythonExe384 = "C:\python-3.8.4\python.exe"
strPythonExe394 = "C:\python-3.9.4\python.exe"
strScriptPath = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\")) & "pythontest.py"
If objFSO.FileExists(strPythonExe) Then
WshShell.Run """" & strPythonExe384 & """ """ & strScriptPath & """", 0, False
Else
' WshShell.Popup "파일을 찾지 못함", 5, "오류", vbExclamation
WshShell.Run """" & strPythonExe394 & """ """ & strScriptPath & """", 0, False
End If
등록된 댓글이 없습니다.