showmonitors() value get save as None to a variable

Asked by Chetan

we are using below code
monitorInfo=str(showMonitors())
   print("Monitor: " + monitorInfo)
*****
here monitorInfo is printed as none

however if we directly print showMonitors() then it gets printent but not in next line but at random

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

showMonitors() does not return anything (hence None), but prints a line for each monitor to StdOut.

sthg. like this?

screens = ""
for i in range(Screen.getNumberScreens()):
   screens += "Screen %d: %s || " % (i, Screen(i))
print screens

Revision history for this message
Chetan (cshamdas) said :
#2

Thanks RaiMan, that solved my question.