<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Steamlit on Duke Hsu ｜ Learn • Build • Share</title><link>https://www.dukehsu.com/tags/steamlit.html</link><description>Recent content in Steamlit on Duke Hsu ｜ Learn • Build • Share</description><image><title>Duke Hsu ｜ Learn • Build • Share</title><url>https://www.dukehsu.com/images/og-default.jpg</url><link>https://www.dukehsu.com/images/og-default.jpg</link></image><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sat, 22 Nov 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://www.dukehsu.com/tags/steamlit/index.xml" rel="self" type="application/rss+xml"/><item><title>Using Python and Streamlit with MS SQL</title><link>https://www.dukehsu.com/posts/using-python-and-streamlit-with-mssql.html</link><pubDate>Sat, 22 Nov 2025 00:00:00 +0000</pubDate><guid>https://www.dukehsu.com/posts/using-python-and-streamlit-with-mssql.html</guid><description>&lt;h2 id="table-of-contents"&gt;Table of Contents&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Create and activate the Python environment&lt;/li&gt;
&lt;li&gt;Install Python modules&lt;/li&gt;
&lt;li&gt;Install MS SQL&lt;/li&gt;
&lt;li&gt;Start coding &amp;amp; Run&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;For this project, we used MS SQL, so the operating system is Windows Server 2012. I installed MS SQL Server 2012 Advanced. If your system is Windows 10 or Windows 11, install the latest version of MS SQL Express instead.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Python 3.12&lt;/li&gt;
&lt;li&gt;Windows OS&lt;/li&gt;
&lt;li&gt;MS SQL Express&lt;/li&gt;
&lt;li&gt;Internet&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id="get-started"&gt;Get started&lt;/h2&gt;
&lt;h3 id="create-and-activate-the-python-environment"&gt;Create and activate the Python environment&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Create the virtual environment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="n"&gt;-m&lt;/span&gt; &lt;span class="n"&gt;venv&lt;/span&gt; &lt;span class="n"&gt;c:&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Activate it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;&lt;span class="n"&gt;c:&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;Scripts&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;.\&lt;/span&gt;&lt;span class="n"&gt;activate&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Deactivate it when finished&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;deactivate&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="install-python-modules"&gt;Install Python modules&lt;/h3&gt;
&lt;p&gt;You can install these modules step by step, or use &lt;code&gt;pip install -r requirement.txt&lt;/code&gt;.&lt;/p&gt;</description></item></channel></rss>