看板 Python 關於我們 聯絡資訊
請教各位 目前安裝的是anaconda版的python,由於設定環境變數後,會變得不穩定,所以不打算設 定,但又有python script想要執行。 因此,想要請教,如何在不設定環境變數下,還能透過bat執要python script。 謝謝賜教。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.32.228.170 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1525179938.A.7A4.html
uranusjr: 用絕對路徑啊 05/01 21:09
謝謝u大,原來如此。如下可以執行。 @echo off C: cd C:\Users\user\ipycod start C:\Anaconda3\python.exe t4.py #這個有prompt的視窗 exit start C:\Anaconda3\pythonw.exe ouWords.py #這個沒有prompt的視窗。 ※ 編輯: ides13 (114.32.228.170), 05/01/2018 22:00:53 ※ 編輯: ides13 (220.133.32.131), 05/02/2018 10:52:32
kenduest: start 那個沒有需要,至少你是執行 exe 可以省去 05/02 13:04
ides13: 謝謝。 05/02 16:08