DiscussionPage Comment | Log in | Print | Subscribe to this page

This page should be used for posting questions, reponses and comments related to Python programming.


comments:

Clear Screen -- Wed, 15 Sep 2004 15:42:19 -0400 reply
There appears to be no command for clearing the Python Shell window, like "cls" or "clear". Google search had suggestions for DOS/Unix environments. One solution was to define a clear function which would print 60 blank lines. def clear(): for i in range(60): print Pedro

Clear Screen in IDLE --harrison, Wed, 15 Sep 2004 16:51:52 -0400 reply
I don't know of a built-in method to clear the interactive screen in IDLE, either. You can close the interactive window and open a new one, which has the effect of clearing the window. This works better if you have IDLE set to start up with a file editing window open rather than the interactive window (Options>Configure IDLE>General)--then you just open an interactive window whenever you want and leave the file window open in the background. This issue is specific to IDLE, though, not Python. MacIDE and PyOxide, both alternative Python editors for the Mac, have an interactive window with a "clear" menu choice or button that does what you suggest. I'm sure that there are Python environments for Windows that are similar and you're welcome to investigate those if you wish. -- JH

print formatting -- Thu, 16 Sep 2004 13:32:41 -0400 reply
Does anyone know if there's a way to put the variable in the print statement before the text?

For example:

this code works:

print "number of twenty dolar bills:", x

but this does NOT work:

print x, "twenty dolar bills"

Thanks! Jeannie

I figured it out -- Thu, 16 Sep 2004 15:34:15 -0400 reply
Hi everyone I figured out the soulution to my question. Here's the code: print x, twenty dolar bills I guess you just need to use single quotes

Worked for me --harrison, Thu, 16 Sep 2004 23:08:08 -0400 reply
print x, "twenty dollar bills" with double quotes works for me when entered in the interactive interpreter. -- JH

This how I got it... -- Tue, 21 Sep 2004 16:40:39 -0400 reply
for example; let x=46 then 45=220+15+1*1 so, if x=total then: total / 20 mod / 20 total/10 mod / 10 total / 5 mod / 5 mod / 1 (since, x/1=x)

All the best :)

sorry, correction -- Tue, 21 Sep 2004 16:42:12 -0400 reply
for example; let x=46 then 45=220+15+1*1 so, if x=total then: total / 20 mod / 20 total/10 mod / 10 total / 5 mod / 5 mod / 1 (since, x/1=x) All the best :) Osama

This page was last edited 2 years ago by harrison. View page history
Subject:


Comment:


    with signature

Powered by Zwiki, Zope, Python, and Mac OSX