forked from OpenMS/streamlit-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check with 1.34.0, added Window_executable.py, remove not .md emojies
- Loading branch information
Arslan
committed
May 8, 2024
1 parent
e89fa24
commit 131bfb5
Showing
6 changed files
with
83 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import streamlit as st | ||
import requests | ||
|
||
import streamlit as st | ||
|
||
# Define CSS styles | ||
css = ''' | ||
<style> | ||
/* Add space between tabs */ | ||
.stTabs [data-baseweb="tab-list"] button { | ||
margin-right: 20px; | ||
border-radius: 5px; | ||
transition: background-color 0.3s ease, color 0.3s ease; /* Add smooth transition */ | ||
} | ||
/* Style active tab */ | ||
.stTabs [data-baseweb="tab-list"] button:focus { | ||
background-color: #f0f0f0; /* Change background color of active tab */ | ||
color: #333333; /* Change text color of active tab */ | ||
border-width: 3px; /* Increase thickness of blue line */ | ||
} | ||
/* Style tab text */ | ||
.stTabs [data-baseweb="tab-list"] button [data-testid="stMarkdownContainer"] p { | ||
font-size: 2rem; | ||
font-weight: bold; | ||
} | ||
/* Add hover effect */ | ||
.stTabs [data-baseweb="tab-list"] button:hover { | ||
background-color: #f8f8f8; /* Change background color on hover */ | ||
} | ||
</style> | ||
''' | ||
|
||
|
||
st.markdown(css, unsafe_allow_html=True) | ||
|
||
st.markdown(""" | ||
# 💻 How to package everything for window executables | ||
This guide explains how to package streamlit apps into Windows executables using two different methods: | ||
""") | ||
|
||
def fetch_markdown_content(url): | ||
response = requests.get(url) | ||
if response.status_code == 200: | ||
# Remove the first line from the content | ||
content_lines = response.text.split("\n") | ||
markdown_content = "\n".join(content_lines[1:]) | ||
return markdown_content | ||
else: | ||
return None | ||
|
||
tabs = ["window executable with embeddable python", "window executable with pyinstaller"] | ||
tabs = st.tabs(tabs) | ||
|
||
# window executable with embeddable python | ||
with tabs[0]: | ||
markdown_url = "https://raw.githubusercontent.com/Arslan-Siraj/streamlit-template/main/win_exe_with_embed_py.md" | ||
|
||
markdown_content = fetch_markdown_content(markdown_url) | ||
|
||
if markdown_content: | ||
st.markdown(markdown_content, unsafe_allow_html=True) | ||
else: | ||
st.error("Failed to fetch Markdown content from the specified URL.", markdown_url) | ||
|
||
# window executable with pyinstaller | ||
with tabs[1]: | ||
# URL of the Markdown document | ||
markdown_url = "https://raw.githubusercontent.com/Arslan-Siraj/streamlit-template/main/win_exe_with_pyinstaller.md" | ||
|
||
markdown_content = fetch_markdown_content(markdown_url) | ||
|
||
if markdown_content: | ||
st.markdown(markdown_content, unsafe_allow_html=True) | ||
else: | ||
st.error("Failed to fetch Markdown content from the specified URL. ", markdown_url) | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters