html related ques

Asked by sanjana

Hi exit() command works fyn

One more question related to html
Sikuli script is:
a=2 #var
op=open('C:\\test.html','w')
op.writelines(("value of var a is "))
How to print the value of variable "a" to the test.html file

Expected output:
value of var a is 2

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
sanjana
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

op.writeline("value of var a is " + str(var))

Python has a the string format command too, that allows, to prepare a template string with placeholders for variables, that are filled in at runtime:

op.writeline("value of var a is %d" % (var))

look: http://docs.python.org/2.6/library/string.html#string-formatting

Revision history for this message
sanjana (savi-jc) said :
#2

Thanks.. Its working fyn