Pyton Script

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Pyton Script

Felix
This post has NOT been accepted by the mailing list yet.
Dear users,

After a whole day trying to order in my mind the huge amount of classes offered by slicer I'm not able to write this simple script:

I want to launch a slicelet which should load several nifti detailed as arguments and save the whole scene as a mrb file.

I'm sure that this should be really easy, but I'm overtaken by the huge amount of classes.  
Reply | Threaded
Open this post in threaded view
|

Re: Pyton Script

Felix
This post has NOT been accepted by the mailing list yet.
Can any of you see the mistake here?
Slicer --no-main-window --python-code "print('Hello World!')" --echo > log.log

I've also tried:
echo print('Hello World') > helloWorld.py
Slicer --no-main-window --python-script helloWorld.py --echo > log.log


Even more using the example from the documentation
Slicer --no-main-window --python-code "slicer.modules.add.widgetRepresentation().show()"

The result is that two processes (slicer.exe and slicerApp-real.exe) appear in my tasklist but nothing else happens. I need to kill them if I want to try again.