News for hackers. Stuff that matters.
Re:I'm Switching to Python and Actually Liking It by Perepiska on Sunday July 20, 2025 @05:31PM (#44629489)
Just use

  if not API_KEY:
    sys.exit("Missing YOUTUBE_API_KEY.")

It will print message to sys.stderr and do system exit with code 1.

P.S. exit() is just an alias to sys.exit(), I prefer longer form.

There are no comments on this comment yet.