console.py 478 B

12345678910111213
  1. import sys
  2. def get_code(authorize_url):
  3. """Show authorization URL and return the code the user wrote."""
  4. message = "Check this link in your browser: {0}".format(authorize_url)
  5. sys.stderr.write(message + "\n")
  6. try: input = raw_input #For Python2 compatability
  7. except NameError:
  8. #For Python3 on Windows compatability
  9. try: from builtins import input as input
  10. except ImportError: pass
  11. return input("Enter verification code: ")