Python. Limitation of input data


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
5 views
Not a programmer, I mess around with Python just4fun. There was a question raw_input — is it possible to forcibly limit the amount of input data? Tried to Google the answer if I googled wrong, or common there is no solution, or no one needs, because Python has a built-in automatic protection against the fool and can not bother.
by | 5 views

4 Answers

0 like 0 dislike
For example, s = sys.stdin.read(10) write in's only 10 bytes.
by
0 like 0 dislike
I think you can play with the parameters of the readline
or use curses
or high-level wrapper over it — urwid
by
0 like 0 dislike
Validate after input, no?
by
0 like 0 dislike
Yes, but if the user has entered stabization characters?
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
asked Jun 2, 2019 by Ui5509
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
25,907 users