Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,12 @@
|
|
| 1 |
-
|
| 2 |
-
import
|
| 3 |
-
import requests
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
response = requests.get(url)
|
| 10 |
-
file_name = url.split('/')[-1]
|
| 11 |
-
with open(file_name, 'wb') as f:
|
| 12 |
-
f.write(response.content)
|
| 13 |
-
return send_from_directory(os.getcwd(), file_name, as_attachment=True)
|
| 14 |
-
|
| 15 |
-
if __name__ == '__main__':
|
| 16 |
-
app.run(host='0.0.0.0', port=80)
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import subprocess
|
|
|
|
| 3 |
|
| 4 |
+
def get_system_info():
|
| 5 |
+
try:
|
| 6 |
+
result = subprocess.check_output(["neofetch"])
|
| 7 |
+
return result.decode("utf-8")
|
| 8 |
+
except Exception as e:
|
| 9 |
+
return "Error: " + str(e)
|
| 10 |
|
| 11 |
+
iface = gr.Interface(fn=get_system_info, outputs="text")
|
| 12 |
+
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|