Hello,
I get an error from my code, I create the path in order to delete the correct file (I have import os of course), even if my code delete the correct file, in the terminal I get the following error:
ERROR WHILE DELETING THE FILE.
It doesn't write file deleted, but it deletes the file.
Why I get this error if the code delete the file anyway?
I get an error from my code, I create the path in order to delete the correct file (I have import os of course), even if my code delete the correct file, in the terminal I get the following error:
ERROR WHILE DELETING THE FILE.
It doesn't write file deleted, but it deletes the file.
Why I get this error if the code delete the file anyway?
myfile = "test.png" currentdir = os.getcwd() path = currentdir + "/static/images/" + myfile if os.path.exists(path): print("File deleted") os.remove(path) else: print("ERROR WHILE DELETING THE FILE.")