iterating over each char in the file in a more pythonic way, though still not happy with retaining all of the branches from the C version

cat-town
Dan Buch 15 years ago
parent 2cb096e27e
commit 996ade6414

@ -8,14 +8,16 @@ FILE = {'fp': None}
def simple_attr(stdscr):
row, col = stdscr.getmaxyx()
prev = ''
for ch in FILE['fp'].read():
fp = FILE['fp']
for line in fp:
for ch in line:
y, x = stdscr.getyx()
if y == (row - 1):
stdscr.addstr(row - 1, 0, "<-Press Any Key->")
stdscr.getch()
stdscr.clear()
stdscr.move(0, 0)
if prev == '/' and ch == '*':
elif prev == '/' and ch == '*':
stdscr.attron(curses.A_BOLD)
y, x = stdscr.getyx()
stdscr.addstr(y, x - 1, '/{0}'.format(ch))

Loading…
Cancel
Save