This seems to work fine:
mel.eval('runTimeCommand -annotation "Herrow" -category "User"
-commandLanguage "python" -command "from tools.anim import picker;
reload(picker)" customCmd2;')
And so does the python commands equivalent
cmds.runTimeCommand("customCmd", annotation="Herrow", category="User",
commandLanguage="python", command="from tools.anim import picker;
reload(picker)")
You don't need the outer parenthesis around the command string. And using
the semi-colon instead of the newline works. The python equiv is a bit
easier to manage though.
Also sometimes if you find yourself dealing with complicated nested
quotations (not really the case here, but releated), it can help to use
triple quotes:
complexString = '''some code that contains both "double quotes" and
'single quotes' all in one'''
And using the repr string formatting for combining snippets with quotes and
other snippets with quotes:
complexString = '''some code that contains both "double quotes" and
'single quotes' and also %r'''print complexString % complexString
-- justin
On Thu, Jun 12, 2014 at 9:15 PM, Jeremy YeoKhoo <[email protected]> wrote:
> er no that didnt work
>
>
> On Thursday, 12 June 2014 17:06:27 UTC+10, Jeremy YeoKhoo wrote:
>>
>> Hey guys, I am having string literal issues with my following piece of
>> code.
>>
>> mel.eval('runTimeCommand -annotation "Herrow" -category "User"
>> -commandLanguage "python" -command ("from tools.anim import
>> picker\nreload(picker)") customCmd;')
>>
>> I am having escaping with the parentheses, I think. Could someone throw
>> me a line please :)
>>
>> Thanks
>> -Jeremy
>>
>>
>> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/a0888f13-6197-49ab-b594-9fb639bf356c%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/a0888f13-6197-49ab-b594-9fb639bf356c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3abN0DDu0hDZ0jKvgOVFVHgQToBvwWqgAmamsJO4JcDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.