python

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
python [2019/03/25 11:49] – [端末出力文字列に色を付ける] mumeiyamibitopython [2020/05/07 11:42] (現在) – [インストール] mumeiyamibito
行 9: 行 9:
     * 対話的にプログラムができる (命令文のテストなどちょっと試したい時に最適)     * 対話的にプログラムができる (命令文のテストなどちょっと試したい時に最適)
     * その他、便利な特徴: [[http://webtech-walker.com/archive/2010/10/13191417.html | Python初心者によるPythonのいいところ、はまりどころのまとめ - Webtech Walker]]     * その他、便利な特徴: [[http://webtech-walker.com/archive/2010/10/13191417.html | Python初心者によるPythonのいいところ、はまりどころのまとめ - Webtech Walker]]
 +
 +===== インストール =====
 +  * [[Python/anyenv を用いた Python のインストール方法]]
  
 ===== 構文 ===== ===== 構文 =====
行 282: 行 285:
 text = "abcdefg" text = "abcdefg"
 list(text) list(text)
--> ['a', 'b', 'c', 'd', 'e', 'f', 'g']+-> ['a', 'b', 'c', 'd', 'e', 'f', 'g']
 </code> </code>
 +  * 参考サイト: [[http://nfnoface.hatenablog.com/entry/2016/10/05/131600 | Pythonで文字列を1文字ずつ分割する - Webプログラムの技術メモ他]]
 +
 +==== 定義済みのユーザ関数名の一覧を表示する ====
 +  * 関数が定義済みかどうかを調べる時に使う (モジュールなどの外部のプログラムを使う時にどうぞ)。\\ <code python>
 +import types
 +print([f.__name__ for f in globals().values() if type(f) == types.FunctionType])
 +</code>
 +  * 参考サイト: [[https://stackoverflow.com/questions/6315496/display-a-list-of-user-defined-functions-in-the-python-idle-session | Display a list of user defined functions in the Python IDLE session - Stack Overflow]]
 +
  
  
 {{tag>プログラミング}} {{tag>プログラミング}}
  
  • python.1553482170.txt.gz
  • 最終更新: 2019/03/25 11:49
  • by mumeiyamibito