CASIO fx-CG50 Micro Python Reference

CASIO fx-CG50 Micro Python 環境で使用できるモジュールのリファレンスです。

[SHIFT] – [4] (CATALOG)で確認できた内容と、実際にコードを組んだ結果確認できたモノを記載しています。
今後追加していく予定です。

CASIO fx-CG50 搭載の 元となった Micro Python のリファレンスは、以下のページを参照ください。

CASIO fx-CG50 の Python ページ(日本語)は、以下のページを参照ください。

最新のファームウェア(2022年3月 3.6)で搭載されている 機能なども確認できます。

データ型

オブジェクト データ種類
数値型 int 整数
数値型 float 浮動小数点
数値型 complex 複素数
シーケンス型 シーケンス型 str | 文字列
シーケンス型 list リスト:[]
シーケンス型 taple タプル:()
シーケンス型 range range
マッピング型 マッピング型 dict | 辞書:{key,value}
集合型 集合型 set | 集合:{}

標準組み込み (built-in)

ステートメント

項目 内容
数値演算 +, -, *, /, **, %, //
比較演算 <, >, <=, >=, ==, !=, is, is not, in, not in
帰属検査 in, not in
ブール演算 and, or, not
ビット演算 &, |, ^, ~, >>, <<
代入 =
累積代入演算 +=, -=, *=, /=, //=, %=, >>=, <<=, &=, ^=, |=
定数 True, False, None, Ellipsis
コメント #, “”, “””
制御 if,elif,else
for, in (object), in range()
else, break, continue, pass
while, else, break, continue, pass
関数定義 def, return, yeild, global, local
ラムダ関数 lambda
例外処理 try, exept, else, finally, raise, as, BaseException, Exception, KeyboardInterrupt, StopIteration, SystemExit
デバッグ assert, AssertionError
モジュール呼出 import, from, as
クラス定義 class, with, as, classmethod(), staticmethod(), object

標準組み込み関数

項目 内容
入力 input()
出力 print()
実行 eval(), exec()
高階関数 map()
シンボルテーブル取得 globals(), locals()
クラス・オブジェクト callable(), dir(), getattr, hasattr(), hash(),
id(), isinstance(), issubclass(), iter(), next(), repr(),setattr(), super(), type()
数値の変換 abs(), bin(), divmod(), float(), int(), hex(), oct(), pow(), round(), complex(), .imag, .real
数値と文字列変換 bool(), chr(), int(), ord(), float()

シーケンス型 関数

項目 内容
シーケンス型 共通 +, *, all(), any(), .index(), .count(), len, min(), map(), max(), sum(), zip()
リスト型と辞書型 *=, .append(), .clear(), .copy(), del, .extend(), .insert(), .pop(), .remove(), .reverse()
リスト型 [ ], list(), .sort(), sorted()
タプル型 ( ), tupple()
文字列とバイナリ .endswith(), .find(), .isalpha(), .isdigit, .islowr(), .isspace(), .isupper(),
.join(), .lower(), .lstrip(), .replace(), .rfind(), .rindex(), .rsplit(), .rstrip(), .startswith(), .split(), .strip(), upper()
文字列 f”, f””, str(), eval(), format()
バイナリー b”, b””, bytes(), .from_bytes(), .to_bytes()
range range(), slice()

辞書型 関数

項目 内容
辞書型 { } , set(), .clear(), .copy(),
.difference(), .difference_update(), .discard(),
.fromkeys(), .get(), .items(), .intersection(), .intersection_update(), .keys(),
.pop(), .popitem(), .remove(), .setdefault(), .symmetric_defference(), .symmetric_defference_update(),
.union(), .update()

組み込みモジュール

math モジュール関数

項目 内容
三角関数 acos(), asin(), atan(), atan2(), cos(), sin(), tan(), pi
指数/対数 e, exp(), frexp(), idexp(), log(), log10(), pow()
双曲線関数 cosh(), sinh(), tanh()
小数点の切り上げと切り捨て celi(), floor()
絶対値 fabs()
剰余計算 fmod()
整数部と小数部の取得 modf()
平方根 sqrt()

random モジュール関数

項目 内容
乱数の発生 getrandbits() randrange(), randint(), random(), uniform()
ランダムに選択 choice()
乱数の初期化 seed()

casioplot モジュール関数

項目 内容
画面の消去 clear_screen()
VRAMへ出力 draw_string(), set_pixel()
ピクセルの色取得 get_pixel()
VRAMから画面へ転送 show_screen()

更新履歴

2022/03/29 初版
CATALOGのリストをカテゴリ分けにして記述(詳細割愛)
Translate »