471,337 Members | 1,162 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

extension to idle to clear screen - but how to write to screen?

owl
and here I thought I was going to finally be able to change the world
AND contribute back to python with my amazing clear screen extension -
but I can't get it to work. ;(

Copying from ZoomHeight.py and someone else's clever print suggestion:
-------------------------------------------------
# My Clear extension: clear a window

class Clear:

menudefs = [
('windows', [
('_Clear', '<<clear>>'),
])
]

def __init__(self, editwin):
self.editwin = editwin

def clear_event(self, event):
for i in range(60):
print
--------------------------------------------------

It shows up as a menu item, but does not do anything. No output,
nuffin.
I did get some sort of 'no connection msg' playing around which leads
me to believe that I can't really write to the window (at least not
this simplistically)...

Pointers?
Nov 15 '07 #1
2 3632
On Nov 15, 10:20 pm, owl <john_now...@carleton.cawrote:
and here I thought I was going to finally be able to change the world
AND contribute back to python with my amazing clear screen extension -
but I can't get it to work. ;(

Copying from ZoomHeight.py and someone else's clever print suggestion:
-------------------------------------------------
# My Clear extension: clear a window

class Clear:

menudefs = [
('windows', [
('_Clear', '<<clear>>'),
])
]

def __init__(self, editwin):
self.editwin = editwin

def clear_event(self, event):
for i in range(60):
print
--------------------------------------------------

It shows up as a menu item, but does not do anything. No output,
nuffin.
I did get some sort of 'no connection msg' playing around which leads
me to believe that I can't really write to the window (at least not
this simplistically)...

Pointers?
Try this:
self.editiwin.write('\n'*60)
- Tal Einat
reduce(lambda m,x:[m[i]+s[-1] for i,s in enumerate(sorted(m))],
[[chr(154-ord(c)) for c in '.&-&,l.Z95193+179-']]*18)[3]

P.S. Feel free to contact the idle-dev mailing list: idle-dev <at>
python (dot) org
Nov 17 '07 #2
owl
On Nov 17, 3:27 pm, Tal Einat <tal.no.no.s...@gmail.comwrote:
On Nov 15, 10:20 pm, owl <john_now...@carleton.cawrote:
and here I thought I was going to finally be able to change the world
AND contribute back to python with my amazing clear screen extension -
but I can't get it to work. ;(
Copying from ZoomHeight.py and someone else's clever print suggestion:
-------------------------------------------------
# My Clear extension: clear a window
class Clear:
menudefs = [
('windows', [
('_Clear', '<<clear>>'),
])
]
def __init__(self, editwin):
self.editwin = editwin
def clear_event(self, event):
for i in range(60):
print
--------------------------------------------------
It shows up as a menu item, but does not do anything. No output,
nuffin.
I did get some sort of 'no connection msg' playing around which leads
me to believe that I can't really write to the window (at least not
this simplistically)...
Pointers?

Try this:
self.editiwin.write('\n'*60)

- Tal Einat
reduce(lambda m,x:[m[i]+s[-1] for i,s in enumerate(sorted(m))],
[[chr(154-ord(c)) for c in '.&-&,l.Z95193+179-']]*18)[3]

P.S. Feel free to contact the idle-dev mailing list: idle-dev <at>
python (dot) org
Thanks!
Nov 22 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Aubrey Hutchison | last post: by
3 posts views Thread by Miki Tebeka | last post: by
1 post views Thread by Tim Rice | last post: by
3 posts views Thread by writser | last post: by
6 posts views Thread by Andreas Tawn | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.