winswを利用してサービス化する。 winswはJenkinsやGlassFishも使ってる。
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
"""Hack to add per-session state to Streamlit. | |
Usage | |
----- | |
>>> import SessionState | |
>>> | |
>>> session_state = SessionState.get(user_name='', favorite_color='black') | |
>>> session_state.user_name | |
'' |
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
リストに複数のdictをappendしようとすると下のように書いた場合、追加したすべてのdict型の変数が同じ値になる。 | |
mylist = [] | |
mydict = {} | |
for i,v in enumerate(items): | |
mydict['name'] = v | |
mydict['value'] = i | |
mylist.append(mydict) | |
この場合dict.copy()を使うと適切な結果になる。 | |
for i, v enumerate(items): |