How do we get python print statements to show up in the IDE or Console?

Asked by Mo D

Using sikulixsetup-1.1.0-20150515.231040-71-forsetup

When I first started using the IDE, I was able to see the output of python print statements within methods. Now all of a sudden (it seems after I played around with Settings class), I don't see any print statements being outputted from my methods.

I verified that the method is being called by using popup method after the print statement, and I can see the popup.

I also ended up setting all logs to True for the Settings class.

Any idea what's going on here? Any help would be greatly appreciated.

Thanks!

Question information

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

start the IDE from command line using the runsikulix.cmd with no options.

Just use a simple print "test" in a new tab.

test should be printed in the message area.

if this is not the case, come back

Revision history for this message
Mo D (m3dabbag) said :
#2

Hi,

Thank you for the quick reply. So I'm on mac 10.10.3 and tried ./runsikulix -i and opened the interactive session. I did print "test" and it worked.

Just to clarify, I see print statements that are inside of classes I have (which are in different folders that I add to the sys.path), but it's only print statements inside of the methods in these classes that I can't see outputted anymore.

for example:
main_runner.sikuli
  - run unnitest testclass1

testclass1.sikuli
  print "inside of class" ---> able to see the print in the console/IDE
  def setUp(self):
    print "inside of setup" ---> Not able to see print statement in the console/IDE
....teardown and a test method is also inside

Thank you for your time.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Surely has nothing to do with Sikuli.
Might be a Jython problem.

Did this start after you switched to 1.1.0-20150515?

Around this time I switched to Jython 2.7.0

you should run your main_runner.sikuli from command line
runsikulix.cmd -r main_runner.sikuli

If you do not get the function prints to the command line: Jython problem.

To get deeper into the problem you should send me some zipped stuff, where I can see your script/module/class/method setup.
No complete scripts, only some templates.

my mail at top left of https://launchpad.net/~raimund-hocke

Revision history for this message
Mo D (m3dabbag) said :
#4

It might be the way my classes are setup? Not really sure to be honest. I've sent you an email with a .zip of my current template.

I didn't upgrade or switch to any version, that version was the first one I installed and it did work at first, but then I started playing around with the Settings class and after that print statements from inside methods stopped working.

Running the main_runner.sikuli from the command line yields the same results as the IDE, I don't see the print statements from methods, so like you said, probably a Jython problem. Just confused why all of a sudden this started happening. I can live without print statements I guess (replace with popup methods) but it's just a lot more hassle and slower.

Thank you very much for your time and help!

Can you help with this problem?

Provide an answer of your own, or ask Mo D for more information if necessary.

To post a message you must log in.