Bob Williams <li...@barrowhillfarm.org.uk> writes:

> In [3]: print metadata["artist"]
> [u'The Incredible String Band']
>
> I now want to pass that string to another program, but I want to strip
> off the leading [u' and the trailing '].

You may be assuming that ‘metadata["artist"]’ is a text string; I
suspect it is not.

Try ‘type(metadata["artist"])’, to get Python to tell you what the type
of that object is.

-- 
 \          “Those who write software only for pay should go hurt some |
  `\                 other field.” —Erik Naggum, in _gnu.misc.discuss_ |
_o__)                                                                  |
Ben Finney

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to