944,045 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 4407
  • Python RSS
Aug 15th, 2006
0

Clearing screen in Python (was: omg noob prob plz help)

Expand Post »
is there anyway to clear the screen like if you are using cmd prompt??

yes i kno im a noob but any help would be greatly appreciated
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
riddz_22 is offline Offline
1 posts
since Aug 2006
Aug 15th, 2006
0

Re: omg noob problem plz help

Python Syntax (Toggle Plain Text)
  1. >cls
pty
Reputation Points: 64
Solved Threads: 39
Posting Pro
pty is offline Offline
530 posts
since Oct 2005
Aug 15th, 2006
0

Re: omg noob problem plz help

You can use the command shell:
Python Syntax (Toggle Plain Text)
  1. # with windows
  2. import os
  3.  
  4. os.system("CLS")
or
Python Syntax (Toggle Plain Text)
  1. # with linux
  2. import os
  3.  
  4. os.system('clear')
or
Python Syntax (Toggle Plain Text)
  1. # if you don't mind that the cursor is at the bottom
  2. print '\n' * 25
Actually, the best way is to design your program so you don't need the clear the screen.
Last edited by vegaseat; Aug 15th, 2006 at 7:45 pm.
Moderator
Reputation Points: 1333
Solved Threads: 1403
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004
Aug 16th, 2006
0

Re: omg noob problem plz help

yeah - didn't realise it was the python forum because I just clicked in from RSS
pty
Reputation Points: 64
Solved Threads: 39
Posting Pro
pty is offline Offline
530 posts
since Oct 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: sessions in python
Next Thread in Python Forum Timeline: Difference between Dispatch and DispatchEX





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC