Re: simply python modules question
| Date : Thu, 21 Jul 2005 14:45:45 +0930 |
| To : XSI(at)Softimage.COM |
| From : Luke <luke(at)rsp.com.au> |
| Subject : Re: simply python modules question |
|
Hi there Python XSI'ers I have been running into some similar update things for the last 8 months on our current project and the modules will not not refreshed unless the file has changed since the last reload command. The XSI Active Python implementation does some rather funky things with its caching of modules that are not the same as the way Python does things. The best way to negate the issues in my case were to always use the reload command directly after each import command and to also make sure modify all of the .py files you are accessing for your plugin/script before running it after a code change. In linux it is easy to set up some kind of deploy script that just does a touch command on all of the necessary files so that XSI will refresh them when it encounters them. Another thing that sometimes works is deleting all of the .pyc files, so that python is forced to generate them again, this is some rare cases also fixes some bizarre issues. cheers, Luke xsibrad(at)fie.us wrote: I didn't mis-interpert what Patrick said. I was responding to Kim's query for clarification. I had not read Patrick's response at that time. I'm looking into using the reload solution as well as some other promising solutions. If I get good results with the others I'll post info here. -brad Quoting philb <philbarrenger(at)gmail.com>:hi brad, I think you mis-interpreted what Patrick said or I have mis-interpreted what you want. He IS talking about the module and not the command. When you import the module you just follow that with a 'reload()' and your changes will all come through. ##### import sys # update your python paths if the folder that you 'know' the module to be in is not in the path. someFolder = 'whatever/and/ever if someFolder not in sys.path : sys.path.append( someFolder ) #import the module import mymodule reload( mymodule ) #import any specifice from the module from mymodule import myModuleFunction reload( myModuleFunction ) mymodule.sumething() etc. etc ##### cheers, phil b On 7/21/05, xsibrad(at)fie.us <xsibrad(at)fie.us> wrote:No, I kept it a good old normal command. So changes to the actual command .py file do update immediately... unlike with a self installed plugin in which I would have to reload it. Its the modules referenced from the command .py file with an import statement that are not updating. -brad Quoting kim aldis <kim(at)aldis.org.uk>: -- luke emrose technical director - luke.emrose(at)rsp.com.au ---------------------------------------------------------------- rising sun pictures - www.rsp.com.au redefining visual effects delivery ---------------------------------------------------------------- direct line +61 8 8400 6400 mobile ph +61 408 893 505 ---------------------------------------------------------------- our adelaide phone number & address has changed, please update your records.......... ---------------------------------------------------------------- adl ph +61 8 8400 6400 - fx +61 8 8400 6401 level 1, 133 gouger street, adelaide, 5034 ---------------------------------------------------------------- syd ph +61 2 9338 6400 - fx +61 2 9338 6401 15/16 charles street east redfern, sydney, 2016 ---------------------------------------------------------------- rising sun research - http://research.rsp.com.au ---------------------------------------------------------------- |
- References:
- RE: simply python modules question
- From: "kim aldis" <kim(at)aldis.org.uk>
- RE: simply python modules question
- From: xsibrad(at)fie.us
- Re: simply python modules question
- From: philb <philbarrenger(at)gmail.com>
- Re: simply python modules question
- From: xsibrad(at)fie.us
- RE: simply python modules question
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: RE: GetBBox - strange return values
- Next by Date: RE: GetBBox - strange return values
- Previous by Thread: RE: GetBBox - strange return values
- Next by Thread: RE: GetBBox - strange return values
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |