Home > front end >  Prevent auto-closing windows batch file
Prevent auto-closing windows batch file

Time:04-17

I have a batch file that enables me to run multiple python files at the same time and it is ok at this point.

@ECHO ON

start python "C:\Users\Future\Desktop\Pop1.py"
ECHO Running Pop1
start python "C:\Users\Future\Desktop\Pop2.py"
ECHO Running Pop2

PAUSE

But there is a problem for me, when the python file executed, I need to follow the print statements to follow the program. When I execute the batch the console windows for both the python files disappears quickly. How can I keep them open to be able to follow the execution of python files?

CodePudding user response:

try this : you just have to include -i after python

@ECHO off

start python -i "C:\Users\Future\Desktop\Pop1.py"
start python -i "C:\Users\Future\Desktop\Pop2.py"
  • Related