streamlit学习笔记八-----一些特别的插件

一些有用的streamlit插件

1.垂直划块库,
安装pip install streamlit-vertical-slider
网址 https://github.com/sqlinsights/streamlit-vertical-slider
2. 把一些字符串组成各种图案,美化网页用
安装pip install steamlit-wordcloud
网址 https://github.com/rezaho/streamlit-wordcloud
3.登录插件
安装pip install st-login-form
使用说明 https://st-lgn-form.streamlit.app/
4.时间轴插件
安装 pip install streamlit-timeline
说明网址 https://github.com/innerdoc/streamlit-timeline

streamlit学习笔记九-----streamlit新版支持原生多页面二

本文介绍 st.Page 与 st.navigation方法结合,这个方法复杂但灵活,首先推荐

1
2
$ pip install streamlit --upgrade #先升级到最新版 streamlit

假设主页面的文档main_page.py如下:

1
2
3
4
5
6
7
8
import streamlit as st

def page_2():
st.title("页面三测试")

pg = st.navigation([st.Page("test1.py"), st.Page("test2.py"),st.Page(page_2,title="这个页面是个函数") ],position="sidebar")
pg.run()

另两个页而的文件 test1.py与test2.py与main_page.py在同一个目录下,不用另建目录。

  1. 这里先用st.Page声明了页面
    st.Page(
    pages, # 如果是字符串,就是声明的页面目录+文件名; 也可以是本页内定仪的一个函数
    title, # 页面标题,可以不用
    icon, # 页面图标,特殊字符串,也可以不用
    url_path, # 就是页面是一个www.**.时用
    default, # True,则页面不是一个web, 可以不用
    )
  2. 再把st.Page声明的页面传送到st.navigation([st.Page(“test1.py”),st.Page(“test2.py”),st.Page(test_3函数),st.Page(“test4.py”),…..])中,以便在.run时过行。
    st.navigation(
    pages, # 是一个列表或字典
    position, # 没有声明就是=“sidebar”,表示导航在侧边栏中,如果=“hidden”,则隐藏导航栏
    expanded, # False,如果菜单多了,可以折叠; True,不折叠菜单
    )

上面的例了中,pages是一个列表,如果要对页而进行分类,则可以用字典,便如:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import streamlit as st

def page_1():
st.title("页面三测试")

def page_2():
st.title("页面四测试")

pages = {
"测试页面": [
st.Page("test2.py", title="这个是测试文件2"),
st.Page("test3.py", title="这个是测试文件3"),
],
"测试函数": [
st.Page(page_2, title="测试函数2"),
st.Page(page_1, title="测试函数1"),
],
}

pg = st.navigation(pages)
pg.run()

一些家国情怀的歌

1. 梦驼铃

曲: 谭健常,词:小轩

攀登高峰望故乡 黄沙万里长

何处传来驼铃声 声声敲心坎

盼望踏上思念路 飞纵千里山

天边归雁披残霞 乡关在何方

风沙挥不去印在 历史的血痕

风沙挥不去苍白 海棠血泪

攀登高峰望故乡 黄沙万里长

何处传来驼铃声 声声敲心坎

盼望踏上思念路 飞纵千里山

天边归雁披残霞 乡关在何方

黄沙吹老了岁月 吹不老我的思念

曾经多少个今夜 梦回秦关

风沙挥不去印在 历史的血痕

风沙挥不去苍白 海棠血泪

黄沙吹老了岁月 吹不老我的思念

曾经多少个今夜 梦回秦关

2 垄上行

作曲: 吴智强,作词:庄奴

我从垄上走过

垄上一片秋色

枝头树叶金黄

风来声瑟瑟

仿佛为季节讴歌

我从乡间走过

总有不少收获

田里稻穗飘香

农夫忙收割

微笑在脸上闪烁

蓝天多辽阔

点缀着白云几朵

青山不寂寞

有小河潺潺流过

我从垄上走过

心中装满秋色

若是有你同行

你会陪伴我

重温往日的欢乐

3 我是中国人

作曲与作词:刘家昌

沉默不是懦弱

忍耐不是麻木

儒家的传统思想

带领我们的脚步

八年艰苦的抗战

证实我坚毅的民族

不到最后的关头

决不轻言战斗

忍无可忍的时候

我会挺身而出

同胞受苦河山待复

我会牢牢记住

我不管生在哪里

我是中国人

无论死在何处

誓做中国魂

—Music—

沉默不是懦弱

忍耐不是麻木

儒家的传统思想

带领我们的脚步

八年艰苦的抗战

证实我坚毅的民族

不到最后的关头

决不轻言战斗

忍无可忍的时候

我会挺身而出

同胞受苦河山待复

我会牢牢记住

我不管生在哪里

我是中国人

无论死在何处

誓做中国魂

windows宿主机下的Vbox 虚拟linux机安装增强

自家的2023版笔记本电脑时间长了,电池只有顶半个小时,公司就给我配了台联想E15,可是装的是win11。很不习惯用啊,不是自己的,轻易不会改linux,于是先用wsl安装Debian,却发现其实不好用,于是借助vbox初装Debian试试。

  1. 安装vbox扩展时出现问题
1
2
3
4
./VBoxLinuxAdditions.run
bash: ./VBoxLinuxAdditions.run: /bin/sh: bad interpreter: Permission denied
还以为是没有用sudo,于是
sudo ./VBoxLinuxAdditions.run #还是不行

查看文件的执行权限是555,可以执行.

改为:

1
sudo sh ./VBoxLinuxAdditions.run

运行正常.
问题的原因是挂载分区时,没有指定参数exec的缘故。可以把装载参数改为defaults或者在执行脚本前添加sh即:sh ./+脚本名称。

被初中男孩子唱红的that girl

That girl

there’s a girl but i let her get away
it’s all my fault cause pride got in the way
and i’d be lying if i said i was ok
about that girl the one i let get away
i keep saying no
this can’t be the way it was supposed to be
i keep saying no
there’s gotta be a way to get you close to me
now i know you gotta
speak up if you want somebody
can’t let them get away oh no
you don’t wanna end up sorry
the way that i’m feeling every day
don’t you know
no no no no
there’s no hope for the broken heart
don’t you know
no no no no
there’s no hope for the broken
there’s a girl but i let her get away
it’s my fault cause i said i needed space
i’ve been torturing myself night and day
about that girl the one i let get away
i keep saying no
this can’t be the way it was supposed to be
i keep saying no
there’s gotta be a way to get you
gotta be a way
to get you close to me
you gotta
speak up if you want somebody
can’t let them get away oh no
you don’t wanna end up sorry
the way that i’m feeling every day
don’t you know
no no no no
there’s no hope for the broken heart
don’t you know
no no no no
there’s no hope for the broken
no home for me
no home cause i’m broken
no room to breathe
and i got no one to blame
no home for me
no home cause i’m broken
about that girl
the one i let get away
so you better
speak up if you want somebody
you can’t let him get away no no
you don’t wanna end up sorry
the way that i’m feeling every day
don’t you know
no no no no
there’s no home for the broken heart
don’t you know
no no no no
there’s no home for the broken
oh
you don’t wanna lose at love
it’s only gonna hurt too much
i’m telling you
you don’t wanna lose at love
it’s only gonna hurt too much
i’m telling you
you don’t wanna lose that love
cause there’s no home for the broken heart
that girl
the one i let get away

加拿大歌手布莱恩.亚当斯的经典歌曲

1. everthing I do , I do for you

Look into my eyes

You will see what you mean to me

Search your heart search your soul

And when you find me there you’ll search no more

Don’t tell me it’s not worth trying for

You can’t tell me it’s not worth dying for

You know it’s true

Everything I do

I do it for you

Look into your heart

You will find there’s nothing there to hide

Take me as I am take my life

I would give it all I would sacrifice

Don’t tell me it’s not worth fighting for

I can’t help it there’s nothing I want more

You know it’s true

Everything I do

I do it for you

There’s no love

Like your love

And no other

Could give more love

There’s no where

Unless you’re there

All the time all the way

Ah you can’t tell me it’s not worth trying for

I can’t help it there’s nothing I want more

Yeah I would fight for you

I’d lie for you

Walk the wire for you

Yeah I’d die for you

You know it’s true

Everything I do

I do it for you

2 Here I Am (我就在这) - Bryan Adams (布莱恩·亚当斯)

作词 : Bryan Adams/Gretchen Peters/Hans Zimmer
作曲 : Bryan Adams/Gretchen Peters/Hans Zimmer

Here I am this is me
There’s no where else on earth I’d rather be
Here I am it’s just me and you
And tonight we make our dreams come true
It’s a new world it’s a new start
It’s alive with the beating of young hearts
It’s a new day it ‘s a new plan
I’ve been waiting for you
Here I am
Here we are we’ve just begun
And after all this time our time has come
Ya here we are still going strong
Right here in the place where we belong
It’s a new world it’s a new start
It’s alive with the beating of young hearts
It’s a new day it ‘s a new plan
I’ve been waiting for you
Here I am
Here I am this is me
There’s no where else on earth I’d rather be
Here I am it’s just me and you
And tonight we make our dreams come true
It’s a new world it’s a new start
It’s alive with the beating of young hearts
It’s a new day it ‘s a new plan
I’ve been waiting for you
It’s a new world it’s a new start
It’s alive with the beating of young hearts
It’s a new day it ‘s a new plan
I’ve been waiting for you
Here I am
Here I am next to you
And suddenly the world is all brand new
Here I am where I’m gonna stay
Now there’s nothin standin in our way
Here I am this is me

只要平凡 (《我不是药神》电影主题曲)

只要平凡 (《我不是药神》电影主题曲) - 张杰/张碧晨

词:格格

曲:黄超

也许很远或是昨天

在这里或在对岸

长路辗转离合悲欢

人聚又人散

放过对错才知答案

活着的勇敢

没有神的光环

你我生而平凡

在心碎中认清遗憾

生命漫长也短暂

跳动心脏长出藤蔓

愿为险而战

跌入灰暗坠入深渊

沾满泥土的脸

没有神的光环

握紧手中的平凡

此心此生无憾

生命的火已点燃

有一天也许会走远

也许还能再相见

无论在人群在天边

让我再看清你的脸

任泪水铺满了双眼

虽无言泪满面

不要神的光环

只要你的平凡

朴树--平凡之路

1. 平凡之路

作词:韩寒,朴树 作曲:朴树 演唱:朴树

徘徊着的 在路上的
你要走吗 via via
易碎的 骄傲着
那也曾是我的模样
沸腾着的 不安着的
你要去哪 via via
谜一样的 沉默着的
故事你真的在听吗
我曾经跨过山和大海
也穿过人山人海
我曾经拥有着的一切
转眼都飘散如烟
我曾经失落失望失掉所有方向
直到看见平凡才是唯一的答案
当你仍然 还在幻想
你的明天 via via
她会好吗 还是更烂
对我而言是另一天
我曾经毁了我的一切
只想永远地离开
我曾经堕入无边黑暗
想挣扎无法自拔
我曾经像你像他像那野草野花
绝望着 也渴望着
也哭也笑平凡着
向前走 就这么走
就算你被给过什么
向前走 就这么走
就算你被夺走什么
向前走 就这么走
就算你会错过什么
向前走 就这么走
就算你会
我曾经跨过山和大海
也穿过人山人海
我曾经拥有着的一切
转眼都飘散如烟
我曾经失落失望失掉所有方向
直到看见平凡才是唯一的答案
我曾经毁了我的一切
只想永远地离开
我曾经堕入无边黑暗
想挣扎无法自拔
我曾经像你像他像那野草野花
绝望着 也渴望着
也哭也笑平凡着
我曾经跨过山和大海
也穿过人山人海
我曾经问遍整个世界
从来没得到答案
我不过像你像他像那野草野花
冥冥中这是我 唯一要走的路啊
时间无言 如此这般
明天已在 hia hia
风吹过的 路依然远
你的故事讲到了哪