Python Forum
Python Playground question - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Python Playground question (/thread-31789.html)



Python Playground question - Euler314 - Jan-03-2021

Hello,

I'm trying to teach myself Python so I bought two books so far: "Python Crash Course" and "Python Playground". I'm working through "Python Crash Course" but I also just started "Python Playground" and I've run into a problem with the latter.

I was able to get the iTunes playlist to install Matplotlib and proceed without an error by running

pip install numpy==1.19.3

at the command line. Now I'd like to know how to use argument parser code in order to enter the locations of the iTunes playlist files "maya.xml" and "rating.xml".

I've tried running it from the command line with the following:

$ python playlist.py --common test-data/maya.xml test-data/rating.xml

but it can't find the two xml files.

In the code, I think the correct line to enter the file names is:

group.add_argument('--common', nargs='*', dest='plFiles', required=False)

but when I substitute the file names for "--common" or "*", the program still can't find the files.

Can someone please tell me how to do this?


RE: Python Playground question - Larz60+ - Jan-03-2021

numpy is not an iTunes player.

In the introduction, and/or appendix of the books, you should find download sites where all code and data should be available. Most all books written today will have that. If not, email the author and ask how to obtain.


RE: Python Playground question - Euler314 - Jan-04-2021

I don't believe I said numpy was an iTunes player. I said I had to run that line of code so that Matplotlib would install and the code would proceed without error. I used the suggestion found here:

https://tinyurl.com/y3dm3h86

I'm using the author's code which I downloaded.