Pythonでpeeweeを使用してDBを作成し複数のテーブルにデータを挿入し取得してみます。 今回はpeeweeを用います。このライブラリ・モジュールはPythonの標準ライブラリではありませんので事前にインストールする必要があります。 ■Python 今回のPythonのバージョンは、「3.8.5」を使用しています。(Windows11) ■peeweeを使用してDBを作成し複数のテーブルにデータを挿入し取得する では、早速Pythonでpeeweeを使用してDBを作成し複数のテーブルにデータを挿入し取得するスクリプトを書いていきます。 ■コード from peewee import * db = SqliteDatabase(':memory:') class Person(Model): name = CharField() age = IntegerField() class M
![Pythonでpeeweeを使用してDBを作成し複数のテーブルにデータを挿入し取得する](https://cdn-ak-scissors.b.st-hatena.com/image/square/b0e6c97966e87a40b9ffc727d8131acbff631a61/height=288;version=1;width=512/https%3A%2F%2Flaboratory.kazuuu.net%2Fwp-content%2Fuploads%2F2021%2F07%2FL.png)