Author Topic: Clear screen python  (Read 1558 times)

rhodysurf

  • Noob
  • *
  • Posts: 31
  • Reputation: 4
  • Computers: Lenovo Thinkpad Edge running Windows 8, Ubuntu, and mac osx in a vm
  • iDevices: Iphone 4 iOS 5.1.1
Re: Clear screen python
« Reply #15 on: August 28, 2012, 04:31:56 pm »
An example of calling a function is os.system() or time.sleep(). You call tese functions from the modules you import such as time or os.

Winning

  • Hero Member
  • *****
  • Posts: 1632
  • Reputation: 26
  • I think I saw this in a movie
  • Computers: Toshiba Thrive Tablet
  • iDevices: iPod touch 4G
Re: Clear screen python
« Reply #16 on: August 28, 2012, 05:18:33 pm »
Ok now what about turning the area script into a function because I am assuming that is why it is just automatically running?

A12danrulz

  • Leader
  • Hero Member
  • *****
  • Posts: 4078
  • Reputation: 221
  • Badges:
Re: Clear screen python
« Reply #17 on: August 28, 2012, 05:35:02 pm »
To clear the screen just use print "\n" * 50

Winning

  • Hero Member
  • *****
  • Posts: 1632
  • Reputation: 26
  • I think I saw this in a movie
  • Computers: Toshiba Thrive Tablet
  • iDevices: iPod touch 4G
Re: Clear screen python
« Reply #18 on: August 28, 2012, 05:36:01 pm »
Won't that not clear it just scroll all the way down so you can't see anything?^

A12danrulz

  • Leader
  • Hero Member
  • *****
  • Posts: 4078
  • Reputation: 221
  • Badges:
Re: Clear screen python
« Reply #19 on: August 28, 2012, 05:36:53 pm »
Yes, but os.system is ugly, depreciated, and generally highly frowned upon.

Don't like seeing ads? Click here to register!

Winning

  • Hero Member
  • *****
  • Posts: 1632
  • Reputation: 26
  • I think I saw this in a movie
  • Computers: Toshiba Thrive Tablet
  • iDevices: iPod touch 4G
Re: Clear screen python
« Reply #20 on: August 28, 2012, 05:38:48 pm »
The same was said about input but now it's the only option....

A3MIRAL

  • Leader
  • Hero Member
  • *****
  • Posts: 2913
  • Reputation: 105
  • A3MIRAL -- Reporting for Duty
    • A3MIRAL
  • Badges:
  • Computers: Dell XPS15 (6 GB ram, Core i7 @ 2.0 GHz, 750 GB HDD @ 7200 RPM)
  • iDevices: iPod touch 3G 32GB, iPhone 5 32GB
Re: Clear screen python
« Reply #21 on: August 28, 2012, 06:24:44 pm »
Again, i know 0 python, but how could input be frowned upon? That would basically say "i frown upon modularizing code" which would be a terrible thing and lead to terrible python code and the language would die. (done with my dreaming..)

Winning

  • Hero Member
  • *****
  • Posts: 1632
  • Reputation: 26
  • I think I saw this in a movie
  • Computers: Toshiba Thrive Tablet
  • iDevices: iPod touch 4G
Re: Clear screen python
« Reply #22 on: August 28, 2012, 06:40:05 pm »
Something about input being unstable in python 2 and people being able to see your code idrk the full story. They ended up taking it out in python 3 and changing the function of raw_input to input but iPods still run python 2.

A12danrulz

  • Leader
  • Hero Member
  • *****
  • Posts: 4078
  • Reputation: 221
  • Badges:
Re: Clear screen python
« Reply #23 on: August 28, 2012, 06:46:14 pm »
Input isnt bad at all, just never ever ever ever use input on a networking program. Ever.

A3MIRAL

  • Leader
  • Hero Member
  • *****
  • Posts: 2913
  • Reputation: 105
  • A3MIRAL -- Reporting for Duty
    • A3MIRAL
  • Badges:
  • Computers: Dell XPS15 (6 GB ram, Core i7 @ 2.0 GHz, 750 GB HDD @ 7200 RPM)
  • iDevices: iPod touch 3G 32GB, iPhone 5 32GB
Re: Clear screen python
« Reply #24 on: August 28, 2012, 06:56:31 pm »
Input isnt bad at all, just never ever ever ever use input on a networking program. Ever.

Seems like you're saying it's a bad idea...why?
Seems silly...

Don't like seeing ads? Click here to register!

A12danrulz

  • Leader
  • Hero Member
  • *****
  • Posts: 4078
  • Reputation: 221
  • Badges:
Re: Clear screen python
« Reply #25 on: August 28, 2012, 07:04:09 pm »
Input is fine, but if you use it on a networking program, they could send __import__('os').system(cmd) just replace cmd with any Linux command and it gets executed. Or could make a Backdoor, or whatever they want.

Winning

  • Hero Member
  • *****
  • Posts: 1632
  • Reputation: 26
  • I think I saw this in a movie
  • Computers: Toshiba Thrive Tablet
  • iDevices: iPod touch 4G
Re: Clear screen python
« Reply #26 on: August 28, 2012, 07:42:44 pm »
^ although didn't they get rid of that in python3 and just replace raw_input functions with input and do away with the old input and raw_input?

A12danrulz

  • Leader
  • Hero Member
  • *****
  • Posts: 4078
  • Reputation: 221
  • Badges:
Re: Clear screen python
« Reply #27 on: August 28, 2012, 07:43:10 pm »
But you are on 2.5.1 not 3...

Winning

  • Hero Member
  • *****
  • Posts: 1632
  • Reputation: 26
  • I think I saw this in a movie
  • Computers: Toshiba Thrive Tablet
  • iDevices: iPod touch 4G
Re: Clear screen python
« Reply #28 on: August 28, 2012, 07:45:48 pm »
True but if I ever used it for networking I would use my comp which is on 3

8BitAce

  • Hero Member
  • *****
  • Posts: 703
  • Reputation: 57
  • If at first you don't succeed; call it version 1.0
  • Computers: Toshiba L505D-GS6000
  • iDevices: iPad 2 16GB WiFi, iPod 2g, iPod 4g
Re: Clear screen python
« Reply #29 on: August 28, 2012, 08:00:40 pm »
Again, i know 0 python, but how could input be frowned upon? That would basically say "i frown upon modularizing code" which would be a terrible thing and lead to terrible python code and the language would die. (done with my dreaming..)
I don't think it was a dream, I saw it too ;)