Boto seems to have a read() function that can do this. Here is the code that works for me:
>>> import boto >>> from boto.s3.key import Key >>> conn = boto.connect_s3('ap-southeast-2') >>> bucket = conn.get_bucket('bucket-name') >>> k = Key(bucket) >>> k.key = 'filename.txt' >>> k.open() >>> k.read(10) 'This text '
The read(n) call returns the next n bytes from the object.
Of course, this will not automatically return the โtitle barโ, but you can call it with a sufficiently large number to return the title bar at least.
John rotenstein
source share