Run python script from command line not working

Hi -

This has to do with the way windows handles output. You don’t always see output in the command console the way you would on a linux or mac system (some windows expert can explain the details). But Slicer does run the script and if you need to get output from it you can write to a file.

For example if you run this script you should see the output printed in the python console for a second before the program disappears. (Assumes you had the python console open when you last exited slicer and you don’t use the --no-main-window option).

print(40+2)
qt.QTimer.singleShot(1000, exit)
1 Like