PREV INDEX NEXT

Author: Sami
Subject: Pretty Input Prompt
Date: Tuesday, 13 Oct 2020, 20:53:35

I was wondering if you have any tips on the best way to read in lines from stdin with the pretty '(1)$ ' prompt. I notice that Python's 'input()' function takes a prompt but does something strange with escape chars. Alternatively, Python's 'sys.stdin.getline()' function doesn't have that strange behavior, but also does not accept a prompt. Any tips would be greatly appreciated. (p.s. I went to the peer tutor office hours, and it seems that other students have had this question and that the peer tutors do not have a clear solution)
PREV INDEX NEXT