Forums » General Discussion Search

Total Noob to Python New Reply

Author Post
Posts: 1
Registered: May 27, 2010

I've just started working with Python this morning and was intrigued by the "swinger.py" output. I've installed python and (I think) everything I need to operate in Echo Nest. I'm using windows xp which I'm guessing is not the norm here. In the command prompt I have

C:Python26>python swinger.py Usage: swinger.py [options]

Options: -h, --help show this help message and exit -s SWING, --swing=SWING swing factor default=0.33 -v, --verbose show results on screen

C:Python26>

What do I need to do from here?

Thanks,

Posts: 666
Registered: Sep 08, 2008

Hi Bernico

Did you get an API key yet? If not, then go to developer.echonest.com and get one. Once you have an API key, follow the directions here to set it up:

http://code.google.com/p/echo-nest-remix/wiki/DeveloperKeySetup

After that you are ready to start swinging. To swing a file type something like this:

C:> python swing.py \path\to\music\file.mp3

Wait a minute for it to run, and it should create a file in your current directly with a name like file_swing+33.mp3

Have fun!

Posts: 4
Registered: May 26, 2010

Howdy plamere

So... I'm sort of in the same boat. Total noob with python. I started using it a few months ago for something(can't remember what), but soon other things took priority.

I was also interested in the swinger code and have found a few more that are interesting.

First of all, I had problems with setting my key (I ended up editing my environment variables). But here is what I got in python when I tried setting it using that method(* for protection):

config.ECHO_NEST_API_KEY = A***MPFE Traceback (most recent call last): File "", line 1, in NameError: name 'AMPFE***' is not defined


I've tried running the swinger.py code from the command prompt and these are the results:

C:Python26ToolsScripts>python swinger.py ../music/Discipline.mp3 File "swinger.py", line 4 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose .dtd"> ^ SyntaxError: invalid syntax


I've tried running swinger.py from the root(c:), but I get this error:

C:>python swinger.py python: can't open file 'swinger.py': [Errno 2] No such file or directory


Sorry about the length of this message, and for jumping on your thread(bernico). I just wanted to include a description of every problem I've run into in case this helps you deduce my problem.

e.g. Are there any other commands I have to enter prior to running swinger.py? Is there any useful/simple resource for digging into this as a beginner?

Thank you so much to everyone who has done work on this project. I'm looking forward to using it, and learning what else I can do.

Thanks

Posts: 4
Registered: May 26, 2010

Sorry, the pasted code didn't show the line breaks... forgot to format it properly.

I hope this still makes sense.

Thank you

Posts: 4
Registered: May 26, 2010

Here are the fixed codes with proper formatting in case it helps:

config.ECHO_NEST_API_KEY = AaaaaaaPFEaaaaaa
Traceback (most recent call last): File "[stdin]", line 1, in [module]
NameError: name 'AaaaaaaMPFEaaaaaa' is not defined



C:Python26ToolsScripts>python swinger.py ..musicDiscipline.mp3
File "swinger.py", line 4
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd
">

^
SyntaxError: invalid syntax

____
C:Python26remix>python swinger.py
python: can't open file 'swinger.py': [Errno 2] No such file or directory

Reply to this Thread

You must log in to post a reply.