Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Playground question
#1
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?
Reply
#2
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.
Reply
#3
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.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020