To convert a string into python dictionary is not at all difficult all you have to do is to
import ast
a_string=u"{1: 'FA-1', 2: 'FA-2', 3: 'SA-1', 4: 'FA-3', 5: 'FA-4', 6: 'SA-2'}"
a_python_dictionary=ast.literal_eval(a_string)
23 Friday Nov 2012
Posted in Programming
To convert a string into python dictionary is not at all difficult all you have to do is to
import ast
a_string=u"{1: 'FA-1', 2: 'FA-2', 3: 'SA-1', 4: 'FA-3', 5: 'FA-4', 6: 'SA-2'}"
a_python_dictionary=ast.literal_eval(a_string)
my question to you is “How did you put your code in this style?” Like 1,2,3,4 comes in rows and it looks beautiful. How did you do that? help me to learn that.
http://deepeshsingh93.wordpress.com/
I am not too sure if I am getting your query right but if you are referring to this a_string=u”{1: ‘FA-1′, 2: ‘FA-2′, 3: ‘SA-1′, 4: ‘FA-3′, 5: ‘FA-4′, 6: ‘SA-2′}” then its a very simple matter in python.
No no brother. I am not asking about the code. I am asking about the design. What is the html code behind. What kind of tag you have used to write the codes in between. If I check your Source, I can find
import ast a_string=u"{1: 'FA-1', 2: 'FA-2', 3: 'SA-1', 4: 'FA-3', 5: 'FA-4', 6: 'SA-2'}" a_python_dictionary=ast.literal_eval(a_string)So from where you got this html code.
ohh that its not a problem at all just use [ s ou rceco de][/s our ce code] “and write your code in between without any space in the tags I had to add those spaces to for escaping
Thank you bro. I got it.
http://deepeshsingh93.wordpress.com/2012/10/13/making-a-calculator-with-javascript/