...the data set includes 3,468 responses.
See this survey on the official website.
Python tutorials with source code, examples, guides, and tips and tricks for Windows and Linux development.




import tkinter as tk
from tkinter import colorchooser
def choose_color():
# Opens the color picker dialog and returns a tuple: ((R, G, B), "#HEX")
color = colorchooser.askcolor(title="Choose a Background Color")
# Check if the user selected a color (didn't click Cancel)
if color[1]:
hex_code = color[1]
root.config(bg=hex_code)
label_color.config(text=f"HEX Code: {hex_code}", bg=hex_code)
# Create the main window
root = tk.Tk()
root.title("Tkinter Colorchooser Example")
root.geometry("300x200")
# Button to trigger the color chooser dialog
btn_choose = tk.Button(root, text="Select Color", command=choose_color)
btn_choose.pack(pady=30)
# Label to display the chosen HEX code
label_color = tk.Label(root, text="No color selected", font=("Arial", 12))
label_color.pack(pady=10)
root.mainloop()
import html
import tkinter as tk
from tkinter import ttk, messagebox
def paste_from_clipboard():
try:
text_input.insert(tk.INSERT, root.clipboard_get())
except Exception:
try:
text_input.focus_set()
text_input.event_generate("<<Paste>>")
except Exception:
pass
def process_code():
raw_code = text_input.get("1.0", tk.END).strip()
if not raw_code:
return
try:
# 1. Escapam caracterele speciale HTML (<, >, &, ")
escaped_code = html.escape(raw_code)
# 2. Includem codul convertit in structura div -> pre -> code
formatted_result = f"<div><pre><code>{escaped_code}</code></pre></div>"
# 3. Afisam rezultatul
text_output.config(state=tk.NORMAL)
text_output.delete("1.0", tk.END)
text_output.insert(tk.END, formatted_result)
text_output.config(state=tk.DISABLED)
except Exception as e:
messagebox.showerror("Eroare", f"A aparut o eroare la conversie: {e}")
def copy_to_clipboard():
cleaned_text = text_output.get("1.0", tk.END).strip()
if cleaned_text:
try:
root.clipboard_clear()
root.clipboard_append(cleaned_text)
messagebox.showinfo("OK", "Copiat in clipboard!")
except Exception as e:
messagebox.showerror("Eroare", f"Nu s-a putut copia: {e}")
def clear_all():
text_input.delete("1.0", tk.END)
text_output.config(state=tk.NORMAL)
text_output.delete("1.0", tk.END)
text_output.config(state=tk.DISABLED)
# Constructie Interfata
root = tk.Tk()
root.title("Code Escaper for Blogger")
root.geometry("400x600")
# Input
lbl1 = ttk.Label(root, text="1. Cod Sursa de Convertit:")
lbl1.pack(anchor="w", padx=10, pady=(10, 0))
frame_btns = ttk.Frame(root)
frame_btns.pack(fill=tk.X, padx=10, pady=5)
btn_paste = ttk.Button(frame_btns, text="Lipeste (Paste)", command=paste_from_clipboard)
btn_paste.pack(side=tk.LEFT, fill=tk.X, expand=True, padx=(0, 5))
btn_clear = ttk.Button(frame_btns, text="Sterge", command=clear_all)
btn_clear.pack(side=tk.RIGHT)
text_input = tk.Text(root, height=8)
text_input.pack(fill=tk.BOTH, expand=True, padx=10, pady=5)
# Procesare
btn_process = ttk.Button(root, text="Converteste pentru Blogger", command=process_code)
btn_process.pack(fill=tk.X, padx=10, pady=5)
# Output
lbl2 = ttk.Label(root, text="2. Rezultat de pus in Blogger:")
lbl2.pack(anchor="w", padx=10, pady=(5, 0))
text_output = tk.Text(root, height=8, state=tk.DISABLED)
text_output.pack(fill=tk.BOTH, expand=True, padx=10, pady=5)
btn_copy = ttk.Button(root, text="Copiaza Rezultatul", command=copy_to_clipboard)
btn_copy.pack(fill=tk.X, padx=10, pady=(5, 10))
root.mainloop()
import tkinter as tk
from tkinter import ttk, messagebox
from bs4 import BeautifulSoup
def paste_from_clipboard():
try:
text_input.insert(tk.INSERT, root.clipboard_get())
except Exception:
try:
text_input.focus_set()
text_input.event_generate("<<Paste>>")
except Exception:
pass
def process_html():
raw_html = text_input.get("1.0", tk.END).strip()
if not raw_html:
return
try:
soup = BeautifulSoup(raw_html, "html.parser")
# 1. Eliminare completă tag-uri style și script
for tag in soup.find_all(["style", "script"]):
tag.decompose()
# 2. Eliminare ancore (<a>) și păstrare conținut
for a_tag in soup.find_all("a"):
a_tag.unwrap()
# 3. Eliminare atribute 'style' și 'class' de pe TOATE elementele
attributes_to_remove = ["style", "class"]
for tag in soup.find_all(True):
for attr in attributes_to_remove:
if attr in tag.attrs:
del tag.attrs[attr]
cleaned_html = str(soup)
text_output.config(state=tk.NORMAL)
text_output.delete("1.0", tk.END)
text_output.insert(tk.END, cleaned_html)
text_output.config(state=tk.DISABLED)
except Exception as e:
messagebox.showerror("Eroare", f"A aparut o eroare la procesare: {e}")
def copy_to_clipboard():
cleaned_text = text_output.get("1.0", tk.END).strip()
if cleaned_text:
try:
root.clipboard_clear()
root.clipboard_append(cleaned_text)
messagebox.showinfo("OK", "Copiat in clipboard!")
except Exception as e:
messagebox.showerror("Eroare", f"Nu s-a putut copia: {e}")
def clear_all():
text_input.delete("1.0", tk.END)
text_output.config(state=tk.NORMAL)
text_output.delete("1.0", tk.END)
text_output.config(state=tk.DISABLED)
# Constructie Interfata
root = tk.Tk()
root.title("HTML Cleaner")
root.geometry("400x600")
# Input
lbl1 = ttk.Label(root, text="1. Sursa HTML:")
lbl1.pack(anchor="w", padx=10, pady=(10, 0))
frame_btns = ttk.Frame(root)
frame_btns.pack(fill=tk.X, padx=10, pady=5)
btn_paste = ttk.Button(frame_btns, text="Lipeste (Paste)", command=paste_from_clipboard)
btn_paste.pack(side=tk.LEFT, fill=tk.X, expand=True, padx=(0, 5))
btn_clear = ttk.Button(frame_btns, text="Sterge", command=clear_all)
btn_clear.pack(side=tk.RIGHT)
text_input = tk.Text(root, height=8)
text_input.pack(fill=tk.BOTH, expand=True, padx=10, pady=5)
# Procesare
btn_process = ttk.Button(root, text="Proceseaza HTML", command=process_html)
btn_process.pack(fill=tk.X, padx=10, pady=5)
# Output
lbl2 = ttk.Label(root, text="2. Rezultat Curatat:")
lbl2.pack(anchor="w", padx=10, pady=(5, 0))
text_output = tk.Text(root, height=8, state=tk.DISABLED)
text_output.pack(fill=tk.BOTH, expand=True, padx=10, pady=5)
btn_copy = ttk.Button(root, text="Copiaza Rezultatul", command=copy_to_clipboard)
btn_copy.pack(fill=tk.X, padx=10, pady=(5, 10))
root.mainloop()
import tkinter as tk
from tkinter import scrolledtext, messagebox, ttk
import os
# Possible paths for Acode.log (paid + free version)
POSSIBLE_PATHS = [
"/storage/emulated/0/Android/data/com.foxdebug.acode/files/Acode.log",
"/storage/emulated/0/Android/data/com.foxdebug.acode.free/files/Acode.log",
"/storage/emulated/0/Android/data/com.foxdebug.acode/files/logs/Acode.log",
"/storage/emulated/0/Android/data/com.foxdebug.acode.free/files/logs/Acode.log",
"/sdcard/Android/data/com.foxdebug.acode/files/Acode.log",
"/sdcard/Android/data/com.foxdebug.acode.free/files/Acode.log",
]
class AcodeLogViewer:
def __init__(self, root):
self.root = root
self.root.title("Acode.log Viewer - Pydroid 3")
self.root.geometry("900x650")
self.root.minsize(600, 400)
self.found_path = None
self.file_content = ""
self.create_menu()
self.create_widgets()
self.search_and_load()
def create_menu(self):
"""Create the main application menu."""
menubar = tk.Menu(self.root)
self.root.config(menu=menubar)
# File menu
file_menu = tk.Menu(menubar, tearoff=0)
menubar.add_cascade(label="File", menu=file_menu)
file_menu.add_command(label="Reload", command=self.search_and_load, accelerator="Ctrl+R")
file_menu.add_command(label="Copy All", command=self.copy_to_clipboard, accelerator="Ctrl+C")
file_menu.add_separator()
file_menu.add_command(label="Exit", command=self.root.quit, accelerator="Ctrl+Q")
# Keyboard shortcuts
self.root.bind("", lambda e: self.search_and_load())
self.root.bind("", lambda e: self.copy_to_clipboard())
self.root.bind("", lambda e: self.root.quit())
def create_widgets(self):
# Text area with scrollbars
text_frame = ttk.Frame(self.root, padding=8)
text_frame.pack(fill=tk.BOTH, expand=True)
self.text_area = scrolledtext.ScrolledText(
text_frame,
wrap=tk.NONE,
font=("Courier New", 10),
state=tk.DISABLED
)
self.text_area.pack(fill=tk.BOTH, expand=True)
# Horizontal scrollbar
h_scroll = ttk.Scrollbar(text_frame, orient=tk.HORIZONTAL, command=self.text_area.xview)
h_scroll.pack(fill=tk.X)
self.text_area.configure(xscrollcommand=h_scroll.set)
# Status bar – displays the found file path
self.status_var = tk.StringVar(value="Ready.")
status_bar = ttk.Label(
self.root,
textvariable=self.status_var,
relief=tk.SUNKEN,
anchor=tk.W,
padding=(6, 3)
)
status_bar.pack(fill=tk.X, side=tk.BOTTOM)
def search_and_load(self):
self.found_path = None
self.file_content = ""
for path in POSSIBLE_PATHS:
if os.path.isfile(path):
self.found_path = path
break
if self.found_path is None:
self.status_var.set("Acode.log file not found in the known locations.")
self.display_text(
"The Acode.log file could not be located.\n\n"
"Please verify that the Acode application has already generated the log "
"and that Pydroid 3 has storage access permissions."
)
return
try:
with open(self.found_path, "r", encoding="utf-8", errors="replace") as f:
self.file_content = f.read()
size_kb = len(self.file_content.encode("utf-8")) / 1024
lines = len(self.file_content.splitlines())
# Full path + additional information in the status bar
self.status_var.set(
f"{self.found_path} • {size_kb:.1f} KB • {lines} lines"
)
self.display_text(self.file_content)
except Exception as e:
self.status_var.set(f"Error reading file: {self.found_path}")
self.display_text(f"Unable to read the file:\n{str(e)}")
def display_text(self, content):
self.text_area.config(state=tk.NORMAL)
self.text_area.delete("1.0", tk.END)
self.text_area.insert(tk.END, content)
self.text_area.config(state=tk.DISABLED)
self.text_area.see("1.0")
def copy_to_clipboard(self):
if not self.file_content:
messagebox.showwarning("Clipboard", "There is no content to copy.")
return
try:
self.root.clipboard_clear()
self.root.clipboard_append(self.file_content)
self.root.update()
self.status_var.set(f"Content copied • {self.found_path or 'N/A'}")
messagebox.showinfo("Clipboard", "The entire log content has been copied to the clipboard.")
except Exception as e:
messagebox.showerror("Clipboard Error", f"Unable to copy to clipboard:\n{str(e)}")
if __name__ == "__main__":
root = tk.Tk()
app = AcodeLogViewer(root)
root.mainloop() 
import tkinter as tk
from tkinter import messagebox, ttk
import webbrowser
import feedparser
RSS_URL = "https://blog.python.org/feeds/posts/default"
article_links = []
def clean_text(text):
"""Converts text to basic ASCII to strip non-supported Android Tkinter characters."""
if not text:
return ""
# Encodes to ASCII ignoring emojis, special quotes, and unsupported byte sequences
clean = text.encode("ascii", "ignore").decode("ascii")
# Removes extra whitespace and linebreaks
return " ".join(clean.split())
def load_feed():
global article_links
listbox.delete(0, tk.END)
article_links.clear()
status_label.config(text="Fetching articles...", foreground="blue")
root.update()
try:
feed = feedparser.parse(RSS_URL)
if not feed.entries:
status_label.config(text="No articles found.", foreground="red")
return
for entry in feed.entries:
title_raw = entry.get("title", "Untitled")
title = clean_text(title_raw)
link = entry.get("link", "")
listbox.insert(tk.END, title)
article_links.append(link)
status_label.config(
text=f"Loaded {len(feed.entries)} articles!", foreground="green"
)
except Exception as e:
status_label.config(text="Connection error!", foreground="red")
messagebox.showerror("Error", f"Failed to load feed:\n{e}")
def open_link(event):
try:
index = listbox.curselection()[0]
url = article_links[index]
if url:
webbrowser.open(url)
except IndexError:
pass
# --- GUI Setup ---
root = tk.Tk()
root.title("Python Foundation RSS Reader")
root.geometry("600x800")
title_label = ttk.Label(
root, text="Python Software Foundation Blog", font=("Helvetica", 14, "bold")
)
title_label.pack(pady=10)
refresh_btn = ttk.Button(root, text="Refresh", command=load_feed)
refresh_btn.pack(pady=5)
status_label = ttk.Label(
root, text="Connecting...", font=("Helvetica", 10)
)
status_label.pack(pady=5)
frame = ttk.Frame(root)
frame.pack(fill=tk.BOTH, expand=True, padx=10, pady=10)
scrollbar = ttk.Scrollbar(frame, orient=tk.VERTICAL)
listbox = tk.Listbox(
frame,
font=("Helvetica", 11),
selectbackground="#007ACC",
selectforeground="white",
activestyle="none",
yscrollcommand=scrollbar.set,
bd=1,
relief="solid",
)
scrollbar.config(command=listbox.yview)
scrollbar.pack(side=tk.RIGHT, fill=tk.Y)
listbox.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
listbox.bind("<>", open_link)
root.after(500, load_feed)
root.mainloop()

import os
import platform
import subprocess
import sys
import tkinter as tk
from tkinter import ttk
def get_android_prop(prop_name):
"""Citește o proprietate de sistem Android folosind comanda getprop."""
try:
val = (
subprocess.check_output(f"getprop {prop_name}", shell=True, text=True)
.strip()
)
return val if val else "N/A"
except Exception:
return "Indisponibil"
def get_system_info():
"""Colectează informații extinse despre telefon și modulul Tau."""
# 1. Verificare modul Tau
tau_info = "Neinstalat"
try:
import tau
tau_info = getattr(tau, "__version__", "Instalat (fără __version__)")
except ImportError:
tau_info = "Pachetul 'tau-ai' nu este instalat"
# 2. Preluare date extinse Android
model = get_android_prop("ro.product.model")
brand = get_android_prop("ro.product.brand")
manufacturer = get_android_prop("ro.product.manufacturer")
android_version = get_android_prop("ro.build.version.release")
sdk_version = get_android_prop("ro.build.version.sdk")
device_board = get_android_prop("ro.product.board")
hardware = get_android_prop("ro.hardware")
info = {
"Versiune Tau": tau_info,
"Producător": f"{manufacturer.capitalize()} ({brand.capitalize()})",
"Model Telefon": model,
"Versiune Android": f"Android {android_version} (API {sdk_version})",
"Placă / Hardware": f"{device_board} / {hardware}",
"Arhitectură CPU": platform.machine(),
"Sistem Python": f"{platform.system()} {platform.release()}",
"Versiune Python": sys.version.split()[0],
}
return info
def main():
root = tk.Tk()
root.title("Tau & Detalii Android")
root.geometry("420x560")
root.configure(bg="#212121")
title = tk.Label(
root,
text="Informații Dispozitiv & Tau",
font=("Helvetica", 15, "bold"),
fg="#00E676",
bg="#212121",
pady=12,
)
title.pack()
# Zonă de text pentru date
text_area = tk.Text(
root,
font=("Courier", 10),
bg="#303030",
fg="#FFFFFF",
padx=10,
pady=10,
relief=tk.FLAT,
)
text_area.pack(fill=tk.BOTH, expand=True, padx=15, pady=5)
# Inserare date în fereastră
info_data = get_system_info()
text_content = "=== SPECIFICAȚII TELEFON & APP ===\n\n"
for key, value in info_data.items():
text_content += f"• {key}:\n {value}\n\n"
text_area.insert(tk.END, text_content)
text_area.config(state=tk.DISABLED)
# Buton de închidere
btn_close = tk.Button(
root,
text="Închide",
font=("Helvetica", 11, "bold"),
bg="#FF5252",
fg="white",
activebackground="#FF1744",
activeforeground="white",
command=root.destroy,
pady=8,
)
btn_close.pack(fill=tk.X, padx=15, pady=15)
root.mainloop()
if __name__ == "__main__":
main()





import os
import matplotlib.pyplot as plt
import numpy as np
from datetime import datetime, timezone
def draw_and_save_sky_map():
# Coordonate Fălticeni, România
LAT = 47.46
LON = 26.30
# Calendarul evenimentelor până la sfârșitul anului 2026
events = [
{
'name': 'Perseide (Vârf)',
'date_str': '12 Aug',
'rise_time': '22:00',
'ra': 3.07, 'dec': 58.0,
'color': '#00ffcc', 'marker': '*'
},
{
'name': 'Orionide (Vârf)',
'date_str': '21 Oct',
'rise_time': '23:30',
'ra': 6.34, 'dec': 16.0,
'color': '#ff9900', 'marker': '*'
},
{
'name': 'Leonide (Vârf)',
'date_str': '17 Noi',
'rise_time': '00:15',
'ra': 10.2, 'dec': 22.0,
'color': '#ff3366', 'marker': '*'
},
{
'name': 'Geminide (Vârf)',
'date_str': '13 Dec',
'rise_time': '20:30',
'ra': 7.46, 'dec': 33.0,
'color': '#ffff00', 'marker': '*'
},
{
'name': 'Asteroid NEO 2026',
'date_str': 'Toamnă 2026',
'rise_time': '21:00',
'ra': 14.5, 'dec': 10.0,
'color': '#ff00ff', 'marker': 's'
}
]
# Calcul Timp Sidereal Local (LST)
now_utc = datetime.now(timezone.utc)
j2000_epoch = datetime(2000, 1, 1, 12, 0, 0, tzinfo=timezone.utc)
days_since_j2000 = (now_utc - j2000_epoch).total_seconds() / 86400.0
lst = (18.697374558 + 24.06570982441908 * days_since_j2000 + LON / 15.0) % 24
# Creare grafic Matplotlib (Polar)
fig = plt.figure(figsize=(8, 8), facecolor='#0b0d17')
ax = fig.add_subplot(111, polar=True, facecolor='#05070f')
# Orientare fixă: NORDUL SUS (0°)
ax.set_theta_zero_location('N')
ax.set_theta_direction(-1)
ax.set_rlim(0, 90)
ax.set_yticklabels([])
lat_rad = np.radians(LAT)
for item in events:
ha = (lst - item['ra']) * 15.0
ha_rad = np.radians(ha)
dec_rad = np.radians(item['dec'])
sin_alt = np.sin(dec_rad) * np.sin(lat_rad) + np.cos(dec_rad) * np.cos(lat_rad) * np.cos(ha_rad)
alt = np.degrees(np.arcsin(np.clip(sin_alt, -1.0, 1.0)))
if alt <= 5:
alt = 35.0
cos_az = (np.sin(dec_rad) - np.sin(lat_rad) * sin_alt) / (np.cos(lat_rad) * np.sin(np.arccos(sin_alt)))
az = np.degrees(np.arccos(np.clip(cos_az, -1.0, 1.0)))
if np.sin(ha_rad) > 0:
az = 360 - az
theta = np.radians(az)
r = 90 - alt
ax.plot(theta, r, marker=item['marker'], markersize=12, color=item['color'])
label_text = f"{item['name']}\n[{item['date_str']}]\nRăsare ~{item['rise_time']}"
ax.text(theta, r + 7, label_text, color=item['color'],
fontsize=7.5, ha='center', fontweight='bold')
cardinals = [('NORD (0°)', 0), ('EST (90°)', 90), ('SUD (180°)', 180), ('VEST (270°)', 270)]
for label, angle in cardinals:
ax.text(np.radians(angle), 102, label, color='white', fontsize=9, fontweight='bold', ha='center', va='center')
ax.set_title("HARTĂ EVENIMENTE ASTRONOMICE 2026 (Aug - Dec)\nLocație: Fălticeni | Orientare: Nordul Sus\n",
color='white', fontsize=9, pad=15)
ax.grid(color='#1a233a', linestyle=':', linewidth=0.8)
plt.tight_layout()
# --- SALVARE IMAGINE ÎN FOLDERUL DOWNLOAD ---
download_path = "/sdcard/Download"
# Alternativă în caz că calea /sdcard nu este mapată la fel pe unele versiuni de Android
if not os.path.exists(download_path):
download_path = os.path.expanduser("~/storage/downloads")
file_name = f"harta_astronomica_2026_{datetime.now().strftime('%Y%m%d_%H%M%S')}.png"
full_path = os.path.join(download_path, file_name)
try:
plt.savefig(full_path, dpi=300, facecolor=fig.get_facecolor(), edgecolor='none')
print(f" Imaginea a fost salvată cu succes la:\n{full_path}")
except Exception as e:
print(f" Eroare la salvarea fișierului: {e}")
plt.show()
if __name__ == "__main__":
draw_and_save_sky_map()
python -m pip install pyui
Collecting pyui
Downloading pyui-0.1.0-py3-none-any.whl.metadata (893 bytes)
Collecting PySDL2>=0.9.7 (from pyui)
Downloading PySDL2-0.9.17-py3-none-any.whl.metadata (3.8 kB)
Downloading pyui-0.1.0-py3-none-any.whl (6.0 MB)
---------------------------------------- 6.0/6.0 MB 6.0 MB/s 0:00:01
Downloading PySDL2-0.9.17-py3-none-any.whl (583 kB)
---------------------------------------- 583.1/583.1 kB 2.1 MB/s 0:00:00
Installing collected packages: PySDL2, pyui
Successfully installed PySDL2-0.9.17 pyui-0.1.0
python -m pip install pysdl2-dll
Collecting pysdl2-dll
Downloading pysdl2_dll-2.32.10-py2.py3-none-win_amd64.whl.metadata (4.7 kB)
Downloading pysdl2_dll-2.32.10-py2.py3-none-win_amd64.whl (4.1 MB)
---------------------------------------- 4.1/4.1 MB 4.1 MB/s 0:00:01
Installing collected packages: pysdl2-dll
Successfully installed pysdl2-dll-2.32.10
import pyui
class ItemGridView(pyui.View):
def content(self):
yield pyui.ScrollView(axis=self.axis)(
pyui.Grid(num=self.num, size=self.size, axis=self.axis, flex=self.flex)(
pyui.ForEach(
range(self.item_count),
lambda num: (
pyui.Rectangle()(pyui.Text(num + 1).color(255, 255, 255))
.background(120, 120, 120)
.radius(5)
.animate()
),
)
)
)
class GridTest(pyui.View):
axis = pyui.State(default=1)
item_count = pyui.State(int, default=50)
size = pyui.State(default=100)
num = pyui.State(default=4)
size_or_num = pyui.State(default=0)
flex = pyui.State(default=False)
def content(self):
if self.size_or_num.value == 0:
size = None
num = self.num.value
else:
size = self.size.value
num = None
yield pyui.HStack(alignment=pyui.Alignment.LEADING)(
pyui.VStack(alignment=pyui.Alignment.LEADING)(
pyui.Text("Axis"),
pyui.SegmentedButton(self.axis)(
pyui.Text(pyui.Axis.HORIZONTAL.name),
pyui.Text(pyui.Axis.VERTICAL.name),
),
pyui.HStack(
pyui.Text("Number of items"),
pyui.Spacer(),
pyui.Text(self.item_count.value)
.color(128, 128, 128)
.priority("high"),
),
pyui.Slider(self.item_count, maximum=200),
pyui.Text("Fill rows/columns by"),
pyui.SegmentedButton(self.size_or_num)(
pyui.Text("Number"),
pyui.Text("Size"),
),
pyui.HStack(
pyui.Text("Items per row/column"),
pyui.Spacer(),
pyui.Text(self.num.value).color(128, 128, 128).priority("high"),
),
pyui.Slider(self.num, minimum=1, maximum=10).disable(
self.size_or_num.value == 1
),
pyui.HStack(
pyui.Text("Item size"),
pyui.Spacer(),
pyui.Text(self.size.value).color(128, 128, 128).priority("high"),
),
pyui.Slider(self.size, minimum=50, maximum=200).disable(
self.size_or_num.value == 0
),
pyui.Toggle(self.flex, label="Adjust size to fit").disable(
self.size_or_num.value == 0
),
)
.padding(10)
.size(width=300),
ItemGridView(
item_count=self.item_count.value,
size=size,
num=num,
axis=self.axis.value,
flex=self.flex.value,
),
)
if __name__ == "__main__":
app = pyui.Application("io.temp.GridTest")
app.window("Grid Tester", GridTest())
app.run()