Leif160519的blog Leif160519的blog

——————

目录
Windows使用bat批处理执行python程序
/    

Windows使用bat批处理执行python程序


本文摘自:https://blog.csdn.net/HJULKK/article/details/52549674

步骤1:

先写一个简单的python程序print.py,代码如下:

print "call success."

执行结果:

>>> ================================ RESTART ================================
>>>
call success.
>>>

步骤2:使用bat批处理程序执行python程序

callpython.bat

@echo off
F:
cd F:\learning\python\project\battest
start python print.py
rem 使用ping命令暂停3s,这样可以看到调用python后的结果
ping -n 3 127.0.0.1 > nul

双击执行callpython.bat后执行结果如下:
image.png


“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题Windows使用bat批处理执行python程序
作  者Leif160519
出  处https://github.icu/articles/2019/10/08/1570525092474.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!