the trick was :

path = "C:/Users/francesco/Desktop/selectionMaya"
myFile = "C:/Users/francesco/Desktop/selectionMaya/"
dir = os.listdir(path)

junk = [".mayaSwatches", ".DS_Store", ".picasa.ini"]

for texture in dir:
    if texture not in junk:
img = Image.open(os.path.join(myFile,texture))

Thanks guys !!!!

2015-03-04 11:06 GMT+01:00 Marcus Ottosson <[email protected]>:

> 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 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/n6pOGdlhJjs/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/CAFRtmODJVZPStx5kvMT4H70A0eXdjVCpNSHKr6FT-0Yyro4bOA%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODJVZPStx5kvMT4H70A0eXdjVCpNSHKr6FT-0Yyro4bOA%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/CAB%3DHRHCxGaPjUxA6%3De9u-0-rnqMGyBG3aYMML_xPfMQyLg2v5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to