Reputation: 37
I am trying to overwrite one .png file with another using shutil.copy, but I keep getting a syntax error. The line in question is-
shutil.copy("/var/www/vk7krj/running/yoga.png", "/var/www/vk7krj/running/run4.png")
and the error is-
File "./latlong4.py", line 63
shutil.copy("/var/www/vk7krj/running/yoga.png","/var/www/vk7krj/running/run4.png")
SyntaxError: invalid syntax
with an up-arrow under the l in shutil
I have "import shutil" and also "from shutil import copyfile" in the head of the file. Several hours of google searching has turned up nothing, so any assistance would be great.
Upvotes: 0
Views: 571
Reputation: 37
Problem solved- turns out the error was incorrect indentation in an if-else earlier in the script- corrected that and the syntax error went away.
Upvotes: 0