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

O

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?
 
T

Tal Einat

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+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
 
O

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:
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+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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top