1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

話題の TkEasyGUI を試してみました。

「PySimpleGUI を使ってみる」
https://qiita.com/nanbuwks/items/396e33f82f1ab8702560
で試したサンプルプログラムを動かしてみました。

環境

  • Debian Testing (2024/7/6時点のDebian 13)
  • python 3.11.9
  • PySimpleGUi 5.0.6

事前準備

# apt install python3-pip
# apt install python3-tk

TkEasyGUI インストール

今回もシステムにインストール。


# pip install --break-system-package  TkEasyGUI

サンプルプログラム

こちらにあるサンプルプログラムの1行目を変更して動かしてみます。
https://www.pysimplegui.com/

# import PySimpleGUI as sg
import TkEasyGUI as sg

# All the stuff inside your window.
layout = [  [sg.Text("What's your name?")],
            [sg.InputText()],
            [sg.Button('Ok'), sg.Button('Cancel')] ]

# Create the Window
window = sg.Window('Hello Example', layout)

# Event Loop to process "events" and get the "values" of the inputs
while True:
    event, values = window.read()

    # if user closes window or clicks cancel
    if event == sg.WIN_CLOSED or event == 'Cancel':
        break

    print('Hello', values[0], '!')

window.close()

うまく実行できました。

image.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?