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

Discussion in 'Python' started by owl, Nov 15, 2007.

  1. owl

    owl Guest

    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?
     
    owl, Nov 15, 2007
    #1
    1. Advertising

  2. owl

    Tal Einat Guest

    On Nov 15, 10:20 pm, owl <> wrote:
    > 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
     
    Tal Einat, Nov 17, 2007
    #2
    1. Advertising

  3. owl

    owl Guest

    On Nov 17, 3:27 pm, Tal Einat <> wrote:
    > On Nov 15, 10:20 pm, owl <> wrote:
    >
    >
    >
    > > 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


    Thanks!
     
    owl, Nov 22, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad

    Clear all fields on a screen

    tshad, May 19, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,286
    tshad
    May 20, 2005
  2. Ollie
    Replies:
    0
    Views:
    373
    Ollie
    Oct 2, 2003
  3. David

    Response.Clear() doesn't clear

    David, Jan 31, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    1,039
    Mark Fitzpatrick
    Jan 31, 2008
  4. Brian Cole
    Replies:
    1
    Views:
    303
    Robert Kern
    Dec 19, 2008
  5. InvalidLastName

    Unrecognized element 'add' after <clear></clear>

    InvalidLastName, Feb 26, 2007, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    971
    Steven Cheng[MSFT]
    Mar 6, 2007
Loading...

Share This Page