Research portable Memory game | Исследовать портируемую игру Память
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

translate 570B

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
12345678910111213141516171819202122232425
  1. #!/usr/bin/env python3
  2. import os
  3. import sys
  4. from process import *
  5. DIR = os.path.dirname(os.path.realpath(sys.argv[0]))
  6. if len(sys.argv) < 2:
  7. print("Usage: /path/to/translate [OPTIONS] PYTHON_FILE")
  8. sys.exit(1)
  9. FILE_IN = sys.argv[-1]
  10. # Parse options
  11. # TODO Use options
  12. OPT_HEADER = "--header" in sys.argv
  13. OPT_INCLUDES = None
  14. OPT_PREFIX_INCLUDES = "--includes="
  15. for arg in sys.argv:
  16. if arg.startswith(OPT_PREFIX_INCLUDES):
  17. OPT_INCLUDES = arg[len(OPT_PREFIX_INCLUDES):]
  18. # Translate file.
  19. out = process(FILE_IN, OPT_HEADER, OPT_INCLUDES)
  20. print(out)