1. 程式人生 > >python 使用.bat檔案自動執行

python 使用.bat檔案自動執行

@echo off

title demo
cmd "/c activate py36 && cd demo&& python demo_test.py"

pause

其中,activate py36是安裝完python3.7,想使用python3.6的寫法,常規寫法為:activate python3.6;

cd demo 是進入資料夾名為demo的目錄下;

python demo_test.py 是執行demo_test.py檔案

注:demo_test.py檔案在資料夾demo下。