How to concatenate variables to a string --- use str(var) for non-strings

Asked by Venkata Sandeepu Lade

Hi,
I want to concatenate two variables in type statement
could you please let me know how to do that ?

Ex:
perlscript is one variable and customer is second variable
type("nohup perl "+perlscript+" "+customer)
The above is giving error TypeError: cannot concatenate 'str' and 'float' objects

please help

Thanks
Sandeep

Question information

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

type("nohup perl "+str(perlscript)+" "+str(customer))

I casted both variables, since it is not obvious which is the float ;-)

Revision history for this message
Venkata Sandeepu Lade (venkatasandeep-lade) said :
#2

Thanks RaiMan, that solved my question.