PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs323] Pretty Input Prompt
Date: Wednesday, 14 Oct 2020, 06:59:28


    > Message Posted By: Sami
    >
    > 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)

Dear Sami,

I have no idea what the best way is; my Python solution
uses stdio.write and stdin.readline.

Best,

--Stan-
PREV INDEX NEXT