This is fixed by modifying lines 31-32:
http://stackoverflow.com/questions/1894099/csv2json-py-error
On Dec 10, 3:12 pm, Zeynel wrote:
> This worked fine before but now I get the error
>
> C:\...\Django\sw2\wkw2>csv2json.py csvtest1.csvwkw2.Lawyer
> Converting C:\...\Django\sw2\wkw2csvtest1.csvf
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
Great, thank you. When I ran it in the command prompt it worked fine.
I noticed that the first column needs to be "pk" with rows starting
with integers.
On Nov 13, 11:24 pm, Karen Tracey wrote:
> On Fri, Nov 13, 2009 at 10:57 PM, Zeynel wrote:
> > Thanks, I tried but this did not work either:
>
On Fri, Nov 13, 2009 at 10:57 PM, Zeynel wrote:
> Thanks, I tried but this did not work either:
>
> >>> csv2json.py sw.csv wkw1.Lawyer
>
> File "", line 1
>csv2json.py sw.csv wkw1.Lawyer
> ^
> SyntaxError: invalid syntax
> >>>
>
>
You need to run the .py script from an OS she
Thanks, I tried but this did not work either:
>>> csv2json.py sw.csv wkw1.Lawyer
File "", line 1
csv2json.py sw.csv wkw1.Lawyer
^
SyntaxError: invalid syntax
>>>
I checked "stdin" but I didn't understand how it relates to this case:
http://en.wikibooks.org/wiki/Python_Pro
At line 21 of csv2json.py, change "import simplejson" to "from
django.utils import simplejson"
Now try running the csv2json.py script from the command line:
python csv2json.py sw.csv wkw1.Lawyer
See if that solves the problem.
Best,
Ben
On Nov 12, 2:14 pm, Zeynel wrote:
> Hi,
>
> my pro
Hi,
my project is in C:/sw1/wkw1
models are in C:/sw1/wkw1/models.py
Model name is Lawyer.
So, in the python shell I import simplejson with
from django.utils import simplejson
then I enter
csv2json.py sw.csv wkw1.Lawyer
and I get the error
>>> from django.utils import simplejson
>>> csv2js
What is the error message you are receiving?
R.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegr
Hello,
I am trying to use this CSV to JSon Fixture snippet but I couldn't
make it work.
http://www.djangosnippets.org/snippets/1680/
Can anyone help me to run this snippet.
I copy the instruction below.
Thank you.
--
The instructions for csv2json.py
9 matches
Mail list logo