Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Define a flag variable
- activate_function = False
- def function_to_be_dormant():
- """Function that remains dormant until activated."""
- if not activate_function:
- return
- # Function logic here
- print("Function is now active")
- def main():
- global activate_function
- # Initial state: function is dormant
- print("Function is dormant")
- # Manually activate the function
- activate_function = True
- function_to_be_dormant()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement