python多窗口调用,如何调用从批处理文件/运行多个Python脚本窗口XP / 7

I'm trying to schedule run multiple pythons using batch file.

For example there are my python files that I want to schedule run them on the daily basis

D:\py\s1.py

D:\py\s2.py

now how can I combine these two files into a .bat, so that I can schedule run these two file using python.exe (C:\python27\python.exe) at the same time.

Thank you

解决方案

Method 1: Bat file.

If you have python in the PATH Environment variable:

start python D:\py\s1.py

start python D:\py\s2.py

Else literal path

start C:\python27\python.exe D:\py\s1.py

start C:\python27\python.exe D:\py\s2.py

Note that this will not wait for a return from either execution. Note, do not forget to add quotations around the path strings if they contain spaces or special characters.

See start /? for more help and options.

Method 2: Two different Scheduled Tasks

Create two separate scheduled tasks that start at the same time each calling python to run one of the scripts.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值