Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
Hi.
I just tried it with os.system("/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal") and it launched Terminal as expected.
What is the exact command that you tried?
Paolo
https://www.preta3d.com
FB: https://www.facebook.com/RealityPlugIn
Tw: @preta3d
G+:
https://plus.google.com/106625816153304163119
The
Reality Gallery: https://reality-plug-in.deviantart.com
I am attempting to run tdlmake to convert a texture to TDL format. ("tdlmake inputtexturepath outputtexturepath" (where they were given values such that copying and pasting the whole string worked as a command in Terminal).
When I am in the PoserPython shell in Poser Pro 2012, I can run os.system("echo hello world") and it returns the exit code of 0 to the shell output, but if I attempt to run a command that requires an environment variable, it returns a non-zero error code. Even just os.system("echo $DELIGHT") (which returns the path in a real Terminal session) gives the same error code 32512. For what I am doing now, I can just store a variable in the script with that information, and now that I realize halfway through this reply what's going on, I can hopefully find the solution in a more general Python resource.
Thanks Paolo. :)
TDLmake works now if I specify the path to tdlmake as part of the string passed to os.system. However, multiple command strings such as "cd "/Users/deastham/Desktop/RIBoutput"; /Applications/3Delight/bin/renderdl -D /Users/deastham/Desktop/RIBoutput/dgfg_0.rib" still don't work. (I am making sure to use the escape codes for slashes correctly. They are also used in the tdlmake calls.
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
I have a script which works on the PC side, but on OS X it seems that commands run with os.system(MyCommand) have no effect. Is there a workaround or solution for this (aside from only using my script on the PC)? Currently I have the script add the command to a string, separated by a '; '.. at the end, I just print thie command string, and copy and paste it into a terminal, where it works. Please advise.
Thanks in advance.