Ok, slow down a little. Let’s take this one step at a time.

os.path.isfile
<https://docs.python.org/2/library/os.path.html#os.path.isfile> takes a
path as input. If that path is not absolute - i.e. does not have the
root/drive-letter included - then it will assume that the string you gave
it is relative to the current working directory, which typically is the
directory from which you run the script.

For example, if you are here:

c:\

And you pass a filename, such as a.jpg to os.path.isfile, then
os.path.isfile will assume that you meant:

c:\a.jpg

To instead have it look inside your selectionMaya directory, you will have
to pass the full path instead.

>>> import os>>> full_path = 
>>> os.path.join("C:/Users/francesco/Desktop/selectionMaya", "a.jpg")>>> print 
>>> os.path.isfile(full_path)True

​

-- 
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/CAFRtmODJVZPStx5kvMT4H70A0eXdjVCpNSHKr6FT-0Yyro4bOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to