Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python raw_input() limit with Mac OS X Terminal?

I wrote a python script and have been running it in terminal on Mac OS X snow leopard using python2.6. I used raw_input() to import text in several places, but I seem to reach a limit where it will no longer accept any more characters.

Is this a limit in python raw_input() or is this something to do with Terminal or Mac OSX?

Is there a better way to have the user input larger amounts of text in python?

like image 970
Thursdays Coming Avatar asked Sep 09 '11 03:09

Thursdays Coming


1 Answers

I had this same experience, and found python limits the length of input to raw_input if you do not import the readline module. Once I imported the readline module, it lifted the limit (or at least raised it significantly enough to where the text I was using worked just fine).

like image 153
Eric F. Avatar answered Sep 28 '22 22:09

Eric F.