Results 1 to 6 of 6

Thread: Clear in Python

  1. #1
    Join Date
    Dec 2011
    Beans
    25

    Clear in Python

    Hello everyone. I'm somewhat new to python and want to create an ASCII animation, how would I do a clear in the code itself to create frames. Thanks in advance, Jonah Lubin.

  2. #2
    Join Date
    Sep 2009
    Location
    Canada, Montreal QC
    Beans
    1,809
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Clear in Python

    You cold print a bunch of lines or you could look into a more advanced library such as ncurses.
    I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones.
    Freedom is measured in Stallmans.
    Projects: gEcrit

  3. #3
    Join Date
    Dec 2011
    Beans
    25

    Re: Clear in Python

    Though with an ASCII movie there is already so many lies of code it would be more streamlined if i just used a single line clear command.

  4. #4
    Join Date
    Dec 2009
    Location
    The Milky Way
    Beans
    243
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Clear in Python

    ncurses is probably what you're looking for.
    There are 10 different kinds of people:
    Those who understand binary numbers
    Those who don't
    Free/open-source game development kit: http://openblox.sourceforge.net

  5. #5
    Join Date
    Dec 2007
    Location
    Behind you!!
    Beans
    977
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Clear in Python

    or you could use the os module to run the clear command, ncurses is better but this still works

    Code:
    import os
    os.system('clear')
    Last edited by Bodsda; December 6th, 2011 at 01:03 PM.
    computer-howto
    Linux is not windows
    Fluxbox & Flux menu how to
    Programming is an art. Learn it, Live it, Love it!


  6. #6
    Join Date
    Dec 2011
    Beans
    25

    Re: Clear in Python

    Ya I'm kinda new to python so NCurses is a bit out of my reach but the os clear looks good

Tags for this Thread

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
  •