{"id":424,"date":"2010-12-20T07:07:00","date_gmt":"2010-12-20T07:07:00","guid":{"rendered":"http:\/\/pycheung.com\/weblog\/?p=424"},"modified":"2013-05-16T14:43:56","modified_gmt":"2013-05-16T14:43:56","slug":"run-python-script-from-notepad-for-maya-2011","status":"publish","type":"post","link":"https:\/\/www.pycheung.com\/weblog\/post\/424","title":{"rendered":"run python script from notepad++ for maya 2011"},"content":{"rendered":"<p>notepad++ as a script editor deals better with indent, block comment toggle, replace, find, similar text highlighting etc comparing to the native maya script editor.<br \/>\nthere are existing product out there called mapy for maya but I couldn&#8217;t get it to work in maya 2009\/2011<\/p>\n<p>so here is my setup to run python script from notepad++ for maya 2011<\/p>\n<p>1. usersetup.py (anything here will run when maya starts)<\/p>\n<pre>if cmds.commandPort(':7777', q=True) !=1:\r\ncmds.commandPort(n=':7777', eo = False, nr = True)\r\n\r\nsys.path.append(\"C:\\mayanotepad\")\r\nwriteFile = open(r'C:\\mayanotepad\\testrun.py', \"w\")\r\nwriteFile.close()\r\nimport testrun<\/pre>\n<p>2. unzip the following file in c:<br \/>\n<a title=\"mayanotepad.zip ( 2.97 MB)\" href=\"http:\/\/www.pycheung.com\/weblog\/wp-content\/uploads\/mayanotepad.zip\" rel=\"enclosure\">mayanotepad.zip<\/a><\/p>\n<p>3. notepad++ > run > run (or press F5)<\/p>\n<pre>C:\\mayanotepad\\send.bat \"$(FULL_CURRENT_PATH)\"<\/pre>\n<p>note:<br \/>\nall vars and def will reside in &#8220;testrun&#8221; namespace<br \/>\nsave file required before run<\/p>\n<p>note2:<br \/>\n<del>for step 3, type and replace the double quote as wordpress replace double quotes in posts\u00a0<\/del> 2013\/05\/16 update fixed<\/p>\n","protected":false},"excerpt":{"rendered":"<p>notepad++ as a script editor deals better with indent, block comment toggle, replace, find, similar text highlighting etc comparing to the native maya script editor. there are existing product out&#8230;<\/p>\n<div class=\"royalwp-readmore-wrap\"><a href=\"https:\/\/www.pycheung.com\/weblog\/post\/424\" class=\"royalwp-readmore\">Explore more <i class=\"far fa-hand-point-right\"><\/i><\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[159,157],"tags":[17,60,71,90,105],"_links":{"self":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts\/424"}],"collection":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/comments?post=424"}],"version-history":[{"count":6,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts\/424\/revisions"}],"predecessor-version":[{"id":1312,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts\/424\/revisions\/1312"}],"wp:attachment":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/media?parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/categories?post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/tags?post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}