title: Read string up to a certain size in Python
body: <p>I have a string stored in a variable. Is there a way to read a string up to a certain size e.g. File objects have f.read(size) which can read up to a certain size?</p>