current position:Home>How to automatically execute pycharm file after clicking it

How to automatically execute pycharm file after clicking it

2022-02-04 16:50:39 CSDN Q & A

This is a py file , But every time you open it, you need to click it manually to run the program inside , How to get rid of this step , Let him click on it and run the program automatically , Pictured


Take the answer :

Don't use it pycharm To open it , You have to use python3 Just open it
pycharm It's just a compiler , It's not an actuator
You can write a bat file , It says :
python3 d:\test\
Here, replace the path with your file path , Then double click. bat File execution

Other answers 2:

Pack it , After packaging , function exe The file can run automatically . Can pass pyinstaller Conduct exe pack

Other answers 3:

Then you don't need it pycharm ah , Directly write a batch file with python Run this script , Or use pyinstaller Package this script into exe, Every double click exe You can run

Other answers 4:
  1. img

  2. img


  1. img


Automatic operation after opening , Get it done

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.

Random recommended