Create a streamlit application which display asciie art, generate this asciie art from a math function
Drop files here
or click to upload
import numpy as np
import streamlit as st
st.title("ASCII Art Generator")
# Define the function to create ASCII art
def ascii_art_generator(func, num_points=200):
x = np.linspace(-2 * np.pi, 2 * np.pi, num_points)
y = func(x)
return np.array(["*" if yi > 0 else " " for yi in y])
# Define a sample math function
math_function = np.sin
# Generate ASCII art data
ascii_art = ascii_art_generator(math_function)
# Display the generated ASCII art
st.write("ASCII Art Representation of the Function:")
for char in ascii_art:
st.write(char)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?