I am trying to put information available on the web, and to do so I am using string formatting:
fields = """{"fname" : %s, "lname" : %s, "email" : %s, "deptid" : deptid, "active" : active, "sentient" : sentient}""", (fname, lname, email)
with various values for each of the three variables.
Anyway, when I try to view fields, it still shows the %s! How do I actually make it replace it?
The character you are looking for is %, not ,.
as in
fields = """{"fname" : %s, "lname" : %s, "email" : %s, "deptid" : deptid, "active" : active, "sentient" : sentient}""" % (fname, lname, email)