--
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/CAEUzAD282xN-WZq2nGN%2BUn9fZGyd6ZGNNJ%3DBNdwJEjcWz34C_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3vzvk_f5090kycrbzTqf8XD%2BiYnEgo%2BrZ%2BO_1k_2LZtQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAEUzAD3aLTgd1N25D%3DZNTF4-hYkF5UDY236_ax%3DvaNrZiQ8Vaw%40mail.gmail.com.
It is much easier if you just stick with forward slashing for your paths, which will work fine in Windows as far as I know:mp = 'c:/Program Files/Autodesk/Maya2016.5/bin/mayapy.exe'
function = '//discobolos1/websters/install/MAYA_SCRIPTS/PYTHON/batchMaya.py'I'm not really sure about the first part of the function. Is that a network path? Do you get any errors in your console/shell?
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3AqKu8a%3DOX1h%2BwF_rEHfgv-yyM5QP0SuhRzGbjp2AB9Q%40mail.gmail.com.
The path didn’t exist because, as Justin mentioned, Python interpreted those backslashes to make “escape characters”.
path = '\\discobolos1\websters\install\MAYA_SCRIPTS\PYTHON\batchMaya.py'
raw_path = r'\\discobolos1\websters\install\MAYA_SCRIPTS\PYTHON\batchMaya.py'
print("path: %s" % path)
print("raw_path: %s" % raw_path)
# path: \discobolos1\websters\install\MAYA_SCRIPTS\PYTHOatchMaya.py
# raw_path: \\discobolos1\websters\install\MAYA_SCRIPTS\PYTHON\batchMaya.py
Note the PYTHONOathMaya.py, that’s what Python was looking for because \b got converted into O.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAEUzAD28cqZi%2BwrT3eZDygsctNoWUZDmWdN%3DQJ90VrpqRXpHEQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOA8JKTf2DKf5ynY_MRUjtDzUPqKpAuVf%2Bbk7TF8OMCj9g%40mail.gmail.com.
ok, I finally made it, I had to use another set of brackets for argumenta=subprocess.Popen([mp ,function, [' -p \"c:\\ \"']],stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAEUzAD1-4Eq7WViQzrRoePRCy0wPCSE7YZGTtRLFPg5vLDaK9A%40mail.gmail.com.