On 27/02/15 12:31, Rishi Ganesh V wrote:

in the script it is like
def convert(inputfile, outputfile):
   reader = csv.reader(open(inputfile, "rb"))
   file = open(outputfile, 'w+')
......



inputfile=sys.argv[1] , output file=sys.argv[2]

convert(inputfile,outputfile)

The assignments need to be on separate lines not comma separated

Then, assuming your script is called myscript.py you call it like

$ python myscript.py myinputfile.csv myoutputfile.txt

You can find more in the "talking to the User" topic of my
tutorial (see below)

Please do not send the entire digest, some people pay by the byte.

Also change the subject line to something descriptive so it can be found in the archives.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to