Python Forum
How to terminate the caller fuction through callee?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to terminate the caller fuction through callee?
#1
Here is my code:

def callee():
    # implement a code to stop the execution of caller()


def caller():
    callback1 = callee
    do_somthing()

callback2 = caller
Thanks in adavance.
Reply
#2
I suggest
def callee():
    raise RuntimeError
Reply
#3
def callee():
    return 'Die!Die!Die!'
  
def caller():
    callback1 = callee
    if callback1 != 'Die!Die!Die!':
        do_somthing()
 
callback2 = caller
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  The game should now run and terminate once the board is full, but still can’t identif rango 0 1,460 Jul-22-2021, 03:24 AM
Last Post: rango
  Is there a way to not terminate a running thread in python Contra_Boy 3 1,986 May-05-2020, 09:38 PM
Last Post: SheeppOSU
  Terminate a process when hotkey is pressed 66Gramms 0 2,247 Dec-24-2019, 06:41 PM
Last Post: 66Gramms
  Is 2 a prime number? for loop & range fuction in python docs says yes, mine says no. allusernametaken 4 2,908 Nov-17-2019, 02:56 AM
Last Post: allusernametaken
  How to terminate a list of inputs with a set value? SOS Manning 2 2,201 Sep-19-2019, 01:54 AM
Last Post: scidam
  how to terminate all the processes in C py2exe 0 2,080 Aug-02-2018, 04:31 AM
Last Post: py2exe
  lambda-Amazon EC2:Remove instance termination protection if enabled and terminate ins dragan979 0 3,362 Jun-13-2018, 09:48 AM
Last Post: dragan979
  Using Terminating Signal to Terminate Long Threads crcali 1 2,589 Apr-06-2018, 01:26 AM
Last Post: woooee
  Service that waits for another program to terminate hhh 1 2,556 Dec-15-2017, 01:39 PM
Last Post: wavic

Forum Jump:

User Panel Messages

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