Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Python for Everyday
Search
HayaoSuzuki
September 11, 2021
Technology
1
1.8k
Python for Everyday
Python Charity Talks in Japan 2021.09 Lightning Talk
HayaoSuzuki
September 11, 2021
Tweet
Share
More Decks by HayaoSuzuki
See All by HayaoSuzuki
Tasting "Python Distilled"
hayaosuzuki
0
180
Let's implement useless Python objects
hayaosuzuki
0
1.5k
How to Write Robust Python Code
hayaosuzuki
5
3.7k
Unknown Evolution of the Built-in Function pow
hayaosuzuki
0
1.3k
How to Use In-Memory Streams
hayaosuzuki
1
4k
Do you know cmath module?
hayaosuzuki
0
3.1k
Elementary Number Theory with Python
hayaosuzuki
1
3.4k
Django QuerySet "ARE" Patterns
hayaosuzuki
0
3.2k
A Modernization of Legacy Django Based Applications
hayaosuzuki
1
7.4k
Other Decks in Technology
See All in Technology
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
120
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
0
110
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
220
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
860
信頼性に挑む中で拡張できる・得られる1人のスキルセットとは?
ken5scal
2
520
OCI Vault 概要
oracle4engineer
PRO
0
9.7k
AIチャットボット開発への生成AI活用
ryomrt
0
170
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
360
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Embracing the Ebb and Flow
colly
84
4.5k
Teambox: Starting and Learning
jrom
133
8.8k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
GraphQLとの向き合い方2022年版
quramy
43
13k
BBQ
matthewcrist
85
9.3k
A Tale of Four Properties
chriscoyier
156
23k
The Language of Interfaces
destraynor
154
24k
Six Lessons from altMBA
skipperchong
27
3.5k
Rails Girls Zürich Keynote
gr2m
94
13k
Transcript
ৗੜ׆Ͱ͏ Python Python for Everyday Hayao Suzuki Python Charity Talks
in Japan 2021.09 September 11, 2021
Who am I ? ͓લ୭Α ໊લ Hayao Suzukiʢླɹॣʣ Twitter @CardinalXaro
ࣄ Software Developer @ BeProud Inc. › גࣜձࣾϏʔϓϥυ › IT ษڧձࢧԉαʔϏε connpass › ΦϯϥΠϯֶशαʔϏε PyQ › γεςϜ։ൃͷͨΊͷυΩϡϝϯταʔϏε Tracery 2 / 13
Who am I ? ༁ɾࠪಡٕͨ͠ज़ॻʢൈਮʣ › ೖ Python 3 ୈ
2 ൛ (O’Reilly Japan) › Effective Python ୈ 2 ൛ (O’Reilly Japan) › ػցֶशʹΑΔ࣮༻ΞϓϦέʔγϣϯߏங (O’Reilly Japan) › PyTorch ͱ fastai Ͱ͡ΊΔσΟʔϓϥʔχϯά (O’Reilly Japan) › ࣮ફ ࣌ܥྻղੳ (O’Reilly Japan) New! https://xaro.hatenablog.jp/ ʹϦετ͕͋Γ·͢ɻ 3 / 13
Who am I ? ൃදϦετʢൈਮʣ › ϨΨγʔ Django ΞϓϦέʔγϣϯͷݱԽ (DjangoCongress
JP 2018) › SymPy ʹΑΔࣜॲཧ (PyCon JP 2018) › Python ͱָ͠Ήॳ (PyCon mini Hiroshima 2019) › ܅ cmath Λ͍ͬͯΔ͔ (PyCon mini Shizuoka 2020) › ΠϯϝϞϦʔετϦʔϜ׆༻ज़ (PyCon JP 2020) https://xaro.hatenablog.jp/ ʹϦετ͕͋Γ·͢ɻ 4 / 13
ࠓͷςʔϚ ৗੜ׆Ͱ͏ Python › Python ͷ׆༂ॴࣄ͚ͩͰͳ͍ʂ › ৗੜ׆Ͱʹཱͭ Python ඪ४ύοέʔδΛհ͠·͢ɻ
5 / 13
ࠓͷςʔϚ ৗੜ׆Ͱ͏ Python › datetime ύοέʔδ › secrets ύοέʔδ 6
/ 13
࣮ ൃച·ͰͷΧϯτμϯ ʰೖ Python 3 ୈ 2 ൛ʱ͕ 2021
3 ݄ 22 ʹൃߦ͞ΕΔ͕ɺ͋ͱԿͩΖ ͏͔ɻ 7 / 13
ܭࢉ datetime ύοέʔδͰܭࢉ >>> import datetime >>> xday = datetime.date(2021,
3, 22) >>> today = datetime.date(2021, 9, 11) >>> f"༁ຊ͕ൃߦ͞Ε͔ͯΒ{(today - xday).days}ܦա" ' ༁ຊ͕ൃߦ͞Ε͔ͯΒ 173 ܦա' େࣄͳه೦ܭࢉʹͥͻ datetime ύοέʔδΛ͓͏ʂ 8 / 13
࣮ ύεϫʔυΛϥϯμϜʹੜ͍ͨ͠ ύεϫʔυΛొ͍͕ͨ͠ɺ͍·Θ͠Α͘ͳ͍ɻؾܰʹ࡞Γ͍ͨɻ 9 / 13
ύεϫʔυੜ secrets ύοέʔδͰύεϫʔυੜ >>> import secrets >>> secrets.token_urlsafe(8) # จࣈ੍ݶʹԠͯ͡దٓௐ
'rwQ_XUqyrbo' େࣄͳύεϫʔυʹͥͻ secrets ύοέʔδΛ͓͏ʂ ˞ύεϫʔυϚωʔδϟͷ࠾༻ݕ౼͠·͠ΐ͏ɻ 10 / 13
࣮ ൿີͷ࣭ʹਅ໘ʹ͑ͨ͘ͳ͍ मֶཱྀߦͰߦͬͨॴʁ ޫʂ ࡳຈʂ தֶߍͷमֶཱྀߦϨΞέʔεͳͷͰݴ͑·ͤΜɻ 11 / 13
ൿີͷ࣭ secrets ύοέʔδͰൿີͷ࣭ճ import secrets hira = "".join([chr(x) for x
in range(ord("͋"), ord("Μ") + 1)]) kana = "".join([chr(x) for x in range(ord("Ν"), ord("ϲ") + 1)]) cs = hira + kana for _ in range(15): print("".join([secrets.choice(cs) for x in range(8)])) ൿີͷ࣭ʹͥͻ secrets ύοέʔδͰཱ͔͓ͪ͏ʂ 12 / 13
ࠓͷςʔϚ ৗੜ׆Ͱ͏ Python › datetime ύοέʔδɿࠣࡉͳ࣌ܭࢉʹ › secrets ύοέʔδɿ҆શͳύεϫʔυੜʹ 13
/ 13