-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic tkinter app and run it on GitHub Actions CI.
The app closes itself after 5 seconds.
- Loading branch information
1 parent
5745452
commit a216015
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Test Python Tk | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests-poetry: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] | ||
fail-fast: false | ||
name: Py ${{ matrix.python-version }} - ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Prepare Ubuntu xvfb | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libxkbcommon-x11-0 xvfb | ||
- name: Run tk script (closes itself after 5 seconds) - Ubuntu | ||
if: runner.os == 'Linux' | ||
run: xvfb-run python tk_min.py | ||
- name: Run tk script (closes itself after 5 seconds) | ||
if: runner.os != 'Linux' | ||
run: python tk_min.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Simple Hello World! Tkinter GUI app that closes itself after 5 seconds. | ||
""" | ||
import tkinter as tk | ||
|
||
|
||
root = tk.Tk() | ||
|
||
label = tk.Label(root, text="Hello World!") | ||
label.pack(padx=20, pady=20) | ||
|
||
# Close the Window after 5 seconds | ||
root.after(5000, root.destroy) | ||
|
||
root.mainloop() |