0
i want to show value that is retrieved from database and stored in variable to text field .<input type=text name="" value =""> i want to show value in it..what is the method to print in python script
plzzzzzzzzzz help
7 Réponses
0
print ()
If you wanted to know how to print the variable in the html string, you could just concatenate it. E.g print("value ="+str (variable)).
Or you could use the format method which is print("value = {}".format (variable)). If your variable is already a string, you don't need to use the str function. The format method is more useful if you want to use multiple variables in a string. It is easier to type out than concatenating. E.g print ("Traveled {}metres in {} seconds.".format(distance, time))
You can also pass the variables as a tuple. E.g print ("value = %s" % (variable)).
Hope this is what you were looking for.
0
but i am writing this code inside the python script using print (<input....and so on) how to write in this situation
0
actually i am making a edittable table using textfields.so i am able to send the data to database and when i try to retrieve the data i am not able to show in textfield how to do that ??
0
print ("<input type=\"text\" name=\"\" value={}".format(variable))
0
sir i try it but its not working my apache error log showing that syntax error
0
thanku gershon fosu its working..thanku man
0
Glad I could help