18 lines
411 B
Python
18 lines
411 B
Python
import curses, curses.textpad
|
|
def setup_input():
|
|
inp = curses.newwin(8,55, 0,0)
|
|
inp.addstr(1,1, "Please enter your username:")
|
|
sub = inp.subwin(2,1)
|
|
sub.border()
|
|
sub2 = sub.subwin(3,2)
|
|
global tb
|
|
tb = curses.textpad.Textbox(sub2)
|
|
inp.refresh()
|
|
tb.edit(enter_is_terminate)
|
|
|
|
def enter_is_terminate(x):
|
|
if x == 10:
|
|
tb.do_command(7)
|
|
tb.do_command(x)
|
|
|
|
setup_input() |