Why doesn't Python include non-blocking keyboard input function?

Chris Angelico rosuav at gmail.com
Thu Oct 27 18:31:00 EDT 2016


On Fri, Oct 28, 2016 at 9:02 AM, BartC <bc at freeuk.com> wrote:
>
> I notice that when it comes to reading command-line arguments, then Python's
> sys.argv presents them as a list, not one long string.
>
> And the list is just a series of strings, so needing to know whether any
> parameter was a number or whatever obviously wasn't a problem. It just makes
> each item into a string (actually that might be a better default than mine).
>
> This is a very similar issue to reading items from a line of user input.
>
> So why doesn't sys.argv just return a single string if a line is so easy to
> parse?

Because the OS provides a series of strings, not just one string. When
you exec to a process, you provide multiple arguments, not a single
combined string.

ChrisA



More information about the Python-list mailing list