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
アクセスキーこわい やめかたと漏らさない工夫
sassssan68
1
430
AI de Idea
kawaguti
PRO
2
120
Minecraft JavaのMODをSwiftで作る
1mash0
0
180
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
750
負債のメタファと2026年 / Debt Metaphor in Agentic Engineering Age 202609 Edition
twada
PRO
10
4.1k
AgentCore Runtime上にAgentic Coding基盤を構築・展開する際の設計ポイントと限界点 / Design considerations and limitations when building an agentic coding platform on AgentCore Runtime
har1101
5
320
LTのテーマ どうきめてる?〜5つの型と私のやり方〜
yama3133
1
110
AIエージェントを最高のパートナーに育てる方法|評価と判断軸を育てる5つのステップ
koichiaoki
1
150
Claude Code本って、 読む必要あるの?
oikon48
2
480
リアーキテクチャ後の障害ゼロを目指したShadow Testingの取り組み
nihonbuson
PRO
1
160
今話題のAI「Jev」って何? 宇宙最速で学ぶ会
minorun365
PRO
29
16k
AIに任せた品質は、誰が見立てるのか - AI時代のテストマネジメント
nakanao
3
2.2k
Featured
See All Featured
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.1k
How STYLIGHT went responsive
nonsquared
100
6.3k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
New Earth Scene 8
popppiees
4
2.6k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
530
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
540
The Mindset for Success: Future Career Progression
greggifford
PRO
0
500
エンジニアに許された特別な時間の終わり
watany
109
250k
Darren the Foodie - Storyboard
khoart
PRO
4
3.9k
Raft: Consensus for Rubyists
vanstee
142
7.7k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
700
Speed Design
sergeychernyshev
33
2.1k
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