Download - LT: 今日帰ってすぐに始められるPython #nds45
![Page 1: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/1.jpg)
今日帰ってすぐに始められるPython#nds45 @civic
![Page 2: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/2.jpg)
このプレゼンのねらい
Pythonへの熱い想いを語って
少しでもPython人口を増やしたい
![Page 3: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/3.jpg)
Pythonの良さ
![Page 4: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/4.jpg)
かんたん
![Page 5: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/5.jpg)
素直で覚えやすい
![Page 6: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/6.jpg)
人気あり
![Page 8: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/8.jpg)
第3位
![Page 9: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/9.jpg)
Ruby
![Page 10: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/10.jpg)
第2位
![Page 11: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/11.jpg)
Java
ざわ・・・
ざわ・・・ざわ・・・
![Page 12: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/12.jpg)
第1位
![Page 13: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/13.jpg)
JavaScript
![Page 14: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/14.jpg)
Python人気は?
• 4位 PHP
• 5位 Python
• 6位 CSS
• 7位 C++
• 8位 C#
• 9位 C
• 10位 HTML
![Page 15: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/15.jpg)
オススメ 始めるときに用意するもの
![Page 16: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/16.jpg)
PyCharm Community Editionただのエディタでもいいけど
![Page 17: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/17.jpg)
PyEnvプロジェクト別のPython環境構築
![Page 18: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/18.jpg)
好きなPython構文
![Page 19: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/19.jpg)
デコレーター
![Page 20: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/20.jpg)
デコレーター
• アノテーションのように関数を修飾できる • じつは関数を修飾できる関数 • 簡単に組み込むことが出来る
@MyDeco def myfunc(): print("Hello")
←デコレーター
![Page 21: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/21.jpg)
• デコレーターとは
「関数を引数にもらって関数を返す」関数
→関数を修飾する関数
デコレーターの実装
def MyDeco(func): def decorated_func(): print("start") func() print("end") return decorated_func
![Page 22: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/22.jpg)
実行結果
>>> def MyDeco(func): ... def decorated_func(): ... print("start") ... func() ... print("end") ... return decorated_func ... >>> @MyDeco ... def my_func(): ... print("Hello") ... >>> my_func() start Hello end
デコレーターの実装
デコレーターの利用
修飾された関数の実行
![Page 23: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/23.jpg)
デコレータの利用とは
@MyDeco def my_func(): ....
my_func=MyDeco(my_func)
デコレーターによる修飾 関数を修飾する処理を実行
= イコール
![Page 24: LT: 今日帰ってすぐに始められるPython #nds45](https://reader034.vdocuments.pub/reader034/viewer/2022050614/5882136b1a28ab3f4c8b4f6d/html5/thumbnails/24.jpg)
時間がないので 今日話すのはここまで