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
Starting Python
Search
Kentaro Kawano
July 10, 2017
Programming
0
79
Starting Python
Pythonを始められるような基本的なところ
Kentaro Kawano
July 10, 2017
Tweet
Share
More Decks by Kentaro Kawano
See All by Kentaro Kawano
Goでのレシーバーとnilの関係 / Receiver and nil relationship in Go
kawaken
0
450
Goの時刻に関するテスト/Testing time in Go
kawaken
0
85
AWS Lambda + Go
kawaken
0
83
goaのdesignをラクに書く/Write goa design easily
kawaken
0
80
Goでのチーム開発とコード管理の悩み/Team development and code management in Go
kawaken
0
86
Pyvmomiとansibleのdynamic inventory
kawaken
0
88
Other Decks in Programming
See All in Programming
AIレビュアーをスケールさせるには / Scaling AI Reviewers
technuma
2
220
KessokuでDIでもgoroutineを活用する / Go Connect #6
mazrean
0
110
技術的負債で信頼性が限界だったWordPress運用をShifterで完全復活させた話
rvirus0817
1
2k
decksh - a little language for decks
ajstarks
4
21k
レガシープロジェクトで最大限AIの恩恵を受けられるようClaude Codeを利用する
tk1351
2
590
Flutter로 Gemini와 MCP를 활용한 Agentic App 만들기 - 박제창 2025 I/O Extended Seoul
itsmedreamwalker
0
150
The State of Fluid (2025)
s2b
0
190
Claude Codeで実装以外の開発フロー、どこまで自動化できるか?失敗と成功
ndadayo
2
790
CSC305 Summer Lecture 04
javiergs
PRO
1
100
CEDEC 2025 『ゲームにおけるリアルタイム通信への QUIC導入事例の紹介』
segadevtech
3
960
A Gopher's Guide to Vibe Coding
danicat
0
170
The state patternの実践 個人開発で培ったpractice集
miyanokomiya
0
150
Featured
See All Featured
KATA
mclloyd
32
14k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
What's in a price? How to price your products and services
michaelherold
246
12k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Practical Orchestrator
shlominoach
190
11k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.6k
Six Lessons from altMBA
skipperchong
28
4k
Typedesign – Prime Four
hannesfritz
42
2.8k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
183
54k
Transcript
Pythonͷ࢝Ίํ
࠷ۙPython͕Γ্͕͍ͬͯΔ
201511݄Ҏ߱(46த)
Δ͔͠ͳ͍ʂ ͜ͷϏοάΣʔϒʹʂ
CentOSͳΒPython͕ΠϯετʔϧࡁΈ $ python Python 2.6.6 (r266:84292, Aug 18 2016, 15:13:37)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print "Hello World" Hello World >>> exit()
͓ΘΓ
ͱ͍͏༁ʹ͍͔ͳ͍
CentOSͰ όʔδϣϯ͕ݹ͍
PythonͷόʔδϣϯҠߦʹ͍ͭͯ ɺ͍͜ͱͬͯΔͱͯ͠৭ʑ ࢥ͏ͱ͜Ζ͕͋Γ·͢ɻ͜ͷ͘ ͳΔͷͰࠓׂѪ͢Δ͚Ͳɺͱʹ͔ ͘ࠓʮPython3ܥΛ͏ʯͷ͕ྑ͍ Ͱ͢ɻͰɺAWSLambda2ܥͰπ ϥΠɻGoΛ͍·͠ΐ͏ɻ
None
Πϯετʔϧ(OLD) • xbuild ͕ศར $ git clone https://github.com/tagomoris/xbuild.git $ cd
xbuild $ ./python-install 3.5.2 ~/local/python-3.5.2
Πϯετʔϧ • ඪ४ͷΠϯετʔϥʔΛ͍·͠ΐ͏ • https://www.python.org/downloads/ • ࠷৽ 3.6.0 • όʔδϣϯϚωʔδϟෆཁʢޙड़ʣ
SDKͷόʔδϣϯཧ ෳͷPythonΛΠϯετʔϧ͢Δͱ… % ls /usr/local/bin/python3* /usr/local/bin/python3@ /usr/local/bin/python3.5m-config@ /usr/local/bin/python3-32@ /usr/local/bin/python3.6@ /usr/local/bin/python3-config@
/usr/local/bin/python3.6-32@ /usr/local/bin/python3.5@ /usr/local/bin/python3.6-config@ /usr/local/bin/python3.5-32@ /usr/local/bin/python3.6m@ /usr/local/bin/python3.5-config@ /usr/local/bin/python3.6m-config@ /usr/local/bin/python3.5m@ ͜͏ͳΔɻ
ݸผͷϓϩδΣΫτͷόʔδϣϯʁ • venv ΛͬͯSDKࣗମΛόϯυϧ͢Δ % pwd /Users/kekawano/hoge % python3.5 -m
venv venv % ls venv/ % ls venv/ bin/ include/ lib/ pip-selfcheck.json pyvenv.cfg
venv ͷ͍ํ • όʔδϣϯͷݻఆ • ͍͍ͨpython -m venv σΟϨΫτϦ໊ •
༗ޮԽ • source σΟϨΫτϦ໊/bin/activate • ແޮԽ • deactivate
ྫ % which python /usr/bin/python % source venv/bin/activate % which
python /Users/kekawano/hoge/venv/bin/python % python -V Python 3.5.1 % deactivate % python -V Python 2.7.10
ύοέʔδཧ • pip Λ͏ % which pip /Users/kekawano/hoge/venv/bin/pip % pip
install flask % pip show flask ... Location: /Users/kekawano/hoge/venv/lib/python3.5/site-packages ... • venv Ͱڥ͕ด͍ͯ͡ΔͷͰGlobalʹӨڹ͠ͳ͍ • PyPI - the Python Package Index : Python Package Index
؆୯ͳWebΞϓϦ from flask import Flask app = Flask(__name__) @app.route("/") def
hello(): return "Hello world!" if __name__ == "__main__": app.run()
Pythonͷಛ • ಈతܕ͚ݴޠ • Indented Block • ܭࢉͷϥΠϒϥϦ๛
࠷ۙͷPython • ඇಉظॲཧʹରԠ async/await • จࣈྻͷf-string • type hinting
ύοέʔδ • module = file • mod1.py • package =
directory • mod2/init.py
࣮ߦ python mod1.py python mod2 • mod2/main.py