Run python script in bat

Code content of #kaiyuan.bat

@echo off
D:
cd D:\Program Files\python
start python kaiyuan.py

#Description: The script location is in the Program Files\python file of the D drive.

It turns out that there is no D:, this line of statement, after the script is executed, the webpage is not opened, and the D: line is added to execute the open script

 

Contents of #kaiyuan.py

#!D:\Program Files (x86)\python
import webbrowser
webbrowser.open("https://my.oschina.net/xxiaobian")

 

actual effect:

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325184542&siteId=291194637