SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Sep 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    clearing python Shell

    I am new to python... can anyone help me to use function how to clear python Shell... like using function system("cls") or clrscr()....

  2. #2
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,089
    Mentioned
    55 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    Team SitePoint
    Join Date
    Aug 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    I'm on a GNU/Linux system.

    Code:
    import os
    os.system('clear')
    is one way to do it here, but let's face it - that's *way* too much typing just to clear the screen on occasion, so I just press Ctrl+L.

    This works fine when running python interactively, using ipython, and in many other applications that can be run from within a *NIX terminal emulator. It probably won't work with IDLE, since that's a Tk app.

  4. #4
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    Hell I just use it for quickie testing of something, so I ctrl-d and then usually close that terminal window :P

  5. #5
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,089
    Mentioned
    55 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by boltronics View Post
    but let's face it - that's *way* too much typing just to clear the screen on occasion, so I just press Ctrl+L.
    That is a bit much typing for my taste


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •