You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Defining the role of text in code Text data drives interaction in many programs. Names, messages, configuration details and more rely on strings. In Python, a string is a sequence of characters enclosed by quotes. … Making code execution straightforward Running a Python file directly in the terminal turns code into action. Instead of opening an editor and clicking run buttons, typing a command exe
みんな、Excel使ってますか!?もちろん使ってますね!?休暇届も、作業日報も、見積書も、スケジュール表も、みーんなExcelですね!? もちろん、プログラミングだってExcelですね!? 当然です!みんなそうやって仕事してるんです! Excel版のTwitter公式クライアントはまだリリースされないんでしょうか!? だけど、Excelでコーディングしてると、ときどきちょっとだけ不便に感じることがありますね!いちいちテキストファイルに落としてから実行しなければならないからです!テキストファイルなんて低級なフォーマットには関わりたくないですね! でもPythonなら!Pythonなら大丈夫!Pythonなら直接Excelファイルを実行できます!Pythonにはパッケージの配布フォーマットとしてeggという形式が普及していますが、eggはもう古いですね! これからはxls形式を使いましょう!x
Pythonでは、ループ・try・withブロックは最大20までしかネストできない。 >>> def spam(): ... while 1: ... while 2: ... while 3: ... while 4: ... while 5: ... while 6: ... while 7: ... while 8: ... while 9: ... while 10: ... while 11: ... while 12: ... while 13: ... while 14: ... while 15: ... while 16: ... while 17: ... while 18: ... while 19: ... while 20: ... while 21: ... print "Deep!" ... SystemError: too many statically n
id:moriyoshi が php-in-python を作ったらしいので使ってみました。 moriyoshi / php-in-python — Bitbucket django経由でphpinfoを表示させようと思ったけど、CLI版のせいかテキスト表示であんまり面白く無いので、CakePHPを動かしてみました。 settings.pyのTEMPLATE_DIRSを設定しておいて、urls.pyを次のように書きました。 from django.conf.urls.defaults import * from django.conf import settings urlpatterns = patterns('', (r'^(?P<path>(js|css|img|file)/.*)$', 'django.views.static.serve', {'document_root': s
こんにちわ、あらびきプログラマー moriyoshi です。 Python が生理的に嫌いな人からよく聞く話として「インデントでブロック構造を表す」ってのがありますね。じゃあ中身はそのままで文法だけ Ruby っぽくしたらどうなるんでしょうかね。Python はトークナイザもパーサも簡単に書き換えられるので、試してみましょう。 例えば次のようなプログラムは class Boo(object): def foo(hoge): try: for i in hoge: with i: if i.fuga: while True: j = i.fuga() if not j: break print j + 2 except HogeException: pass else: pass finally: pass こんな風になってしまうわけです。ああ怖いですね。 class Boo(object)
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く