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 と私の事情
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
tsuda.a
December 06, 2015
Programming
0
36
Python と私の事情
PYCON mini 広島、で時間調整用に必要かもしれないかと思って作ってたスライドを放出
tsuda.a
December 06, 2015
Tweet
Share
More Decks by tsuda.a
See All by tsuda.a
マジカルインクリメントと指数表記
tsudaahr
0
220
バックアップしていますか?
tsudaahr
0
130
RDB以前のファイル設計の話でもしようか(ぇ
tsudaahr
0
140
NPUわからん
tsudaahr
0
190
計算量オーダーの話
tsudaahr
1
420
クラウド初学者が抱える不安について
tsudaahr
0
300
キューとは何か
tsudaahr
0
260
等幅は死んだ(ぇ
tsudaahr
0
110
いくら眺めてもエラーの理由がわからないコードについて
tsudaahr
0
200
Other Decks in Programming
See All in Programming
Fluid Templating in TYPO3 14
s2b
0
130
CSC307 Lecture 08
javiergs
PRO
0
670
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
560
組織で育むオブザーバビリティ
ryota_hnk
0
170
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
730
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
570
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
Apache Iceberg V3 and migration to V3
tomtanaka
0
160
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
CSC307 Lecture 05
javiergs
PRO
0
500
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
96
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
64
Ruling the World: When Life Gets Gamed
codingconduct
0
140
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Automating Front-end Workflow
addyosmani
1371
200k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.5k
We Have a Design System, Now What?
morganepeng
54
8k
Writing Fast Ruby
sferik
630
62k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
54
Transcript
Python と私の事情 @tsuda_ahr LTDD #21
準備) Python の実行環境の作り方 (Windows) • Windows はデフォルトでは Python は入っておりませんので。
Python Download で検索
Windows x86-64 embeddable zip file をダウンロードする このあたりまで スクロール
あとは • 適当なところに、ダウンロードした zip を展開。 • zip 展開したフォルダで python と入力すると
CLI が動作する。 • ファイル名指定の場合は、python hoge.py のような感じで。 • アンインストールは当該フォルダを削除すればOK。
本題
1.インデントを強制される処理系は嫌い
例1 a = 10 if 5 < a < 15:
if a < 10: print("a") else : print("b") else: print("c")
正常に実行される C>python test.py b
例2 a = 10 if 5 < a < 15:
if a < 10: print("a") else : print("b") else: print("c")
なぜかエラー C>python test.py File "test.py", line 4 print("a") ^ TabError:
inconsistent use of tabs and spaces in indentation
見た目は同じなんである a = 10 if 5 < a < 15:
if a < 10: print("a") else : print("b") else: print("c") a = 10 if 5 < a < 15: if a < 10: print("a") else : print("b") else: print("c")
比較 a = 10 if 5 < a < 15:
if a < 10: print("a") else : print("b") else: print("c") a = 10 if 5 < a < 15: if a < 10: print("a") else : print("b") else: print("c")
スペースとタブを可視化するとこうなる a = 10 if 5 < a < 15:
▯▯▯▯▯▯▯▯if a < 10: ▯▯▯▯▯▯▯▯▯▯▯▯▯▯▯▯print("a") ▯▯▯▯▯▯▯▯else : ▯▯▯▯▯▯▯▯▯▯▯▯▯▯▯▯print("b") else: > print("c") a = 10 if 5 < a < 15: ▯▯▯▯▯▯▯▯if a < 10: > > print("a") > else : > > print("b") else: > print("c") 凡例 ▯ スペース > タブ
こんなツイートを発見。
次
2.この if 文は面白いけど規格外すぎてちよっと…
なんと他の言語で失敗する、初学者にありがちな構文が正常に通る! a = 10 if 5 < a < 15:
print("a")
すげえ
しかしさすがにこれはダメ(汗 a = 10 if a == 1 or 2:
print("a")
こちらからは以上です ご清聴ありがとうございました