sorter-gui.py 888 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. #
  4. # sorter-gui.py
  5. #
  6. # GUI for calling the tensorflow based animal picture sorter.
  7. #
  8. # Copyright 2022 Stephen Stengel <stephen.stengel@cwu.edu> and friends
  9. #
  10. from tkinter import *
  11. from tkinter import ttk
  12. import os
  13. import sys
  14. from SorterWindow import SorterWindow
  15. def main(args):
  16. print("Welcome to the animal crossing project animal sorter thing!")
  17. settingsFileName = "settings.ini"
  18. checkForSettingsFile(settingsFileName)
  19. root = Tk()
  20. SorterWindow(root)
  21. root.mainloop()
  22. return 0
  23. def checkForSettingsFile(settingsFileName):
  24. print("settingsFileName: " + str(settingsFileName))
  25. if not os.path.isfile(os.path.normpath(settingsFileName)):
  26. print("Settings file not found!")
  27. sys.exit(1) ########################### Change this to an error popup + exit
  28. if __name__ == '__main__':
  29. import sys
  30. sys.exit(main(sys.argv))