Python Forum
delete a file works but with error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
delete a file works but with error
#2
without seeing the details, you can delete a file only once.
Assuming that is it there the first run, I do not see you rewriting it, so
it can be deleted again.
Instead of if .. else, you may also do a try...except...

my 2 cts,
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Messages In This Thread
delete a file works but with error - by Leon79 - Jul-13-2020, 05:30 PM
RE: delete a file works but with error - by DPaul - Jul-13-2020, 05:31 PM
RE: delete a file works but with error - by Leon79 - Jul-13-2020, 06:35 PM
RE: delete a file works but with error - by DPaul - Jul-14-2020, 06:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Delete file with read-only permission, but write permission to parent folder cubei 7 22,077 11 hours ago
Last Post: johndavis78
  DF.groupby(col).min works, mean gets a "not implemented" error samgardner5 3 739 Feb-29-2024, 06:13 PM
Last Post: deanhystad
  Delete multiple lines from txt file Lky 6 2,415 Jul-10-2022, 12:09 PM
Last Post: jefsummers
  Pandas - error when running Pycharm, but works on cmd line zxcv101 1 1,419 Jun-18-2022, 01:09 PM
Last Post: snippsat
  Find and delete above a certain line in text file cubangt 12 3,773 Mar-18-2022, 07:49 PM
Last Post: snippsat
  How to delete portion of file already processed? Mark17 13 2,934 Jan-22-2022, 09:24 AM
Last Post: Pedroski55
  Python Regular expression, small sample works but not on file Acernz 5 3,048 Jun-09-2021, 08:27 PM
Last Post: bowlofred
  Function throws error but then works? Milfredo 10 3,943 Sep-12-2020, 05:16 AM
Last Post: Milfredo
  Find, delete and add text into pdf file a_shvechkov 2 6,158 Jul-08-2020, 10:50 AM
Last Post: a_shvechkov
  Delete all contents of a file from the fifth line? PythonNPC 1 1,959 Apr-18-2020, 09:16 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020