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下。

猜你喜欢

转载自www.cnblogs.com/xiaodai0/p/10049635.html
今日推荐