anonymous
  • anonymous
how do i clear the screen in python just like we do using (clrscr) in c+? I have just started ......
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
I don't know of a built in command but you could do something like: print '\n' * 70 Or stick that in a function called clrscr.
anonymous
  • anonymous
sry. this what it comes up when i enter clrscr or print '\n' * 70 : >>> clrscr Traceback (most recent call last): File "", line 1, in clrscr NameError: name 'clrscr' is not defined >>> '\n'*70 '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' >>> print '\n'*70 SyntaxError: invalid syntax (, line 1) is there any other way. thanx in advance. ?
anonymous
  • anonymous
Can you enter: print '\n' ? That should print one new line. If that works you can print many new lines by printing many \n's.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
Just print in Python generates a new line, i.e., for i in xrange(NUMBEROFNEWLINES): print
anonymous
  • anonymous
Something like this may help: def clearscreen(numlines=100): """Clear the console. numlines is an optional argument used only as a fall-back. """ import os if os.name == "posix": # Unix/Linux/MacOS/BSD/etc os.system('clear') elif os.name in ("nt", "dos", "ce"): # DOS/Windows os.system('CLS') else: # Fallback for other operating systems. print '\n' * numlines

Looking for something else?

Not the answer you are looking for? Search for more explanations.