Re: [Maya-Python] dynamically changing sys.path

2018-07-27 Thread Justin Israel
On Sat, Jul 28, 2018, 8:12 AM Robert White wrote: > I think you'd be better served with a small launcher app. That allows for > the artist to make their selection. > Then that opens the proper app from the proper location. > This is what I did at my previous studio. I had an "app store" that

Re: [Maya-Python] dynamically changing sys.path

2018-07-27 Thread Robert White
I think you'd be better served with a small launcher app. That allows for the artist to make their selection. Then that opens the proper app from the proper location. Otherwise you're going to be fighting a lot of low level language machinery to get what you want. On Friday, July 27, 2018 at

Re: [Maya-Python] dynamically changing sys.path

2018-07-27 Thread Alok Gandhi
To quote from the docs: Python modules’ code is recompiled and the module-level code reexecuted, defining a new set of objects which are bound to names in the module’s dictionary. The init function of extension modules is not called a second time. As with all other objects in Python the old

Re: [Maya-Python] dynamically changing sys.path

2018-07-27 Thread Juan Cristóbal Quesada
basically, the same application when a selection button is clicked should perform again all the imports from a specific repository. This specific repository is not known beforehand, it is only known at the specific moment when the artist chooses and hits that button. Some of the dependencies are

Re: [Maya-Python] dynamically changing sys.path

2018-07-26 Thread Alok Gandhi
Try using importlib or imp Although, as Justin has already pointed out, it is not recommended to use reload in production code or to dynamically append/insert paths in sys.path. Give more thought to

Re: [Maya-Python] dynamically changing sys.path

2018-07-26 Thread Justin Israel
Would you be able to explain a bit more about the goal you are trying to solve, with dynamically loading a second widget into your main application? Does this second widget have drastically different dependencies? I'm interested specifically in the part where you need to reload modules. This is

[Maya-Python] dynamically changing sys.path

2018-07-26 Thread Juan Cristóbal Quesada
Hi, this is more of a pure python question i want to throw here. Im developing a PySide Application that is used as the context/task/app/openfile launcher by the artists. The artist makes some choices that drive him towards different dialogs and widgets. The thing is, due to a request, im facing