Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
print(
|
|
|
333 |
|
334 |
def launch_app(self):
|
|
|
335 |
demo = self.build_app()
|
336 |
print(f"Demo object type: {type(demo)}")
|
337 |
-
|
|
|
|
|
|
|
|
|
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:
|