bat批处理执行python
Table of Contents
bat执行python文件:
1. @echo off
2. D:
3. cd D:\WORKSPACE\Python27\test
4. start python sendEmail.py
5. exit
程序運行的很正常,可是伴隨著一個黑色的DOS窗口
PYTHON_HOME下有一個"pythonw.exe"
"pythonw.exe"和"python.exe"的區別:
1)"pythonw.exe"執行時不會出現DOS窗口
2)"pythonw.exe"執行時所有stdin和stdout都無效
3)"pythonw.exe"執行時從原有的sdtin只會得到EOF
所以最終結果:
1. @echo off
2. D:
3. cd D:\WORKSPACE\Python27\test
4. start pythonw sendEmail.py
5. exit
0 评论