Well that error just means what you have pasted in has inconsistent whitespace (which is important to python syntax). But ultimately your script does have to check if the file exists. If you can get this snippet added to your code and you see it print that it doesn't exist, before crashing, then that would explain it. Otherwise, the file exists but there is some other issue with your being able to read it, such as permissions.
On Wed, Jul 16, 2014 at 12:23 PM, Diego Ruiz <[email protected]> wrote: > Thanks guys, like I said I'm new learning this, > The line of code that you give me: > > if not os.path.isfile(renderPath): > print "Does not exist!", renderPath > > > is all right?, when I introduce the code in the .py, in script editor of > maya gives this message: > > # Error: line 0: IndentationError: file <maya console> line 1: unindent > does not match any outer indentation level # > > I've rendericed the image therefore the images exists, I see it in the > images folder from my project of maya > thanks for help > > > 2014-07-15 15:02 GMT-05:00 Justin Israel <[email protected]>: > >> Well there are no ways around the fact that trying to open a file that >> does not exist will produce an error. Have you tried checking and printing >> if the file does not exist? You should also return from the function after >> you report the error. >> On 16/07/2014 5:31 AM, "Diego Ruiz" <[email protected]> wrote: >> >>> Thank you Justin, I´m trying to learn but is very hard, this code >>> doesn't work yet, are there other some way to this? Have a nice day >>> >>> >>> 2014-07-14 22:37 GMT-05:00 Justin Israel <[email protected]>: >>> >>>> Hi Diego, and welcome to the group. >>>> >>>> Unfortunately Maya isn't being very nice in telling you a helpful >>>> traceback message. But most likely your problem is that either the >>>> renderPath does not yet exist, or is inaccessible. Try doing this first: >>>> >>>> if not os.path.isfile(renderPath): >>>> print "Does not exist!", renderPath >>>> >>>> >>>> >>>> >>>> On Tue, Jul 15, 2014 at 10:09 AM, 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 a topic in the >>>> Google Groups "Python Programming for Autodesk Maya" group. >>>> To unsubscribe from this topic, visit >>>> https://groups.google.com/d/topic/python_inside_maya/qxCzPP35Wkk/unsubscribe >>>> . >>>> To unsubscribe from this group and all its topics, send an email to >>>> [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0UeC7VBttkuC2p5Q14R%2B-ZHdL2JjZbti6Xe7wPb__NFQ%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0UeC7VBttkuC2p5Q14R%2B-ZHdL2JjZbti6Xe7wPb__NFQ%40mail.gmail.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/CAPrCNTXSV%2B-YwVbkkSc6SBsrf2bDsg%2BUTFm_WkZZG-tFxMLNsQ%40mail.gmail.com >>> <https://groups.google.com/d/msgid/python_inside_maya/CAPrCNTXSV%2B-YwVbkkSc6SBsrf2bDsg%2BUTFm_WkZZG-tFxMLNsQ%40mail.gmail.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 a topic in the >> Google Groups "Python Programming for Autodesk Maya" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/python_inside_maya/qxCzPP35Wkk/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3AHr7FzB3r5_M8sew_9dx6ZWwZz_it437wXU3GCkjkpA%40mail.gmail.com >> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3AHr7FzB3r5_M8sew_9dx6ZWwZz_it437wXU3GCkjkpA%40mail.gmail.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/CAPrCNTUpjAEyM5_m%2B3a8Gdsv8shKPytOOgF8ePG3KAPXnpz5QQ%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAPrCNTUpjAEyM5_m%2B3a8Gdsv8shKPytOOgF8ePG3KAPXnpz5QQ%40mail.gmail.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/CAPGFgA1Zk%3D99yvko4Xzggwi5CMkews-wte__Co7CCpj1NZ02jg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
