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
PyQではじめるPython
Search
Shuhei Ozawa
January 15, 2018
Technology
490
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PyQではじめるPython
LT資料
https://python-nyumon.connpass.com/event/71516/
Shuhei Ozawa
January 15, 2018
More Decks by Shuhei Ozawa
See All by Shuhei Ozawa
Amebaアフィリエイト基盤の GKEアーキテクチャと マイクロサービス
ozashu
0
280
production_ready_envoy
ozashu
2
1.2k
ログ・係数集約と可視化・分析
ozashu
0
170
Python for web architectures
ozashu
0
1k
インフラエンジニアのWEBアプリ入門
ozashu
1
8.1k
Other Decks in Technology
See All in Technology
AI Agent入門〜今更聞けないAgentの話〜
hiromimaganuma
0
120
「今盗んで、後で解く」に備える ― AWSのポスト量子暗号入門
yama3133
2
240
サーバーレスをどこまで使う? WebRTC対戦ゲームで選んだVPSとの共存設計
kaidouji85
0
430
負債のメタファと2026年 / Debt Metaphor in Agentic Engineering Age 202609 Edition
twada
PRO
12
7k
高負荷プロダクション環境におけるAWS Lambdaのリアル 〜スケールとコストを左右する実行ライフサイクルの技術仕様〜
maimyyym
2
590
PQC移行の今 -- IETF からみた現在地
satokan
3
250
AI感のないAWS構成図をAIエージェントに描かせたい!
sagochiko
1
370
AgentCore Runtime上にAgentic Coding基盤を構築・展開する際の設計ポイントと限界点 / Design considerations and limitations when building an agentic coding platform on AgentCore Runtime
har1101
6
750
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
2
20k
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
3
2.7k
セルフサービスのオブザーバビリティ基盤をOpenTelemetryで作る / Building a Self-Service Observability Platform with OpenTelemetry
ymotongpoo
2
140
AIエージェントの一手は 誰も見ていない - Falco拡張OSS「Prempti」とeBPFで サーバーレス実行基盤を二層防御する
keitah
1
570
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
460
Writing Fast Ruby
sferik
630
63k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Everyday Curiosity
cassininazir
0
330
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
510
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
710
How to train your dragon (web standard)
notwaldorf
97
6.8k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
520
The Cost Of JavaScript in 2023
addyosmani
55
10k
Transcript
PyQͰ͡ΊΔPython Pythonೖऀͷू͍ #6 2018/01/16 - Ozawa Shuhei ( @oza_shu )
1
ࣗݾհ — খपฏ — @oza_shu — MSPۀք WEBαʔϏεͷαʔόӡ༻ Pythonೖऀͷू͍ #6
2018/01/16 - Ozawa Shuhei ( @oza_shu ) 2
PyQͱ — ࣸܦϕʔεͰ՝Λղ͍֮ͯ͑Δ — աڈͷ՝Ͱशͬͨจ๏෮ֶͯ͠शͰ͖Δ — ֶशΧϨϯμʔ͕Ͱ͖ͨ Pythonೖऀͷू͍ #6 2018/01/16
- Ozawa Shuhei ( @oza_shu ) 3
ֶशͰ͖Δ༰ — جຊతͳจ๏ — WebΞϓϦ(Django) — σʔλॲཧ(pandas) — ػցֶश Pythonೖऀͷू͍
#6 2018/01/16 - Ozawa Shuhei ( @oza_shu ) 4
PythonͰLinuxαʔόͱྑ͘ͳΔ — ΞϓϦΛಈ͔͍ͯ͠Δϓϩηεʹ͍ͭͯͬͱΓ͍ͨ — Ͳ͏ͬͯΞϓϦʹΞΫηε͍ͯ͠Δͷ͔Γ͍ͨ Pythonೖऀͷू͍ #6 2018/01/16 - Ozawa
Shuhei ( @oza_shu ) 5
ΞϓϦΛಈ͔͍ͯ͠Δϓϩηεʹ͍ͭͯͬͱΓ͍ͨ — OSϓϩηεΛɺϓϩηεʹׂΓৼΒΕͨPIDΛΈͯ ͱͯ͠ѻ͏ — ϓϩηε͕։͍ͨϑΝΠϧʹϑΝΠϧσΟεΫϦϓλׂ͕ ΓͯΒΕΔ Pythonೖऀͷू͍ #6 2018/01/16
- Ozawa Shuhei ( @oza_shu ) 6
ίʔυྫ(1) PIDΛΈͯΈΑ͏ # ݱࡏͷϓϩηεΛฦ͢ import os print ("My pid:", os.getpid())
$ python3 3_processes_have_pid.py My pid: 10592 Pythonೖऀͷू͍ #6 2018/01/16 - Ozawa Shuhei ( @oza_shu ) 7
psίϚϯυͰ֬ೝͰ͖Δ ps aux |grep zsh USER PID %CPU %MEM VSZ
RSS TT STAT STARTED TIME COMMAND root 74749 0.0 0.0 4296948 3016 s005 Ss 2:39AM 0:00.11 -zsh root 73439 0.0 0.0 4296948 3028 s003 Ss 2:19AM 0:00.11 -zsh root 63923 0.0 0.0 4296948 2980 s001 Ss+ 11:15PM 0:00.10 -zsh PID͔ΒSWAP༻ྔ͕ଟ͍ϓϩηεΛಛఆ $ grep VmSwap /proc/*/status |sort -k2 -r |head -n /proc/2121/status:VmSwap: 158284 kB /proc/16520/status:VmSwap: 154516 kB /proc/18192/status:VmSwap: 141116 kB Pythonೖऀͷू͍ #6 2018/01/16 - Ozawa Shuhei ( @oza_shu ) 8
ίʔυྫ(2) ϑΝΠϧσΟεΫϦϓλ # ϑΝΠϧσΟεΫϦϓλׂ͕ΓͯΒΕ͍ͯΔ͔ΈͯΈΑ͏ if __name__ == "__main__": with open("/etc/passwd")
as passwd: print(passwd.fileno()) # ϑΝΠϧΛด͡Δͱফ͑Δ $ python3 file_descriptors.py 3 Pythonೖऀͷू͍ #6 2018/01/16 - Ozawa Shuhei ( @oza_shu ) 9
ಛผͳϑΝΠϧσΟεΫϦϓλ — ඪ४ೖྗ → 0 — ඪ४ग़ྗ → 1 —
ඪ४Τϥʔग़ྗ → 2 >>> sys.stdin.fileno() 0 >>> sys.stdout.fileno() 1 >>> sys.stderr.fileno() 2 Pythonೖऀͷू͍ #6 2018/01/16 - Ozawa Shuhei ( @oza_shu ) 10
ᐆດͩͬͨॻ͖ํΛཧղͰ͖ΔΑ͏ʹͳͬͨ ! command >/dev/null 2>&1 ! command 2>&1 >/dev/null Pythonೖऀͷू͍
#6 2018/01/16 - Ozawa Shuhei ( @oza_shu ) 11
fork()ؾʹͳͬͯ͘Δ ϓϩηε͕Fork͞ΕΔͬͯͲ͏͍͏͜ͱ͚ͩͬ? ࢠϓϩηεϓϩηεͰΘΕ͍ͯΔશͯͷϝϞϦͷίϐʔΛҾ͖ܧ͙ ϑΝΠϧσΟεΫϦϓλ(ιέοτ) — socket,osϞδϡʔϧͳͲͰpreforkαʔόॻ͚Δ — ίϐʔɾΦϯɾϥΠτʢCoWɺCopy on Writeʣ
— ԿͰκϯϏϓϩηεͬͯͳΔΜ͚ͩͬ — ϓϩηεؒ௨৴ — ύΠϓॲཧ,ετϦʔϜ,ϝοηʔδ — γάφϧॲཧ — ϓϩηεάϧʔϓ,ηογϣϯάϧʔϓ Pythonೖऀͷू͍ #6 2018/01/16 - Ozawa Shuhei ( @oza_shu ) 12
·ͱΊ — PyQࣸܦΛ௨ͯ͠ͷֶशͳͷͰɺϓϩάϥϛϯάॳΊͨ ͔ΓͷਓʹΑͦ͞͏ — PythonΛ௨ͯ͡Linuxͱྑ͘ͳΕΔ — ϓϩηε͕Ͳ͏࣮ߦ͞Ε͍ͯΔͷ͔ͪΌΜͱཧղ͢Δॿ͚ ʹͳΔ Pythonೖऀͷू͍
#6 2018/01/16 - Ozawa Shuhei ( @oza_shu ) 13