PDA

View Full Version : Python command line admin rights/privileges?


jorx
06-30-2009, 11:15 AM
Hi fellow scripters!
I have a question about the os.system() command and command line rights from within Maya!

When I used my operating system's installed python- (via GUI or cmd.exe) I can successfully run the command:

os.system('echo "text goes here" > blah.txt')

But when I run the same or similar commands from within Maya or other softwares (that come with Python) it will not work! At most- it may return a 0.

So does anybody know why this is so? And is there a way to run command line commands from within Maya?

Thanks!

praburaj
06-30-2009, 01:52 PM
Hi,

your code works perfectly....

Yes, maya says # Result: 0 # but os.system() command works perfectly....
my guess is it even works for you... but you might have failed to note the blah.txt file created in maya bin directory...

you are not giving any path for your txt file... so it will create in python folder only... maya python is located in bin directory.... so check your blah.txt file in bin directory of maya version.... else give exact path for your txt file to create.....

jorx
06-30-2009, 08:59 PM
You're right- it does work that way!

That's strange- because I could have sworn that I couldn't get it to work earlier!
But thanks- you have opened up new doors for me.

CGTalk Moderation
06-30-2009, 08:59 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.