I was able to spot four problems in your code dear..
1. its not the generally used subtraction operator you are using. It is something else.. I have no idea what the character is.
2. the semicolon on line 53... that is what is causing the error 'else withou an if', remove that semicolon and you are good
3. variable tax has not been initialised.. give it some initial value like -1
4. convert tax to string before you add...
User Profile
Collapse
-
hey,
could you put the code of the loop you are talking about... and also give some code around the lines 191, 69 and 141
I'll try to help :)
regards,
sharat87Leave a comment:
-
yes, in the example I showed you in my previous post... you just store the d_str string into the database... that's the string you will ever need.
using dumps(d, protocol=1) will give smaller strings, but will have binary data... i am not sure if those can be written to a databse.. but the code in my above post should work just fine
Note: i did not test it.. so if u have any more problems, just drop in here :)Leave a comment:
-
hello,
i'm not sure it would work... but try this
instead of the following two lines in your client.py,
do this...Code:data="Welcome to My Page" http.putrequest("POST", "/cgi-bin/server.py?id="+data)
...Code:import urllib data = "Welcome to my page" http.putrequest("POST", "/cgi-bin/server.py?id="Leave a comment:
-
if that's what you want, I suggest you take at look at how you can use the pickling library... you do something like this...
import pickle as pk
d={'a':'google' , 'b':80, 'c':'string'}
d_str = pk.dumps(d)
# put the string d_str into the database...
# get the string from the database and do
d = pk.loads(d_str)
# and there you have your dictionary back
i did not test the above code.. but...Leave a comment:
-
saving?
if you are saving the dictionary for later use (writing the string to a file and later reading it and reconstructing the dictionary...)
you may want to look at a serialization pattern like the pickling library.
regards,
sharat87Leave a comment:
No activity results to display
Show More
Leave a comment: