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
#4
Hi,

In the except: clause, you print your own message,
but tthe idea is that you let python determine what the problem is.
Maybe it is something else !
So you might do this:
except Exception as e:
    print (e.args)
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
  DF.groupby(col).min works, mean gets a "not implemented" error samgardner5 3 675 Feb-29-2024, 06:13 PM
Last Post: deanhystad
  Delete multiple lines from txt file Lky 6 2,396 Jul-10-2022, 12:09 PM
Last Post: jefsummers
  Pandas - error when running Pycharm, but works on cmd line zxcv101 1 1,405 Jun-18-2022, 01:09 PM
Last Post: snippsat
  Find and delete above a certain line in text file cubangt 12 3,661 Mar-18-2022, 07:49 PM
Last Post: snippsat
  How to delete portion of file already processed? Mark17 13 2,896 Jan-22-2022, 09:24 AM
Last Post: Pedroski55
  Python Regular expression, small sample works but not on file Acernz 5 3,022 Jun-09-2021, 08:27 PM
Last Post: bowlofred
  Function throws error but then works? Milfredo 10 3,910 Sep-12-2020, 05:16 AM
Last Post: Milfredo
  Find, delete and add text into pdf file a_shvechkov 2 6,088 Jul-08-2020, 10:50 AM
Last Post: a_shvechkov
  Delete all contents of a file from the fifth line? PythonNPC 1 1,940 Apr-18-2020, 09:16 AM
Last Post: buran
  Can't seem to figure out how to delete several lines from a text file Cosmosso 9 4,266 Dec-10-2019, 11:09 PM
Last Post: Cosmosso

Forum Jump:

User Panel Messages

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