[問題] 不設定環境變數能透過bat執要py腳本。

看板Python作者 (juso)時間7年前 (2018/05/01 21:05), 7年前編輯推噓1(102)
留言3則, 3人參與, 7年前最新討論串1/1
請教各位 目前安裝的是anaconda版的python,由於設定環境變數後,會變得不穩定,所以不打算設 定,但又有python script想要執行。 因此,想要請教,如何在不設定環境變數下,還能透過bat執要python script。 謝謝賜教。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.32.228.170 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1525179938.A.7A4.html

05/01 21:09, 7年前 , 1F
用絕對路徑啊
05/01 21:09, 1F
謝謝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

05/02 13:04, 7年前 , 2F
start 那個沒有需要,至少你是執行 exe 可以省去
05/02 13:04, 2F

05/02 16:08, 7年前 , 3F
謝謝。
05/02 16:08, 3F
文章代碼(AID): #1Qw6OYUa (Python)
文章代碼(AID): #1Qw6OYUa (Python)