acecalisto3 commited on
Commit
5d71dfb
·
verified ·
1 Parent(s): babef6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -15
app.py CHANGED
@@ -315,26 +315,25 @@ if __name__ == "__main__":
315
 
316
  print("Thank you for using the Python App Builder. Goodbye!")
317
 
318
- def _print_welcome_message(self):
319
- print("Welcome to the Python App Builder!")
320
- print("Type 'help' to see the available commands.")
321
- print("Type 'launch' to build and launch the Gradio app.")
322
- print("Type 'exit' to quit the application.")
323
- print("-" * 50)
324
-
325
  def _get_user_input(self):
326
- return input("Enter input: ").strip()
327
-
328
- def _display_output(self, output, system_message):
329
- if output:
330
- print(output)
331
- if system_message:
332
- print(system_message)
 
333
 
334
  def launch_app(self):
 
335
  demo = self.build_app()
336
  print(f"Demo object type: {type(demo)}")
337
- demo.launch()
 
 
 
 
338
 
339
  def main():
340
  try:
 
315
 
316
  print("Thank you for using the Python App Builder. Goodbye!")
317
 
 
 
 
 
 
 
 
318
  def _get_user_input(self):
319
+ try:
320
+ return input("Enter input: ").strip()
321
+ except EOFError:
322
+ print("Error: Input stream closed unexpectedly.")
323
+ return ""
324
+ except Exception as e:
325
+ print(f"Error reading input: {str(e)}")
326
+ return ""
327
 
328
  def launch_app(self):
329
+ print("Launching app...")
330
  demo = self.build_app()
331
  print(f"Demo object type: {type(demo)}")
332
+ try:
333
+ demo.launch()
334
+ print("App launched successfully.")
335
+ except Exception as e:
336
+ print(f"Error launching app: {str(e)}")
337
 
338
  def main():
339
  try: