This is all getting pretty obscure. I honestly don't know if I am helping or 
hurting at this point, but I will simply comment on what I see.

You are both printing and returning values from your getCams()
Then you have some temporary intermediate file that is actually importing and 
running this function, but the only thing that happens is it indirectly 
triggers that print statement, even though the getCams() could just return the 
value, and you intermediate file could do what it needs to do with the results.

I guess I would say that getCams() should not print anything. Just return its 
values, and continue to act as a pure library function. What ever is calling it 
(your intermediate script) can do whatever is necessary with the results to get 
them back up to your parent process. This could be printing the results, which 
would require you to do an eval (not great, but it will work). I suppose there 
are other things you could do like writing or printing out pickle serialized 
format. 

At this point, it would definitely be a lot better if you could set up your 
environment to simply import and use the maya modules so that you do have to 
shell out to a subprocess. The subprocess is find if you just need to run 
operations, but when you are going to be doing it a lot just to make basic 
queries for return values, it is probably more complicated to need to have an 
intermediate serialization process. If you see yourself needing to do a lot of 
small maya operations and you want to keep it separate from your UI app, maybe 
you can just wrap the command line utility into something that returns results 
in JSON or pickle ascii so that you can call out and get results easily.

Not really sure where to do with it at this point. This thread has snow balled 
into something quite larger than the original question :-)

Any one else have some input?



On Dec 8, 2012, at 9:00 PM, šãñ wrote:

> strRead

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to