Python command line admin rights/privileges?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  06 June 2009
*solved* Python command line admin rights/privileges?

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?


Last edited by jorx : 06 June 2009 at 08:59 PM. Reason: solved!
  06 June 2009
Thumbs up It works perfectly


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.....
  06 June 2009
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.
  06 June 2009
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 09:19 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.