Python Forum
How to pause execution (on windows)?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to pause execution (on windows)?
#1
Assume I have created a *.py script (on windows).
If I double click on it it is executed. But the command prompt windows vanishes immediately.
I cannot read output.

I need to write a kind of "pause" command into *.py script file to pause execution and let me read what is previously printed.

When I hit RETURN the processing should be resumed.

How can I achieve this?
Reply
#2
Introduce a simple user input that does nothing:
input("Press enter to continue")
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I pause only one object? actualpy 1 365 Feb-01-2024, 07:43 PM
Last Post: deanhystad
  Is it Possible to pause a script? tester_V 6 1,525 Apr-05-2023, 06:11 AM
Last Post: tester_V
  Did subprocess.Popen() causes main routine to pause stdout? liudr 4 3,658 May-04-2021, 08:58 PM
Last Post: liudr
  Not able to make a specific thing pause in pygame cooImanreebro 4 3,230 Dec-13-2020, 10:34 PM
Last Post: cooImanreebro
  How to Make Python code execution pause and resume to create .csv and read values. Kashi 2 3,777 Jun-14-2018, 04:16 PM
Last Post: DeaD_EyE
  how to pause pyxhook keylogger johweb 0 2,379 Jun-13-2018, 03:17 PM
Last Post: johweb
  How to pause/interupt with keyboard jehoshua 5 7,231 Mar-20-2018, 05:52 AM
Last Post: jehoshua
  Pause event Trajme 2 3,107 Dec-06-2017, 11:01 PM
Last Post: hshivaraj
  how to enter a pause in the middle of a file sylas 2 3,291 Jun-11-2017, 06:46 AM
Last Post: sylas

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020