Hi Anastasia, welcome to the forum! In Python, the \
character is a special character for escaping other characters. E.g. \n
means “newline”. In your example, the \
is used in your path:
file1 = ("C:\Users\User\Download\swatch_arles-yellow__6094-42.png")
You can either keep it, and prepend a r
to make it a “raw string”, like so:
file1 = (r"C:\Users\User\Download\swatch_arles-yellow__6094-42.png")
Which informs Python to “hey, don’t give special treatment to any of these characters”. Or you can replace \
for /
, Windows is OK with that syntax. You can also remove the parentheses since they are not needed.
There might be other issues with your snippet, but this is definitely one of them.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/40130504-df79-4ea6-841c-582c52d53e1bn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOB5tfBZarSreRTAX91SeA5ARduDWY-wodHzk14%3DSfbvNw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAAZJ9HV7jL5qVK4mzt-YQWJhMhA2oO8donWL20PBDYJm9nnw6w%40mail.gmail.com.