I didn't know about this command, thank you! However, I'd like a software-agnostic solution. I also noticed MGlobal.displayMessage also does the job, but again, maya-only. The benefit of using print is that it works regardless of the software, but shows up in the message line if you're on maya. Another option is to simply use a logger, where I format my output to get rid of the logger name, but that means I sort of mess around with my existing logger structure. Still, this is what I did. But I miss my simple yet effective "print" solution =]
thanks for the 2 new things I learnt! Le lundi 12 juillet 2021 à 00:38:27 UTC-4, justin...@gmail.com a écrit : > On Sat, Jul 10, 2021 at 12:54 AM vince touache <fruit...@gmail.com> wrote: > >> brilliant, I didn't know that. However, for some reason, it still doesn't >> show up in the main gui one-liner widget. >> Any other suggestions? >> > > I don't really know why that behaviour is different. But could you just > not rely on the python print formatting, and instead maybe switch to using > the explicit support in Maya's command api for pushing messages into the > message status line? > > > https://help.autodesk.com/cloudhelp/2020/ENU/Maya-Tech-Docs/CommandsPython/messageLine.html > > >> Thank you >> >> Le jeudi 8 juillet 2021 à 13:40:25 UTC-4, justin...@gmail.com a écrit : >> >>> >>> >>> On Fri, 9 Jul 2021, 5:05 am vince touache, <fruit...@gmail.com> wrote: >>> >>>> hi all, >>>> >>>> With previous versions of maya, I was using a lot >>>> print 'foo', >>>> with the coma in the end, which was forcing my print to show up in the >>>> 1-line listener embedded to the maya main window (just like a >>>> mel.eval('print "foo";') would do). >>>> However, with python 3 and the new print() syntax, this trick doesn't >>>> seem to work anymore. >>>> >>> >>> >>> https://docs.python.org/3/library/functions.html#print >>> >>> The python3 print function accepts an end parameter that defaults to a >>> newline. So just set it to some other character. >>> >>> print("my line", end=" ") >>> >>> >>>> Is there another way I could make sure my prints are visible not only >>>> from the script editor but also from the main windows? (other than using >>>> mel.eval)? >>>> >>>> cheers >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Python Programming for Autodesk Maya" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to python_inside_m...@googlegroups.com. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/python_inside_maya/d4761b10-aa3a-45d7-a5ca-b7ad576b1076n%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/python_inside_maya/d4761b10-aa3a-45d7-a5ca-b7ad576b1076n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Python Programming for Autodesk Maya" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to python_inside_m...@googlegroups.com. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/5e459093-46bf-41e8-aaa6-95b0c001e79bn%40googlegroups.com >> >> <https://groups.google.com/d/msgid/python_inside_maya/5e459093-46bf-41e8-aaa6-95b0c001e79bn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/917b8b40-5e0e-46b2-9801-ddfcf0dfce4an%40googlegroups.com.