Python Forum
best way to force an exception
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
best way to force an exception
#1
in a try part of a try/except i want a certain conditional test to run the except part. it seems the simple way to do that is to throw an exception the except part will catch. what is the best or most pythonic way to do that?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
best way to force an exception - by Skaperen - Oct-20-2020, 11:57 PM
RE: best way to force an exception - by bowlofred - Oct-21-2020, 12:15 AM
RE: best way to force an exception - by Gribouillis - Oct-21-2020, 05:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  force a program to exit ? Armandito 3 2,806 May-12-2022, 04:03 PM
Last Post: Gribouillis
  Force calculation result as decimal vercetty92 4 3,020 Mar-20-2019, 02:27 PM
Last Post: vercetty92
  During handling of the above exception, another exception occurred Skaperen 7 27,238 Dec-21-2018, 10:58 AM
Last Post: Gribouillis
  Password Brute Force 2skywalkers 9 5,691 Oct-18-2018, 02:35 PM
Last Post: buran
  Brute Force Password Guesser 2skywalkers 1 3,327 Oct-05-2018, 08:04 PM
Last Post: ichabod801
  Brute Force Pad Lock Guesser RedSkeleton007 4 4,161 Mar-03-2018, 07:42 AM
Last Post: RedSkeleton007
  brute force password from list petru 10 12,380 Apr-04-2017, 02:08 PM
Last Post: buran

Forum Jump:

User Panel Messages

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