acecalisto3 commited on
Commit
8dbc07f
·
verified ·
1 Parent(s): 0ed8e4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -7
app.py CHANGED
@@ -2,6 +2,7 @@ import os
2
  import subprocess
3
  import random
4
  import json
 
5
  from datetime import datetime
6
 
7
  from huggingface_hub import InferenceClient, cached_download, hf_hub_url
@@ -242,11 +243,27 @@ def run(self):
242
  except KeyboardInterrupt:
243
  print("\nApplication stopped by user.")
244
 
245
- def main():
246
- root = tk.Tk()
247
- app = App(root)
248
- print(f"===== Application Startup at {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')} =====")
249
- app.run()
 
 
 
 
 
 
250
 
251
- if __name__ == "__main__":
252
- main()
 
 
 
 
 
 
 
 
 
 
 
2
  import subprocess
3
  import random
4
  import json
5
+ import tkinter as tk
6
  from datetime import datetime
7
 
8
  from huggingface_hub import InferenceClient, cached_download, hf_hub_url
 
243
  except KeyboardInterrupt:
244
  print("\nApplication stopped by user.")
245
 
246
+ def run(self):
247
+ print("Welcome to the Python App Builder!")
248
+ print("Type 'help' to see the available commands.")
249
+ print("-" * 50)
250
+ try:
251
+ while True:
252
+ try:
253
+ input_text = input("Enter input: ")
254
+ except EOFError:
255
+ print("Error: Input reading interrupted. Please provide valid input.")
256
+ continue
257
 
258
+ output, system_message = self.process_input(input_text)
259
+ if output:
260
+ print(output)
261
+ if system_message:
262
+ print(system_message)
263
+ except KeyboardInterrupt:
264
+ print("\nApplication stopped by user.")
265
+
266
+ def main():
267
+ app = App()
268
+ print(f"===== Application Startup at {datetime.now().strftime('%Y-%m-%d %H:%M:%S')} =====")
269
+ app.run()