Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Python for Everyday
Search
HayaoSuzuki
September 11, 2021
Technology
2.5k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Python for Everyday
Python Charity Talks in Japan 2021.09 Lightning Talk
HayaoSuzuki
September 11, 2021
Transcript
13 slides
ৗੜ׆Ͱ͏ 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
More Decks by HayaoSuzuki
See All by HayaoSuzuki
Let's implement useless Python objects (revised)
hayaosuzuki
0
74
Tomorrow graphlib, Let us use everybody
hayaosuzuki
1
2.6k
Tasting "Python Distilled"
hayaosuzuki
0
430
Let's implement useless Python objects
hayaosuzuki
0
2.1k
How to Write Robust Python Code
hayaosuzuki
5
4.8k
Unknown Evolution of the Built-in Function pow
hayaosuzuki
0
1.5k
How to Use In-Memory Streams
hayaosuzuki
1
6.6k
Do you know cmath module?
hayaosuzuki
0
3.4k
Elementary Number Theory with Python
hayaosuzuki
1
3.7k
Other Decks in Technology
See All in Technology
人間+AIを「チーム」としてプロセスを再設計する
littlehands
4
3k
AIネイティブ組織の作り方。1人のPOとAIから始める、自社での実験
ama_ch
2
860
Where Should Platform Complexity Live? Lessons from a Cross-Team PR Preview Platform
taiki45
0
110
これからのデータエンジニアの役割について考える / Rethinking the Role of Data Engineers in the AI Era
okiyuki99
0
490
速くなるほど、深く考える AI時代のQAに学ぶ
kobayashiyorimitsu
0
220
狙われているAPIの脆弱性!今こそ手をつけるべき根本的な対策とは?
nagix
0
130
常時稼働エージェントの作り方(Claude公式ブログを資料化)
minorun365
PRO
11
19k
田んぼの見回りをIoTで減らしたい!水位監視から電池駆動カメラまでの試行錯誤
itosoft
1
220
An Introduction to Context Ontology Accelerator (teaching AI agents what your data means)
inariku
PRO
1
270
生成AI時代のIAMのマニアックな話
takuros
6
3.3k
アラートを見直していたら営業組織への理解にちょっとだけ繋がった話
z63d
1
200
_マネジメントする人される人ナイト_2026__良いチームを作っていきたい_お気持ち_.pdf
xkxaxkx
0
530
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
290
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
330
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
480
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
340
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.3k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
610
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
830
ラッコキーワード サービス紹介資料
rakko
5
5.8M
A better future with KSS
kneath
240
18k