quot; become "stdscr" but if I
> > obviously can not even define any new methods or properties. But atleast
> > the references can be used through out the class with out crashing."""
> > import curses
> > class CursesApp:
> >def __init__(self, stdscr):
> >self.Screen=stdscr #This is the stdscr object.
> >curses.init_pair(1,curses.COLOR_BLUE,curses.COLOR_YELLOW)
> >self.Screen.bkgd(' ', curses.color_pair(1))
> >self.mainLoop()
> >
> >def mainLoop(self):
> >while 1:
> >self.Screen.refresh()
> >key=self.Screen.getch()
> >if key==ord('q'): break
> >
> > def main():
> >cursesapp = curses.wrapper(setup)
> >
> > def setup(stdscr):
> >CursesApp(stdscr)
> >
> > if __name__ == '__main__':
> >main()
> >
> > ___
> > Tutor maillist - Tutor@python.org
> > To unsubscribe or change subscription options:
> > http://mail.python.org/mailman/listinfo/tutor
> >
--
Message: 2
Date: Wed, 15 Jun 2011 02:20:27 -0700
From: "Mark Tolonen"
To: tutor@python.org
Subject: Re: [Tutor] trying to translate and ebcidic file
Message-ID:
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=original
"Prinn, Craig" wrote in message
news:6b49a56a6e493f4eba255f6f197f070f050e4fe...@bbh-mail1.bbh.priv...
> I am looking for a way to translate and ebcidic file to ascii. Is there a
> pre-existing library for this, or do I need to do this from scratch? If
> from scratch and ideas on where to start?
There are a couple of EBCDIC codecs (see list of codecs in
http://docs.python.org/library/codecs.html).
Try:open('file.txt').read().decode('ibm500').encode('ascii','replace')
You'll get '?' for chars ascii doesn't support.
-Mark
--
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
End of Tutor Digest, Vol 88, Issue 54
*
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor