[Tutor] Limit on number of characters in a string?

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Thu Oct 9 20:21:33 EDT 2003



On Sun, 21 Sep 2003, Jeffery Chin wrote:

> Is there a limit on how many characters can be in a string?  I'm using
> pythonwin with python 2.3 and there seems to be a limit.
>
> I'm trying to concatenate lines from a file to make one continuous string
> and it won't grow beyond a certain length.
> I think it cuts it off around 3800 characters, but this was not consistent,
> but looking at the screen output, it certainly would not add more to the
> string.


Hi Jeffery,

There shouldn't be any hardcoded limit to the number of characters a
string can contain -- I've often had strings that were several megabytes
long.  *grin*


Your code snippet:


>     elif (record_check == ','):
>         interim_list.append(logline_path + entry + '.txt;')


is a little confusing, though: as far as I can tell, there's no string
concatentation going on!  Can you show us where you actually generate the
string?


Good luck to you.




More information about the Tutor mailing list