Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
160 views
in Technique[技术] by (71.8m points)

windows - How to open cmd of python file now on the run

I'm wondering how to open cmd of python file that's on the run now.

The situation is, I set schedule of my computer to turn on automatically and open python flask server. Then the webpage is working right. However, when I turn on the monitor and try to see what's going on inside, there's no cmd window on my computer. I wanna open the cmd window and check what's going on in the server on run, but can't find where to see.

Is there any idea? Thank you!

question from:https://stackoverflow.com/questions/65643718/how-to-open-cmd-of-python-file-now-on-the-run

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Please do these steps:

import the os module:

import os

then do:

os.system("COMMAND TO RUN HERE")


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...