CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 07-10-2013, 07:01 PM   #1
i-studio
just do it.
 
i-studio's Avatar
portfolio
amin khormaie
Digital artist
big foot studio
Bushehr, Iran
 
Join Date: Nov 2009
Posts: 135
show message in command line by python

how could we create a message for command line?
__________________
welcome to the world of imagination
 
Old 07-10-2013, 07:51 PM   #2
rgkovach123
Know-it-All
robert
austin, USA
 
Join Date: Nov 2006
Posts: 364
import maya.cmds as cmds
cmds.error('Error!')
 
Old 07-12-2013, 09:14 AM   #3
DeadlyNightshade
Plz...
 
DeadlyNightshade's Avatar
portfolio
Martin Dahlin
Jr. Technical Artist
King
Stockholm, Sweden
 
Join Date: Jul 2012
Posts: 925
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.
 
Old 07-12-2013, 10:29 AM   #4
zeroeffect
Code Junkie
portfolio
Chris Zurbrigg
Software Developer
Independent
Canada
 
Join Date: Jul 2005
Posts: 221
Use the MGlobal class from OpenMaya. You can display info, warnings and errors to the Command Line without interrupting your code execution:

Code:
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

-ChrisZ
 
Old 07-16-2013, 04:11 PM   #5
emigue
New Member
 
emigue's Avatar
portfolio
Miguel Ángel Moreno
Málaga, España
 
Join Date: May 2013
Posts: 1
You can use standard python logger configured for console output. See python logging library for more details.
 
Old 07-17-2013, 11:02 AM   #6
stallion151
constipated CG
 
stallion151's Avatar
M
Australia
 
Join Date: Apr 2003
Posts: 1,552
put a comma at the end of the print line
__________________

 
Old 07-17-2013, 11:02 AM   #7
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 01:26 AM.


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