Dear Forum,
me and my users are currently facing a big problem with python scripts.
After some updates the if name == ‘main’: part of the script is no more executed.
from ij import IJ
#test
#__name__ == '__main__'
def run_script():
IJ.log("script executed")
# If a Jython script is run, the variable __name__ contains the string '__main__'.
# If a script is loaded as module, __name__ has a different value.
if __name__ == '__main__':
run_script()
IJ.log("not in run script function")
this example logs out only “not in run script function” whetere I run it from script editor or put it in the plugins folder and launch from fiji plugins menu.
What happens? Have I to add some update sites that could fix that?
My computer is a:
OX X Version 10.9.5 with Java 8
and Fiji is :
IMageJ 2.0.0-rc-61/1.51n Java 1.8.0_66
Have a nice day,
Emanuele Martini