Gaz wrote: > Check this piece of code: > > #now add an image part > part = writer.nextpart() > part.addheader('Content-Transfer-Encoding', 'base64') > body = part.startbody('image/jpeg') > base64.encode(open('c:\check.jpg', 'rb'), body) > > I get the following error: > > IOError: [Errno 2] No such file or directory: 'c:\\check.jpg' > args = (2, 'No such file or directory') > errno = 2 > filename = r'c:\check.jpg' > strerror = 'No such file or directory' > > Dont know why im getting such error, the file is there. Perhaps wrong > filetype? Wrong read mode?
What does it show if you put "print os.listdir('c:/')" on the line before the open? (You'll obviously need to import os first.) -Peter -- http://mail.python.org/mailman/listinfo/python-list