| by Arround The Web | No comments

Building your first Streamlit App for Non-Python Users

Streamlit is a Python library that allows non-Python users to create well-responsive and interactive web applications. Streamlit is also designed for those users who don’t have enough idea about web development coding they transform their data scripts or visualizations into interactive apps.

In this article, I will guide you on how you can create your first app with even enough knowledge about app development.

How to Build the First Streamlit App For Non-Python Users?

Step 1: Create an Environment

Firstly get Python, whether you have a PC or laptop download it from the official website and install it by following the instructions that appear while installing on the respective operating system.

Step 2: Install Packages

After getting Python, open the command-line interface for macOS/Linux they have a terminal, and For Windows they have Command Prompt and then install Streamlit using pip, Python’s package manager. Type the following simple command:

pip install streamlit

Step 3: Creating Script File

Now, open your Python interpreter, it’s time to make the Streamlit app and for that create a new file with a .py extension (e.g., app.py). This will be called your Streamlit app script.

Step 4: Add Code to Display

After creating an app script file, you need to simplify your code according to your requirement for instance, you want to display text, images, or interactive charts. Let’s take an example: I want to print a string on my web app. I type the code given below. For non-Python users, you can copy-paste and modify the code available on different open-source platforms Examples available in the Streamlit document:

import streamlit as st

st.write("Hello ,let's learn how to build a streamlit app together")

Step 5: Run the App

Now, save your app script and open your command-line interface. Locate the directory where your app script is saved. To run your Streamlit app, type the given below command:

streamlit run app.py

Replace app.py with the name of your app script whatever you have created. This command will launch your app and provide a local URL (usually http://localhost:8501) from this localhost you can access your web application simply:

Now your Streamlit app is running, you can use your app in the web browser, for any modifications you need to change the .py file and save it then it will automatically update your web browser:

A screenshot of a computer Description automatically generated

Conclusion

Machine learning engineers / AI engineers who don’t have any idea about web development or app development coding but have to represent their work for the user mean they need a user interface, for this Streamlit makes it easy for non-Python users to build interactive web applications without extensive coding knowledge. With this guide, you can quickly make your first Streamlit app.

Share Button

Source: linuxhint.com

Leave a Reply