I'm creating a curses terminal GUI using Python but the first I start the script and I stop it, the terminal output is totally broken. Every new lines are printed after the length of the previous one.
For example:
self.player_screen() │
│ File "main.py", line 76, in player_screen │
│ for player_state in player: │
│ File "/home/jerome/PycharmProjects/project/main.py", line 40, in current_play │
│ sleep(1) │
│ KeyboardInterrupt
I don't find why the terminal output is broken and how to fix this. I use the Python curses package like the doc say:
def login_screen(self):
login_title = "Please login using your username/id:\n"
login_screen = newwin(0, 0)
login_screen.box()
v_dim, h_dim = login_screen.getmaxyx()
login_screen.addstr(round(v_dim / 2), round((h_dim - len(login_title)) / 2), login_title)
username_input = login_screen.subwin(1, 44, round(v_dim / 2 + 1), round((h_dim - 44) / 2))
username_text_input = textpad.Textbox(username_input)
username_input.refresh()
login_screen.addstr(v_dim - 1, h_dim - 20, "[Enter]Submit")
login_screen.refresh()
username = username_text_input.edit()
endwin()
I don't find anything wrong in my code an nothing the helped me inside the doc.
Did someone already had this problem and solved it?