Pythonでデスクトップアプリを作る方法

Python

本記事ではPythonでデスクトップアプリを作る方法を解説します。

tkinterを使う方法

一つ目はtkinterです。tkinterはPythonの標準ライブラリ
ライブラリを新たにインストールする必要がないので、小規模のデスクトップアプリを作成したい場合には向いています

tkinter --- Tcl/Tk の Python インターフェース
ソースコード: Lib/tkinter/__init__.py tkinter パッケージ ("Tk インターフェース") は、 Tcl/Tk GUI ツールキットに対する標準の Python インターフェースです。 Tk と tkinter...

PySimpleGUIを使う方法

二つ目は、PySimpleGUIです。

The Project - PySimpleGUI Documentation

PySimpleGUIを使うことで、シンプルかつ短いコードで実装を行うことができます。

Your PySimpleGUI code is simpler and shorter than writing directly using the underlying framework because PySimpleGUI implements much of the “boilerplate code” for you. 

https://www.pysimplegui.org/en/latest/readme/#what-is-pysimplegui

通常の二分の一から十分の一のコード量で実装が可能になります。

a PySimpleGUI program may require 1/2 to 1/10th amount of code to create an identical window using one of the frameworks directly.

https://www.pysimplegui.org/en/latest/readme/#what-is-pysimplegui

PyQtを使う方法

三つめはPyQtです。

Riverbank Computing | Introduction

PyQtはtkinterよりも豊富な機能を揃えていることがメリットです。
しかし、PyQtは場合によっては商用ライセンスが必要となることがありますので、注意が必要です。

If your license is incompatible with the GPL then you need a commercial PyQt license.

https://riverbankcomputing.com/commercial/license-faq

Kivyを使う方法

四つ目はKivyです。

Kivy: Cross-platform Python Framework for NUI
Open source Python framework for rapid development of applications that make use of innovative user interfaces, such as m...

Kivyはクロスプラットフォームなので、WindowsLinuxmacOSiOS, Androidのプラットフォームに対応しております。

With a single codebase, you will be able to deploy apps on WindowsLinuxmacOSiOS and Android.

https://kivy.org/

fletを使う方法

五つ目はfletです。

Build multi-platform apps in Python powered by Flutter | Flet
Build multi-platform apps in Python powered by Flutter.

fletもkivyと同様にWindows、macOS、Linux、iOS、Androidに対応しております。

Deploy Flet app as a web app and view it in a browser. Package it as a standalone desktop app for Windows, macOS and Linux. Install it on mobile as PWA or view via Flet app for iOS and Android.

https://flet.dev/

また、fletはFlutterによって作成されているので、見た目もGoogleが推奨するマテリアルデザインになっており、見栄えがとても良いです。

Flet UI is built with Flutter, so your app looks professional and can be delivered to any platform.

https://flet.dev/

まとめ

初心者にはtkinterがオススメです。

tkinterよりも機能が豊富な方がよければPyQtコードをシンプルにしたいのであればPySimpleGUIがオススメです。

また、クロスプラットフォームが必要ならばKivyやfletがオススメです。

Pythonには、デスクトップアプリを作る方法がたくさんありますが、自分に合ったものを選びましょう!

楽天ブックス
¥3,960 (2025/07/10 10:02時点 | 楽天市場調べ)
\楽天ポイント4倍セール!/
楽天市場
タイトルとURLをコピーしました