0

I am a complete novice in python and I have already searched several entries in stackoverflow to help me but I am still struggling. I feel that this should be very easy to do. Your help is greatly appreciated.

I have the following script: https://github.com/openxc/openxc-data-tools/blob/master/tracecsv.py

My goal is to run it on a python shell on window xp to convert Json file like (http://openxcplatform.com.s3.amazonaws.com/traces/nyc/downtown-crosstown.json) in a format that can be saved as csv.

So far, when I run the following code on my python shell (after changing the directory to where my files are located) I get an error and I am not able to have the output csv I am expected:

Here are what I enter in the command shell and the error:

python tracecsv.py downtown-crosstown.json output_file_name

SyntaxError: invalid syntax

tracecsv.py downtown-crosstown.json output_file_name

SyntaxError: invalid syntax

My understanding is that tracecsv.py read the script saved in my specified directory and the next two string specify the input file to be used in the code (as sys.argv1 and sys.argv2). I am expecting a csv file to be saved in my specify directory with my json file converted in excel structure and ready for analysis. Thank you!

  • 3
    What's the error? What is your input? and What were you expecting to get ? – jramirez Nov 28 '13 at 00:03
  • Hi user3043853. I'm a novice in python, too, but I've hacked my way through a number of scripts. See my blog post about a different script that takes two args like yours; maybe you can at least get the initial part working. And please do try to share more info about the error(s) you're getting. http://thechrisgreen.blogspot.com/2013/04/python-script-for-getting-pixel-color.html – CRGreen Nov 28 '13 at 00:16
  • Welcome to Stackoverflow: You MUST, clearly, show the error you have got. Simply, edit your question and show the community the error that you talk about. – SaidbakR Nov 28 '13 at 00:21
  • possible duplicate of [What are good ways to make my Python code run first time?](http://stackoverflow.com/questions/299704/what-are-good-ways-to-make-my-python-code-run-first-time) – Paul Sweatte Jan 29 '14 at 19:17

0 Answers0