I've written a script that takes a .csv file, converts it to an .xlsx using openpyxl, and formats the file.
Throughout the script's process, it creates several .csv files, which can be deleted. I've tried using os.remove("File.csv"), but always get the error:
os.remove("File.csv")
AttributeError: 'str' object has no attribute 'remove'
I've tried running this on 3 different computers, and I've even written a test script with just 2 lines of code to test the functionality and have had no luck (same error):
import os
os.remove("File.csv")
Does anybody know the cause/reason for this?
OR
Is there another way to delete (move to trash) a file/multiple files?
FileNotFoundError. What version of python are you running?