Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
import subprocess
|
|
|
3 |
|
4 |
def install_package(package_name):
|
5 |
command = f"pip install {package_name}"
|
@@ -11,34 +12,9 @@ def install_package(package_name):
|
|
11 |
def main():
|
12 |
st.title("Пакетный менеджер")
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
st.text(f"Выполняется установка пакета: {package_input}")
|
17 |
-
install_package(package_input)
|
18 |
-
st.text(f"Установка пакета {package_input} завершена")
|
19 |
-
|
20 |
-
st.subheader("Вывод результатов")
|
21 |
-
output = st.empty()
|
22 |
-
|
23 |
-
if st.button("Очистить вывод"):
|
24 |
-
output.text("")
|
25 |
-
|
26 |
-
if __name__ == "__main__":
|
27 |
-
main()
|
28 |
-
import streamlit as st
|
29 |
-
import subprocess
|
30 |
-
|
31 |
-
def install_package(package_name):
|
32 |
-
command = f"pip install {package_name}"
|
33 |
-
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
|
34 |
-
for line in process.stdout:
|
35 |
-
st.text(line.rstrip())
|
36 |
-
process.wait()
|
37 |
-
|
38 |
-
def main():
|
39 |
-
st.title("Пакетный менеджер")
|
40 |
|
41 |
-
package_input = st.text_input("Введите имя пакета для установки")
|
42 |
if st.button("Установить"):
|
43 |
st.text(f"Выполняется установка пакета: {package_input}")
|
44 |
install_package(package_input)
|
|
|
1 |
import streamlit as st
|
2 |
import subprocess
|
3 |
+
import uuid
|
4 |
|
5 |
def install_package(package_name):
|
6 |
command = f"pip install {package_name}"
|
|
|
12 |
def main():
|
13 |
st.title("Пакетный менеджер")
|
14 |
|
15 |
+
package_input_key = str(uuid.uuid4()) # Generate a unique key for package input
|
16 |
+
package_input = st.text_input("Введите имя пакета для установки", key=package_input_key)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
|
|
18 |
if st.button("Установить"):
|
19 |
st.text(f"Выполняется установка пакета: {package_input}")
|
20 |
install_package(package_input)
|