|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": {}, |
| 6 | + "source": [ |
| 7 | + "<h2>A simple streamlit program</h2>" |
| 8 | + ] |
| 9 | + }, |
| 10 | + { |
| 11 | + "cell_type": "code", |
| 12 | + "execution_count": 1, |
| 13 | + "metadata": {}, |
| 14 | + "outputs": [], |
| 15 | + "source": [ |
| 16 | + "# importing the streamlit library\n", |
| 17 | + "\n", |
| 18 | + "import streamlit as st " |
| 19 | + ] |
| 20 | + }, |
| 21 | + { |
| 22 | + "cell_type": "code", |
| 23 | + "execution_count": 2, |
| 24 | + "metadata": {}, |
| 25 | + "outputs": [ |
| 26 | + { |
| 27 | + "name": "stderr", |
| 28 | + "output_type": "stream", |
| 29 | + "text": [ |
| 30 | + "2022年01月14日 11:47:16.988 \n", |
| 31 | + " \u001b[33m\u001b[1mWarning:\u001b[0m to view this Streamlit app on a browser, run it with the following\n", |
| 32 | + " command:\n", |
| 33 | + "\n", |
| 34 | + " streamlit run C:\\Users\\mithun\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\site-packages\\ipykernel_launcher.py [ARGUMENTS]\n" |
| 35 | + ] |
| 36 | + }, |
| 37 | + { |
| 38 | + "data": { |
| 39 | + "text/plain": [ |
| 40 | + "DeltaGenerator(_root_container=0, _provided_cursor=None, _parent=None, _block_type=None, _form_data=None)" |
| 41 | + ] |
| 42 | + }, |
| 43 | + "execution_count": 2, |
| 44 | + "metadata": {}, |
| 45 | + "output_type": "execute_result" |
| 46 | + } |
| 47 | + ], |
| 48 | + "source": [ |
| 49 | + "# to print hello world in streamlit\n", |
| 50 | + "\n", |
| 51 | + "st.text(\"Hello World\")\n", |
| 52 | + "\n", |
| 53 | + "# trying to change the font size and font style using markdown\n", |
| 54 | + "original_title = '<p style=\"font-family:Courier; color:Blue; font-size: 20px;\">Hello World</p>'\n", |
| 55 | + "st.markdown(original_title, unsafe_allow_html=True)\n", |
| 56 | + "\n", |
| 57 | + "original_title = '<p style=\"font-family:sans-serif; color:Red; font-size: 40 px;\">Hello World</p>'\n", |
| 58 | + "st.markdown(original_title, unsafe_allow_html=True)\n" |
| 59 | + ] |
| 60 | + } |
| 61 | + ], |
| 62 | + "metadata": { |
| 63 | + "interpreter": { |
| 64 | + "hash": "13eb0af71620a846e484681143862ad0a4deab6cadfc353264e5c14897c11035" |
| 65 | + }, |
| 66 | + "kernelspec": { |
| 67 | + "display_name": "Python 3.9.9 64-bit", |
| 68 | + "language": "python", |
| 69 | + "name": "python3" |
| 70 | + }, |
| 71 | + "language_info": { |
| 72 | + "codemirror_mode": { |
| 73 | + "name": "ipython", |
| 74 | + "version": 3 |
| 75 | + }, |
| 76 | + "file_extension": ".py", |
| 77 | + "mimetype": "text/x-python", |
| 78 | + "name": "python", |
| 79 | + "nbconvert_exporter": "python", |
| 80 | + "pygments_lexer": "ipython3", |
| 81 | + "version": "3.9.9" |
| 82 | + }, |
| 83 | + "orig_nbformat": 4 |
| 84 | + }, |
| 85 | + "nbformat": 4, |
| 86 | + "nbformat_minor": 2 |
| 87 | +} |
0 commit comments