is it important to add this two lines? :
if not hasattr(sys, 'argv'):
import sys -> mandatory if you run your script from ouside pymaxwell.exe (let's say the usual python interpreter installed in the system)
if not hasattr(sys, 'argv'): -> 'argv' does not exists running the script from pymaxwell.exe, but if you run it from a regular python interpreter it will exist, and it can have parameters that you don't want to lose, so you only have to set this in the case it doesnt exist.
In a nutshell, I made this sample script in a way that it can be run in pymaxwell.exe and in any python interpreter installed in the system.
this code to create button is it possible to use a button to load mxs file and use another button to make a change in the scene ?
I have never used Tk before, but you can do that for sure. I've used Qt for python to do such as things.