This worked fine before but now I get the error
C:\...\Django\sw2\wkw2>csv2json.py csvtest1.csv wkw2.Lawyer
Converting C:\...\Django\sw2\wkw2csvtest1.csv from CSV to JSON as C:...
\Django\sw2\wkw2csvtest1.csv.json
Traceback (most recent call last):
File "C:\...\Django\sw2\wkw2\csv2json.py", line 37, in <module>
f = open(in_file, 'r' )
IOError: [Errno 2] No such file or directory: 'C:\\...\\Django\\sw2\
\wkw2cvtest1.csv'
From the snippet
http://www.djangosnippets.org/snippets/1680/:
31 in_file = dirname(__file__) + input_file_name
32 out_file = dirname(__file__) + input_file_name + ".json"
34 print "Converting %s from CSV to JSON as %s" % (in_file, out_file)
36 f = open(in_file, 'r' )
37 fo = open(out_file, 'w')
It seems to combine the directory name and file name?
Thanks.