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
tsuda.a
December 06, 2015
Programming
0
34
Python と私の事情
PYCON mini 広島、で時間調整用に必要かもしれないかと思って作ってたスライドを放出
tsuda.a
December 06, 2015
Tweet
Share
More Decks by tsuda.a
See All by tsuda.a
マジカルインクリメントと指数表記
tsudaahr
0
160
バックアップしていますか?
tsudaahr
0
110
RDB以前のファイル設計の話でもしようか(ぇ
tsudaahr
0
120
NPUわからん
tsudaahr
0
170
計算量オーダーの話
tsudaahr
1
370
クラウド初学者が抱える不安について
tsudaahr
0
240
キューとは何か
tsudaahr
0
210
等幅は死んだ(ぇ
tsudaahr
0
86
いくら眺めてもエラーの理由がわからないコードについて
tsudaahr
0
170
Other Decks in Programming
See All in Programming
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
280
XP, Testing and ninja testing
m_seki
3
240
Quand Symfony, ApiPlatform, OpenAI et LangChain s'allient pour exploiter vos PDF : de la théorie à la production…
ahmedbhs123
0
190
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
530
“いい感じ“な定量評価を求めて - Four Keysとアウトカムの間の探求 -
nealle
1
10k
今ならAmazon ECSのサービス間通信をどう選ぶか / Selection of ECS Interservice Communication 2025
tkikuc
21
4k
Discover Metal 4
rei315
2
130
MDN Web Docs に日本語翻訳でコントリビュートしたくなる
ohmori_yusuke
1
120
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
770
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
650
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
1
570
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
700
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
72
4.9k
GraphQLとの向き合い方2022年版
quramy
49
14k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
Making Projects Easy
brettharned
116
6.3k
Visualization
eitanlees
146
16k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Designing for humans not robots
tammielis
253
25k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Music & Morning Musume
bryan
46
6.6k
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")
こちらからは以上です ご清聴ありがとうございました