fork download
  1. import logging
  2.  
  3. # Configure logging to display messages on the console
  4. logging.basicConfig(level=logging.DEBUG, format='%(levelname)s - %(message)s')
  5.  
  6. debug_message = "DEBUG - Registered commands: dict_keys(['echo', 'start', 'help', 'mini_app'])"
  7.  
  8. # Find the starting position of "dict_keys("
  9. start_index = debug_message.find("dict_keys(")
  10.  
  11. # Find the ending position of ")"
  12. end_index = debug_message.find(")", start_index) + 1
  13.  
  14. # Remove the "dict_keys(...)" part
  15. cleaned_message = debug_message[:start_index] + debug_message[end_index:]
  16.  
  17. print(cleaned_message)
Success #stdin #stdout 0.06s 10372KB
stdin
Standard input is empty
stdout
DEBUG - Registered commands: