show message in command line by python

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
  07 July 2013
show message in command line by python

how could we create a message for command line?
welcome to the world of imagination
  07 July 2013
import maya.cmds as cmds
  07 July 2013
Doesn't the error command also stop the execution of the script?
Use print instead if you just want to echo out something that is happening in the script.
Nightshade UV Editor (script for Maya) - Extends Maya's default UV Texture Editor with additional tools.
  07 July 2013
Use the MGlobal class from OpenMaya. You can display info, warnings and errors to the Command Line without interrupting your code execution:

import maya.OpenMaya as om

om.MGlobal.displayInfo("your text here")
om.MGlobal.displayWarning("your warning here")  # Yellow background
om.MGlobal.displayError("your error here")  # Red background

  07 July 2013
You can use standard python logger configured for console output. See python logging library for more details.
  07 July 2013
put a comma at the end of the print line

  07 July 2013
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 06:41 AM.

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