How to Create a Website using python? "Streamlit Library "
- Technology Spiritual
- Jul 31, 2020
- 2 min read
Updated: Aug 15, 2020
Hello Friends,
This blog is containing the brief information about "How to Create a Web App using python" and how Streamlit Library work. I will also explain few practical example. Hope you have install Anaconda Environment for practice, if not than Anaconda Environment Setup .
Once it has installed, Just open the Spyder tool for development.

Here you have to write code and run that code accordingly.

Lets Start with a small example, I am going to explain few of functions from Streamlit Library to make a simple Web App.
Here is the Code for web APP which containing a simple URL input box and Check box and how to run your project using Streamlit Lib.

You cannot copy this code from here, I have done this with an intention. If you habitual to copy and paste than you can't learn these stuff accurately, So you have to write these code your own.
I have skipped the code behind hash tag.
Line 1: Import Streamlit as st : In this command we are importing the library from kernel to use their function later, "st" refers to variable name for further use.
Line 2: Import pandas as pd : Same as streamlit library.
Line 3: st.title('The title of your Web Application'): st.title refers for title of you project.
Line 4: name = st.text_input('Enter your name: Text input box for user and write these input just after the input box st.write('Helo Dear', name).
Line 5: df = pd.read_csv("dataset.csv") This command is used for read the data from a file(.csv) . after that if you click on check box (if st.checkbox('show dataframe')) than st.write(df) command write the data on screen.
Now just write the code and save your file with "py" extension. and run the program by using command prompt.
click on start button and open "Anaconda prompt"

Enter the below mentioned command to run your first Web App. After running the command you have found the URL for your web app.

Notice the yellow marked words. Here we have a command "Streamlit run temp.py" and result is an IP address with port number. Just copy the URL and browse on web browser.

At the moment no any data is showing on screen so if i click on show checkbox this will shows on screen. You can recheck the elaboration of commands for better understanding.

Yeah Congrats ! its your first Web Application. Python have number of different libraries which can make these development very easy and quick. to know more about these libraries.
Thanks for reading ! Your opinions are valuable for me. So please comment in below section to improve the quality of information.
Share and care : Technology Spiritual
Comments