Python

「Python」の編集履歴(バックアップ)一覧に戻る

Python - (2011/03/15 (火) 17:18:46) のソース

* python の勉強メモ

** 全体
- ソースコード内に全角文字を入れるとき
-- コード内に全角文字を入れるときはコードの頭を以下みたくする。(UTF8の場合)
 #!/usr/bin/env python
 # -*- coding: utf8 -*-
 
 ちなみに入れないとこんな風になる
 sys:1: DeprecationWarning: Non-ASCII character '\xef' in file dic-api-report.py on line 40,
 but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

** 基本
- if文の作り方
 if a == b:
   # 処理
 elif c == d:
   # 処理
 else:
   # 処理

** 文字列

** Dictionary
- Dictionaryに値を入れるときは、こんな感じ。
 map = {}
 map["key"] = "value"