[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Keeping the console window

K Viltersten

3/2/2008 2:47:00 PM

I've proudly connected Notepad++ to edit
and run my fantastic software. When that
started to work, i noticed that all the
printing disappears as the console window
vanishes upon the program completion.

How can i trick Python program to keep on
running even if the actual statements
have been exectuted?

Some kind of reading from keyboard?

--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy

3 Answers

samuel.progin

3/2/2008 3:55:00 PM

0

You may use python in interactive mode:

$ python -i yourScript.py

Or use a blocking readline:

$ cat yourScript.py
import sys
sys.stdin.readline()

++

Sam

Aaron Brady

3/2/2008 4:03:00 PM

0

On Mar 2, 9:55 am, Sam <samuel.pro...@gmail.com> wrote:
> You may use python in interactive mode:
>
> $ python -i yourScript.py
>
> Or use a blocking readline:
>
> $ cat yourScript.py
> import sys
> sys.stdin.readline()
>
> ++
>
> Sam

FWIW, for what it's worth, you can invoke the interpreter from a batch
file/shell script too, and just use the native PAUSE instruction to
prompt for 'any key to continue'.

K Viltersten

3/2/2008 5:02:00 PM

0

> You may use python in interactive mode:
>
> $ python -i yourScript.py
>
> Or use a blocking readline:
>
> $ cat yourScript.py
> import sys
> sys.stdin.readline()


Thanks guys!

--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy