Hi Terry,

> > You should be able to re-produce the above at Python 2's `>>> '
> > prompt.
>
> I was certainly getting error messages in the Python shell, but they
> only popped up when I tried the subprocess.Popen() statement mentioned
> in my last message, with an error of:
>
>       TypeError: execv() arg 2 must contain only strings

But that's your earlier faulty code and isn't even running mpg321 to
give it a chance to complain about missing files.  You should be able to
reproduce my findings by copying exactly what I did here at your Python
installation to prove mpg321 does complain about missing files to
stderr, and that you get to see them.

> When I tried to play the long string of filenames mentioned earlier
> there were no errors.

I know.  And that seems wrong if you weren't discarding stderr, which is
why I'm trying to help test it.  :-)

> > It's the fourth example in that link I gave that you went and read.
> > :-) https://docs.python.org/2/tutorial/introduction.html#lists
>
> That gives the error:
>
>       TypeError: cannot concatenate 'str' and 'list' objects
>
> I am trying to join 'mpg321' to the list with no other parameters for
> the moment.

'mpg321' is a string, type `str' in Python.  You had a list of mpg321
arguments.  Even if you want to drop all the other arguments for the
moment, it still needs to be a list;  a list of one string.  The fourth
example is joining two lists.  You can't concatenate a list to a string,
as that error says.

A lot of time would be saved by reading about the Python basics.  Not
all the standard library functions, not how to write your own object
classes, and all the odd corners of Python, but chapters 1 to 5 of
https://docs.python.org/2/tutorial/index.html to give a grounding for
reading about the specific things you need to do and how to join them
together.  It doesn't have to be memorised either, just familiar enough
to recognise the syntax and know where to go back to read about it.

Cheers, Ralph.

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:[email protected] / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue     / TO THE LIST OR THE AUTHOR

Reply via email to