diff --git a/guicurses/widgets.py b/guicurses/widgets.py index 77aba15..5cefc15 100644 --- a/guicurses/widgets.py +++ b/guicurses/widgets.py @@ -41,7 +41,7 @@ enter selects default button or displays error if not one self.draw() def initialDraw(self): - for i in xrange(0, len(self._controls)): + for i in range(0, len(self._controls)): co = self._controls[i] c = co[0](screen=self.screen, base=self.base, y=i, can_go_back=self.can_go_back, **co[1]) self.controls.append(c) @@ -275,7 +275,7 @@ The following synonyms are supported where possible: y, x = self.win.getyx() l = len(self.text) if l < self.maxy: - for i in xrange(l): + for i in range(l): self.win.move(i, 0) self.win.clrtoeol() self.win.addstr(i, 0, ''.join(self.text[i])) diff --git a/guicurses/window.py b/guicurses/window.py index 80a431e..f066911 100644 --- a/guicurses/window.py +++ b/guicurses/window.py @@ -1,7 +1,7 @@ import sys import time import curses -import widgets +from . import widgets class Window(object): @@ -11,8 +11,8 @@ class Window(object): self.screen.keypad(0) self.screen.nodelay(0) curses.nocbreak() - except Exception,e: - print "error" + except Exception as e: + print("error") sys.exit() quit=exit @@ -111,4 +111,4 @@ class Window(object): controls.append((widgets.Button, dict(prompt=i[1], action=i[0]))) if is_submenu: controls.append((widgets.Button, "Back")) - return controls \ No newline at end of file + return controls