down vote favorite
I am new to json & have limited knowledge of python.
I am trying to make a class which reads & write JSON object to file taking 1 argument of dictionary type.
I am getting invalid syntax error (I am using eclipse IDE & PyDev plugin) but the output is coming on http://codepad.org/5tRBiJKj
Now how do I write and read this to a file ?
I am new to json & have limited knowledge of python.
I am trying to make a class which reads & write JSON object to file taking 1 argument of dictionary type.
class Student:
def __init__(self,name,email,contact,skills,ug=None,pg=None):
self.email=email
self.contact=contact
self.name=name
self.skills=[skills]
self.edu={"ug":[ug],"pg":[pg]}
james=Student("James","j@j.com","+1 7789990007","Python","CS", "CS")
print vars(james)
I am getting invalid syntax error (I am using eclipse IDE & PyDev plugin) but the output is coming on http://codepad.org/5tRBiJKj
Now how do I write and read this to a file ?