Re: [Tutor] Editing values from a dictionary

2014-02-26 Thread Steven D'Aprano
On Wed, Feb 26, 2014 at 05:09:49PM +, Bob Williams wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi List, > > I have two problems, but it's possible that one solution will suffice. > I am using a module called mutagen to extract audio metadata from > .flac files. The output of

Re: [Tutor] Editing values from a dictionary

2014-02-26 Thread Bob Williams
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 26/02/14 17:29, Ben Finney wrote: > Bob Williams 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 ']

Re: [Tutor] Editing values from a dictionary

2014-02-26 Thread Krishnan Shankar
Hi Bob, >>> In [3]: print metadata["artist"] [u'The Incredible String Band'] <<< Here u' and ' is not something you can strip off as it is part of python datatype called UNICODE. Python prints a word or sentence in double or singles quotes when it is a STRING or UNICODE in interpreter. These are

Re: [Tutor] Editing values from a dictionary

2014-02-26 Thread Ben Finney
Bob Williams 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. Tr