simple app
To upload files, please first save the app
import streamlit as st
import os
import subprocess
# Set the title of the Streamlit app
st.title("Dcirectory and Installed Packages Viewer")
# Display the contents of the current directory
st.write("Contents of current directory:")
directory_contents = os.listdir('.')
st.write(', '.join(directory_contents))
# Function to get the output of pip freeze
def get_pip_freeze():
result = subprocess.run(['pip', 'freeze'], stdout=subprocess.PIPE, text=True)
return result.stdout
# Display the results of pip freeze
st.write("Installed Python packages:")
pip_freeze_output = get_pip_freeze()
st.text_area("Installed Packages", pip_freeze_output, height=300)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?