On Wed, Dec 10, 2008 at 7:48 AM, Gareth at Serif <[EMAIL PROTECTED]> wrote:

> Given that, for testing purposses, I have a property called 'testfile' set
> to the path of a valid MP3 file, I then try to output the artist name with
> the following, where ID3v2 is a class defined in MP3Info:
> song = ID3v2(testfile)
> print '\nArtist is: %s' % (song.artist)
>
> When I execute this script I get an error, "AttributeError: 'str' object has
> no attribute 'seek'".

The ID3v2 constructor wants a file object as a parameter, not a
string. It is trying to call testfile.seek() which causes the error
you see.

Try ID3v2(open(testfile))

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to