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
19
Python と私の事情
PYCON mini 広島、で時間調整用に必要かもしれないかと思って作ってたスライドを放出
tsuda.a
December 06, 2015
Tweet
Share
More Decks by tsuda.a
See All by tsuda.a
クラウド初学者が抱える不安について
tsudaahr
0
40
キューとは何か
tsudaahr
0
99
等幅は死んだ(ぇ
tsudaahr
0
20
いくら眺めてもエラーの理由がわからないコードについて
tsudaahr
0
52
何のために文字数をカウントするのか?
tsudaahr
0
17
文字 is 何?
tsudaahr
0
46
16進数は何型
tsudaahr
0
2
全銀トラブルとC言語とバッファオーバーフロー
tsudaahr
0
19
ライトワンスは改ざん防止の夢を見るか?
tsudaahr
0
5
Other Decks in Programming
See All in Programming
Introducing Kotlin Multiplatform in an existing mobile app - Workshop Edition | AndroidMakers Paris
prof18
0
170
FoodGram
iseruuuuu
0
230
Apache Hive 4 on Treasure Data
ryukobayashi
1
470
Compose-View Interop in Practice (mDevCamp 2024)
stewemetal
0
180
CREってこういうこと? 体験入社 - 提案資料 - / what-is-cre-trial-employment
shinden
1
610
WebGLで始める コンピュータグラフィックス入門
heller77
0
370
slow types ってなんだろう?
karad
0
210
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
12
4.3k
AppRouter Panel Talk
yosuke_furukawa
PRO
1
520
Open standards for building event-driven applications in the cloud
meteatamel
0
210
RailsConf 2024: Riffing on Rails: sketch your way to better designed code
kaspth
0
200
Revisiting the Hotwire Landscape after Turbo 8 @ RailsConf 2024, Detroit
marcoroth
3
590
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
165
13k
GraphQLの誤解/rethinking-graphql
sonatard
56
9.3k
Art, The Web, and Tiny UX
lynnandtonic
290
19k
Product Roadmaps are Hard
iamctodd
45
9.8k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
Git: the NoSQL Database
bkeepers
PRO
423
63k
Bash Introduction
62gerente
605
210k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
What's new in Ruby 2.0
geeforr
338
31k
Build your cross-platform service in a week with App Engine
jlugia
226
17k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
Statistics for Hackers
jakevdp
790
220k
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")
こちらからは以上です ご清聴ありがとうございました