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
190
Let's implement useless Python objects
hayaosuzuki
0
1.6k
How to Write Robust Python Code
hayaosuzuki
5
3.8k
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.5k
Other Decks in Technology
See All in Technology
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
150
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
190
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
130
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
480
Can We Measure Developer Productivity?
ewolff
1
150
AGIについてChatGPTに聞いてみた
blueb
0
130
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
13k
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
210
強いチームと開発生産性
onk
PRO
34
11k
Featured
See All Featured
Building Applications with DynamoDB
mza
90
6.1k
Embracing the Ebb and Flow
colly
84
4.5k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Automating Front-end Workflow
addyosmani
1366
200k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Being A Developer After 40
akosma
86
590k
Become a Pro
speakerdeck
PRO
25
5k
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