26. Pythonでの例 from __future__ import print_function one = lambda: 1 two = lambda: 2 to_list = lambda *fs: [f() for f in fs] do = lambda *args: args[0](*args[1:]) do(print, do(sum, do(to_list, one, two)))
「その1」のまとめ ⇒Python で日本語を扱う基本をまとめてみるメモ(その1) - 猫(=・ω・=)顔 1.0β 1行めか2行めで # coding: 〜 を指定する。 '' は通常の文字列。保存した形式のままの「バイト列」。 u'' は Unicode 文字列。多バイト文字環境で1文字を1文字として扱うために必要。 通常の文字列から Unicode 文字列への変換は unicode() 関数を使う。 今日のお題 unicode() 関数をもうちょっと探る Unicode 文字列を作る別の方法 文字コードの変換方法 (1) Unicode 文字列から任意の encoding へ 文字コードの変換方法 (2) encoding-A から encoding-B へ unicode() 関数をもうちょっと探る 前回のおさらい。 以下、通常の文字列(バイト列)は、メンドクサイから全部 euc-
スクリプト言語用のデバッガの使い方 - Ruby, Python, Perl スクリプト言語用の CUIのデバッガの使い方を簡単にまとめました。対象言語は Ruby, Python, Perl です。 私は C, C++ でプログラムを書いているときはデバッガ (主に GNU/Linux 上の gdb) を頻繁に利用します。しかし、スクリプト言語ではそれほどでもありません。これはおそらく次のような理由によります。 ビルドが不要なので printf デバッグが容易 (ある程度大きい C++ のプログラムではビルド時間が長いので printf の挿入はしんどい) 異常終了時にスタックトレースが表示される (Ruby, Python なら自動、Perl の場合は use Carp; $SIG{__DIE__} = \&Carp::confess; など) オブジェクトのインスペクトが簡単 (Ru
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く