Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,906 members, 7,802,940 topics. Date: Saturday, 20 April 2024 at 04:30 AM

Is There Any Statement Like C System''pause'' For Python Cos It Dissappears Immediately I run the co - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Is There Any Statement Like C System''pause'' For Python Cos It Dissappears Immediately I run the co (13133 Views)

5-super Useful And Lightweight Chrome Extensions For Python Coding / Pls How Do I Run My Java Program Using Jdk / HELP!!! I Need Help On Installing "MECHANIZE" For Python.. (2) (3) (4)

(1) (Reply) (Go Down)

Is There Any Statement Like C System''pause'' For Python Cos It Dissappears Immediately I run the co by Nobody: 7:59am On Jan 30, 2010
Is There Any Statement Like C System''pause'' For Python Cos It Dissappears Immediately I run the code
Re: Is There Any Statement Like C System''pause'' For Python Cos It Dissappears Immediately I run the co by IG: 7:19pm On Jan 30, 2010
I don't do Python yet but the general trick is to try to read a line of input from the user. That way the console will not disappear since it's waiting for an input.
You can print "Press Any Key To Continue" before that. So whatever subsequent input is made, you just end the program.
Hope that helps.
Re: Is There Any Statement Like C System''pause'' For Python Cos It Dissappears Immediately I run the co by IG: 8:07pm On Jan 30, 2010
I've just checked out a little bit of Python syntax. I think the following is an example of my last post.


print "Press any key to continue"
a=raw_input()


Now the interpreter will be waiting for an input and so the program will not exit.
Re: Is There Any Statement Like C System''pause'' For Python Cos It Dissappears Immediately I run the co by Nobody: 9:04pm On Jan 30, 2010
@IG, tanx I got it,
Re: Is There Any Statement Like C System''pause'' For Python Cos It Dissappears Immediately I run the co by Nobody: 6:10pm On Feb 07, 2010
yea, thats it
Re: Is There Any Statement Like C System''pause'' For Python Cos It Dissappears Immediately I run the co by Nobody: 11:26pm On May 24, 2010
You can try dis if u want it 2 pause 4 some secs
import time
print('Hello World')
time.sleep(10) #it pauses 4 10 secs i hope dis helped
Re: Is There Any Statement Like C System''pause'' For Python Cos It Dissappears Immediately I run the co by jacob05(m): 6:24pm On May 31, 2010
hmm. python me love,

(1) (Reply)

Bash Shell Vulnerability Affects Linux, Unix And Mac OS X / How To Build A Forum Website Like Nairaland .com / Javascript Study Group

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.