(Apr-23-2020, 02:17 PM)finndude Wrote: i dont understand theres nothing else to delete it only that code.
It's a design pattern. Maybe it's not relevant for this particular case, but you should be aware of potential problems and what is accepted solution. Think of multiple users running your code, your more advanced code running multi-thread or multi-process, etc.
what is the problem with os.remove?
Also, note that opening file for writing (in
'w'
mode) will overwrite file if it exists. No need to remove it before that.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs