He uses the first instead of the returned list:

renderPath = cmds.renderSettings(fin=True, fp=True)[0]

The problem is that he isn't checking if it actually exists before trying
to open it.


On Tue, Jul 15, 2014 at 6:31 PM, Larry Wang <[email protected]> wrote:

> cmds.renderSettings() returns a string list. But you passed it directly to
> open(renderPath, ‘rb’) where open() expects a string (path) as its first
> argument.
> You need to be more specific on which file you are trying to open. Looking
> at the example code on renderSettings(), the list it returns could contain
> empty strings in the list depending on which arguments you give, so you may
> have to perform further validation before calling open() as well.
>
> larry
>
> On Jul 14, 2014, at 3:09 PM, Diego Ruiz <[email protected]> wrote:
>
>
>
> Hi everyone, I'm new in the group and I'm learning about python for
> render, I'm using Maya 2014 but I have a problem, when I call the .py file,
> Maya tells this:
>
> # Attempting to send notification email
>
> # Error: line 0: IOError: file
> D:\3D\jesusbuenahora\scripts\notification.py line 32: 2 #
>
>
> <https://lh6.googleusercontent.com/-CW13R9Td18Y/U8RUrVFo8LI/AAAAAAAAAJ0/ALIBKxkTXHI/s1600/pyfile.JPG>
>
> I check it out many times but always appears taht message, I don't know
> what to do, does somebody can help me please?, Thanks!!
>
> --
> 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/b07443b8-4c76-4d3e-8df1-78d8a3dd631c%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/b07443b8-4c76-4d3e-8df1-78d8a3dd631c%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/183ED1F7-D14F-4D63-AEE7-6777211FB855%40gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/183ED1F7-D14F-4D63-AEE7-6777211FB855%40gmail.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/CAPGFgA2_%2B%2BkQ85yCMFMKHfc0-cx-y-YVxkBPhZkw_nxykTEOpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to