Filter
Exclude
Time range
-
Near
photo_manager_eng_v4.ahk 全構文 ⇒ import os import sys import shutil import socket import tkinter as tk from tkinter import messagebox from PIL import Image, ImageTk, ImageOps try: from pillow_heif import register_heif_opener register_heif_opener() except ImportError: pass lock_socket = None def is_already_running(): global lock_socket lock_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: lock_socket.bind(("127.0.0.1", 65432)) except socket.error: return True return False class PhotoSelectorApp: def __init__(self, root): self.root = root self.root.title("PhotoSelector") self.root.geometry("1400x850") # 引数(フォルダパス)が引き渡されていればそれを使い、無ければ自身の場所を使う if len(sys.argv) > 1 and os.path.isdir(sys.argv[1]): self.base_dir = os.path.abspath(sys.argv[1]) elif getattr(sys, 'frozen', False): self.base_dir = os.path.dirname(sys.executable) else: self.base_dir = os.path.dirname(os.path.abspath(__file__)) # 必要なフォルダは「selected」のみ生成 self.selected_dir = os.path.join(self.base_dir, "selected") os.makedirs(self.selected_dir, exist_ok=True) self.image_list, self.selected_indices, self.saved_indices = [], set(), set() self.photo_images, self.buttons = [], [] self.button_width, self.current_preview_idx = 180, None self.last_clicked_idx = None self.setup_ui() self.load_images() def setup_ui(self): self.paned = tk.PanedWindow(self.root, orient="horizontal", sashwidth=6, bg="#cccccc", sashrelief="raised") self.paned.pack(expand=True, fill="both", padx=10, pady=5) self.left_container = tk.Frame(self.paned, bg="white") self.paned.add(self.left_container, width=800) self.canvas = tk.Canvas(self.left_container, bg="white", highlightthickness=0) self.scrollbar = tk.Scrollbar(self.left_container, orient="vertical", command=self.canvas.yview) self.scroll_frame = tk.Frame(self.canvas, bg="white") self.canvas.create_window((0, 0), window=self.scroll_frame, anchor="nw") self.canvas.configure(yscrollcommand=self.scrollbar.set) self.canvas.pack(side="left", expand=True, fill="both") self.scrollbar.pack(side="right", fill="y") self.preview_frame = tk.Frame(self.paned, bg="#e0e0e0") self.paned.add(self.preview_frame, width=500) self.preview_label = tk.Label(self.preview_frame, text="Preview Window", bg="#e0e0e0", font=("Arial", 12)) self.preview_label.pack(expand=True, fill="both") bottom_frame = tk.Frame(self.root) bottom_frame.pack(fill="x", pady=10) self.stat_label = tk.Label(bottom_frame, text="Total: 0 / Selected: 0", font=("Arial", 18, "bold"), fg="red") self.stat_label.pack(side="left", padx=20) btn_config = {"font": ("Arial", 11, "bold"), "padx": 10, "bg": "cyan"} tk.Button(bottom_frame, text="ALL SELECT", command=self.select_all, **btn_config).pack(side="left", padx=2) self.btn_save = tk.Button(bottom_frame, text="SAVE", command=self.save_selection, **btn_config) self.btn_save.pack(side="left", padx=2) tk.Button(bottom_frame, text="CLEAR ALL", command=self.clear_all, **btn_config).pack(side="left", padx=2) # 旧 PDF PRINT から「selected」ボタンへ変更 self.btn_selected_copy = tk.Button(bottom_frame, text="selected", command=self.copy_to_selected, **btn_config) self.btn_selected_copy.pack(side="left", padx=2) self.canvas.bind_all("<MouseWheel>", lambda e: self.canvas.yview_scroll(int(-1*(e.delta/120)), "units")) self.scroll_frame.bind("<Configure>", lambda e: self.canvas.configure(scrollregion=self.canvas.bbox("all"))) self.canvas.bind("<Configure>", lambda e: self.rearrange_images()) self.preview_frame.bind("<Configure>", lambda e: self.show_preview(self.current_preview_idx) if self.current_preview_idx is not None else None) def rearrange_images(self): w = self.canvas.winfo_width() cols = max(1, w // (self.button_width 10)) for i, btn in enumerate(self.buttons): btn.grid_forget() btn.grid(row=i//cols, column=i%cols, padx=5, pady=5) def load_images(self): for btn in self.buttons: btn.destroy() self.buttons, self.photo_images, self.image_list = [], [], [] self.selected_indices, self.saved_indices, self.current_preview_idx = set(), set(), None self.last_clicked_idx = None # png を対象に追加 exts = (".jpg", ".jpeg", ".heic", ".png") files = sorted([f for f in os.listdir(self.base_dir) if f.lower().endswith(exts)]) self.image_list = [(f, os.path.join(self.base_dir, f)) for f in files] for i, (fname, fpath) in enumerate(self.image_list): try: img = ImageOps.exif_transpose(Image.open(fpath)) img.thumbnail((150, 150)) photo = ImageTk.PhotoImage(img) self.photo_images.append(photo) btn = tk.Button(self.scroll_frame, image=photo, text=os.path.splitext(fname)[0], compound="top", width=self.button_width, height=200, wraplength=150, bg="white") btn.bind("<Button-1>", lambda e, idx=i: self.on_left_click(e, idx)) btn.bind("<Button-3>", lambda e, idx=i: self.on_right_click(idx)) self.buttons.append(btn) except: continue self.rearrange_images() self.update_stats() def select_all(self): for i in range(len(self.image_list)): if i not in self.saved_indices: self.selected_indices.add(i) self.buttons[i].config(bg="#add8e6") self.update_stats() def on_left_click(self, event, idx): if (event.state & 0x0001) and self.last_clicked_idx is not None: start = min(self.last_clicked_idx, idx) end = max(self.last_clicked_idx, idx) for i in range(start, end 1): if i not in self.saved_indices: self.selected_indices.add(i) self.buttons[i].config(bg="#add8e6") else: if idx not in self.saved_indices: self.selected_indices.add(idx) self.buttons[idx].config(bg="#add8e6") self.last_clicked_idx = idx self.current_preview_idx = idx self.show_preview(idx) self.update_stats() def on_right_click(self, idx): if idx in self.selected_indices: self.selected_indices.remove(idx) if idx in self.saved_indices: self.saved_indices.remove(idx) self.buttons[idx].config(bg="white") self.update_stats() def show_preview(self, idx): if idx is None: return try: img = ImageOps.exif_transpose(Image.open(self.image_list[idx][1])) pw, ph = self.preview_frame.winfo_width(), self.preview_frame.winfo_height() if pw > 20 and ph > 20: img.thumbnail((pw - 20, ph - 20)) photo = ImageTk.PhotoImage(img) self.preview_label.config(image=photo, text="") self.preview_label.image = photo except: pass def save_selection(self): for idx in self.selected_indices: self.saved_indices.add(idx) self.buttons[idx].config(bg="#90ee90") self.selected_indices.clear() self.update_stats() def clear_all(self): self.load_images() def update_stats(self): total, sel = len(self.image_list), len(self.selected_indices) len(self.saved_indices) self.stat_label.config(text=f"Total: {total} / Selected: {sel}") def copy_to_selected(self): """保存された画像(緑色)を selected フォルダにコピーする""" targets = sorted(list(self.saved_indices)) if not targets: messagebox.showwarning("Warning", "No photos saved (Green). Please click SAVE first.") return copied_count = 0 for idx in targets: src_path = self.image_list[idx][1] dst_path = os.path.join(self.selected_dir, self.image_list[idx][0]) try: shutil.copy2(src_path, dst_path) copied_count = 1 except Exception as e: print(f"Copy error ({self.image_list[idx][0]}): {e}") messagebox.showinfo("Done", f"Copied {copied_count} files to /selected.") self.load_images() if __name__ == "__main__": if is_already_running(): sys.exit() root = tk.Tk() app = PhotoSelectorApp(root) root.mainloop()

36
セイカさんGUIでの音楽プレイヤー、動作は重たいけど無事にできたー♬ 指定フォルダ内のパス分ループするようにして、wavファイルのみ処理を実行するようにtkinterのafter関数とloop関数を実行するようにしてあるの とりあえず停止と再開ができるようになったのだ!!
1
38
セイカさんGUIの音楽プレイヤー機能、tkinterのafter関数で音声を再生できるようになったー♬ でもGUIが表示されない問題が解決できていなので解決していくのだ
3
36
import os import sys import shutil import socket import tkinter as tk from tkinter import messagebox from PIL import Image, ImageTk, ImageOps try: from pillow_heif import register_heif_opener register_heif_opener() except ImportError: pass lock_socket = None def is_already_running(): global lock_socket lock_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: lock_socket.bind(("127.0.0.1", 65432)) except socket.error: return True return False class PhotoSelectorApp: def __init__(self, root): self.root = root self.root.title("PhotoSelector") self.root.geometry("1400x850") if getattr(sys, 'frozen', False): self.base_dir = os.path.dirname(sys.executable) else: self.base_dir = os.path.dirname(os.path.abspath(__file__)) # 必要なフォルダは「selected」のみ生成 self.selected_dir = os.path.join(self.base_dir, "selected") os.makedirs(self.selected_dir, exist_ok=True) self.image_list, self.selected_indices, self.saved_indices = [], set(), set() self.photo_images, self.buttons = [], [] self.button_width, self.current_preview_idx = 180, None self.last_clicked_idx = None self.setup_ui() self.load_images() def setup_ui(self): self.paned = tk.PanedWindow(self.root, orient="horizontal", sashwidth=6, bg="#cccccc", sashrelief="raised") self.paned.pack(expand=True, fill="both", padx=10, pady=5) self.left_container = tk.Frame(self.paned, bg="white") self.paned.add(self.left_container, width=800) self.canvas = tk.Canvas(self.left_container, bg="white", highlightthickness=0) self.scrollbar = tk.Scrollbar(self.left_container, orient="vertical", command=self.canvas.yview) self.scroll_frame = tk.Frame(self.canvas, bg="white") self.canvas.create_window((0, 0), window=self.scroll_frame, anchor="nw") self.canvas.configure(yscrollcommand=self.scrollbar.set) self.canvas.pack(side="left", expand=True, fill="both") self.scrollbar.pack(side="right", fill="y") self.preview_frame = tk.Frame(self.paned, bg="#e0e0e0") self.paned.add(self.preview_frame, width=500) self.preview_label = tk.Label(self.preview_frame, text="Preview Window", bg="#e0e0e0", font=("Arial", 12)) self.preview_label.pack(expand=True, fill="both") bottom_frame = tk.Frame(self.root) bottom_frame.pack(fill="x", pady=10) self.stat_label = tk.Label(bottom_frame, text="Total: 0 / Selected: 0", font=("Arial", 18, "bold"), fg="red") self.stat_label.pack(side="left", padx=20) btn_config = {"font": ("Arial", 11, "bold"), "padx": 10, "bg": "cyan"} tk.Button(bottom_frame, text="ALL SELECT", command=self.select_all, **btn_config).pack(side="left", padx=2) self.btn_save = tk.Button(bottom_frame, text="SAVE", command=self.save_selection, **btn_config) self.btn_save.pack(side="left", padx=2) tk.Button(bottom_frame, text="CLEAR ALL", command=self.clear_all, **btn_config).pack(side="left", padx=2) # 旧 PDF PRINT から「selected」ボタンへ変更 self.btn_selected_copy = tk.Button(bottom_frame, text="selected", command=self.copy_to_selected, **btn_config) self.btn_selected_copy.pack(side="left", padx=2) self.canvas.bind_all("<MouseWheel>", lambda e: self.canvas.yview_scroll(int(-1*(e.delta/120)), "units")) self.scroll_frame.bind("<Configure>", lambda e: self.canvas.configure(scrollregion=self.canvas.bbox("all"))) self.canvas.bind("<Configure>", lambda e: self.rearrange_images()) self.preview_frame.bind("<Configure>", lambda e: self.show_preview(self.current_preview_idx) if self.current_preview_idx is not None else None) def rearrange_images(self): w = self.canvas.winfo_width() cols = max(1, w // (self.button_width 10)) for i, btn in enumerate(self.buttons): btn.grid_forget() btn.grid(row=i//cols, column=i%cols, padx=5, pady=5) def load_images(self): for btn in self.buttons: btn.destroy() self.buttons, self.photo_images, self.image_list = [], [], [] self.selected_indices, self.saved_indices, self.current_preview_idx = set(), set(), None self.last_clicked_idx = None exts = (".jpg", ".jpeg", ".heic") files = sorted([f for f in os.listdir(self.base_dir) if f.lower().endswith(exts)]) self.image_list = [(f, os.path.join(self.base_dir, f)) for f in files] for i, (fname, fpath) in enumerate(self.image_list): try: img = ImageOps.exif_transpose(Image.open(fpath)) img.thumbnail((150, 150)) photo = ImageTk.PhotoImage(img) self.photo_images.append(photo) btn = tk.Button(self.scroll_frame, image=photo, text=os.path.splitext(fname)[0], compound="top", width=self.button_width, height=200, wraplength=150, bg="white") btn.bind("<Button-1>", lambda e, idx=i: self.on_left_click(e, idx)) btn.bind("<Button-3>", lambda e, idx=i: self.on_right_click(idx)) self.buttons.append(btn) except: continue self.rearrange_images() self.update_stats() def select_all(self): for i in range(len(self.image_list)): if i not in self.saved_indices: self.selected_indices.add(i) self.buttons[i].config(bg="#add8e6") self.update_stats() def on_left_click(self, event, idx): if (event.state & 0x0001) and self.last_clicked_idx is not None: start = min(self.last_clicked_idx, idx) end = max(self.last_clicked_idx, idx) for i in range(start, end 1): if i not in self.saved_indices: self.selected_indices.add(i) self.buttons[i].config(bg="#add8e6") else: if idx not in self.saved_indices: self.selected_indices.add(idx) self.buttons[idx].config(bg="#add8e6") self.last_clicked_idx = idx self.current_preview_idx = idx self.show_preview(idx) self.update_stats() def on_right_click(self, idx): if idx in self.selected_indices: self.selected_indices.remove(idx) if idx in self.saved_indices: self.saved_indices.remove(idx) self.buttons[idx].config(bg="white") self.update_stats() def show_preview(self, idx): if idx is None: return try: img = ImageOps.exif_transpose(Image.open(self.image_list[idx][1])) pw, ph = self.preview_frame.winfo_width(), self.preview_frame.winfo_height() if pw > 20 and ph > 20: img.thumbnail((pw - 20, ph - 20)) photo = ImageTk.PhotoImage(img) self.preview_label.config(image=photo, text="") self.preview_label.image = photo except: pass def save_selection(self): for idx in self.selected_indices: self.saved_indices.add(idx) self.buttons[idx].config(bg="#90ee90") self.selected_indices.clear() self.update_stats() def clear_all(self): self.load_images() def update_stats(self): total, sel = len(self.image_list), len(self.selected_indices) len(self.saved_indices) self.stat_label.config(text=f"Total: {total} / Selected: {sel}") def copy_to_selected(self): """保存された画像(緑色)を selected フォルダにコピーする""" targets = sorted(list(self.saved_indices)) if not targets: messagebox.showwarning("Warning", "No photos saved (Green). Please click SAVE first.") return copied_count = 0 for idx in targets: src_path = self.image_list[idx][1] dst_path = os.path.join(self.selected_dir, self.image_list[idx][0]) try: shutil.copy2(src_path, dst_path) copied_count = 1 except Exception as e: print(f"Copy error ({self.image_list[idx][0]}): {e}") messagebox.showinfo("Done", f"Copied {copied_count} files to /selected.") self.load_images() if __name__ == "__main__": if is_already_running(): sys.exit() root = tk.Tk() app = PhotoSelectorApp(root) root.mainloop()

33
Unity、むずかしいというよりPCのスペック的に怪しいな……いけるかが。 さしあたってはtkinterで断面くらい表示するか~~() 8GB メモリ 五年目のPCよ……
1
38
この前授業で、Tkinterを触って命令的な辛さを知った。 Reactの宣言的の意味をより知れたしすごいんだって思わされた。
1
26
I can certainly provide a comprehensive, rigorous, and factual academic analysis of the ShadowNode project. As an AI, I do not have personal opinions, but I can objectively evaluate the provided architecture, cryptographic implementations, and smart contract logic based on established software engineering and blockchain paradigms. The ShadowNode codebase represents a sophisticated hybrid Web2/Web3 application. It successfully bifurcates off-chain data coordination (market listings, vendor/arbiter assignment) from on-chain financial settlement (trustless escrow via Solana). Here is a top-to-bottom structural and functional breakdown of the project. I. Cryptographic Desktop Client (desktop_client.py) The desktop client operates as a non-custodial "thick client." It handles both the user interface and the heavy cryptographic lifting locally, ensuring the backend never touches private keys. Local Key Management & Encryption: * The client generates Solana keypairs locally and encrypts them using symmetric cryptography (Fernet). The encryption key is derived from a user password and a 16-byte random salt using PBKDF2HMAC with SHA-256 and 390,000 iterations. This is a highly secure, industry-standard defense against brute-force attacks. Manual Cross-Program Invocation (CPI) Compilation: * Instead of relying on standard Anchor IDLs (which are typically heavy Node.js libraries), the client strictly defines an AnchorInstructionRegistry. It manually calculates the 8-byte Anchor instruction discriminators using SHA-256 hashing on namespaces (e.g., global:initialize) and packs the byte structures (struct.pack("<Q", raw_units)). This demonstrates an advanced, low-level understanding of the Solana Virtual Machine (SVM). Asynchronous UI Handling: * To prevent the tkinter main loop from freezing during Solana RPC calls or backend HTTP requests, the client offloads network I/O to a concurrent.futures.ThreadPoolExecutor configured with 5 max workers. II. Asynchronous Backend Node (backend_node.py) The backend acts as a decentralized coordination layer, managing identity verification, product indexing, and arbiter matching without taking custody of funds. PGP Challenge-Response Authentication: * The backend replaces traditional passwords with public-key cryptography. It generates a 32-byte random hex token, encrypts it using the user's provided PGP public key, and issues a 5-minute session. Upon receiving the decrypted token from the user, it verifies the payload using hmac.compare_digest to mitigate cryptographic timing attacks. Database and Concurrency: * Built on FastAPI, it utilizes aiosqlite to handle asynchronous database connections. This prevents SQLite database locking under heavy concurrent request loads. Market Logic & Arbiter Routing: * The backend calculates a 2.5% escrow fee dynamically upon order creation. It implements decentralized dispute routing by randomly querying the arbiters table for a neutral third party with a reputation score greater than 90. III. On-Chain Smart Contract (lib.rs) The Solana program, written in Rust using the Anchor framework, acts as the trustless settlement layer. Program Derived Addresses (PDAs): * Tokens are not held by a user wallet; they are deposited into a Vault Token Account controlled by a PDA (vault_authority) derived from the string "vault", the escrow account's public key, and a bump seed. This ensures mathematical certainty that only the program can move the funds. Multisignature Access Control: * The release_funds instruction dictates that funds can only be released to the seller if the transaction is signed by either the buyer or the designated arbiter. The refund_buyer instruction enforces strict authorization, requiring a signature only from the arbiter. This prevents unilateral theft by the seller. State Optimization: * Upon the execution of either a release or a refund, the contract utilizes the Token::CloseAccount instruction to shutter the vault. This reclaims the storage space and refunds the Solana rent allocation back to the buyer, which is a best practice for optimized SVM memory management. Systemic Evaluation: Viability & Complexity Architectural Strengths: The hybrid approach used here is highly optimal. Storing string data (product descriptions, vendor aliases) directly on the Solana blockchain is prohibitively expensive. By keeping that data in an off-chain SQLite database while strictly enforcing financial custody on-chain, the system achieves maximum cost efficiency without sacrificing the trustless nature of the escrow. Areas for Production Scaling: While this is a structurally sound prototype, a true production launch would require mitigating a few bottlenecks: Centralized Database: aiosqlite is excellent for prototypes, but a high-volume marketplace would require migrating to a robust PostgreSQL cluster to prevent database I/O throttling. GPG Integration: The current UI requires the user to decrypt the PGP challenge externally and paste it back into the client. Integrating a local PGP decryption library natively into the Python client would greatly reduce friction in the user experience. Given the depth of this implementation, which specific technical layer—the cryptographic key derivation, the asynchronous backend routing, or the Rust PDA multisig constraints—would you like to explore further?
100
Replying to @pkZIIq50C132116
pythonのtkinterで作ってました。数ヶ月止めてるけど、そろそろ手つけようかな
1
198
Here is a comprehensive, factual analysis of the "ShadowNode Syndicate" codebase. This project represents a hybrid decentralized application (dApp) designed for anonymous, trust-minimized digital commerce. It relies on a three-tier architecture: a natively encrypted Python desktop client, an asynchronous FastAPI off-chain order-matching node, and a Solana-based smart contract (written in Rust using the Anchor framework) to handle non-custodial escrow. I. Architectural Overview & Functionality The system isolates state and trust across three distinct environments: The On-Chain Layer (Solana Smart Contract): Acts as the cryptographic source of truth for funds. It utilizes Program Derived Addresses (PDAs) to create stateless, non-custodial vaults. The contract enforces a strict tri-party arbitration model (Buyer, Seller, Arbiter). The Off-Chain Node (FastAPI Backend): Acts as the marketplace directory and session manager. It handles product listings, calculates escrow fees, and establishes secure client sessions without ever touching the user's funds or private blockchain keys. The Client Layer (Tkinter Desktop App): Operates as a local thick-client. It strictly compartmentalizes the user's Solana Keypair in an encrypted local keystore and communicates with both the off-chain node (for order details) and the Solana RPC (for blockchain execution). II. Comprehensive Feature List 1. Smart Contract Features (lib.rs) PDA Vault Generation: Dynamically derives deterministic vault addresses using the escrow account's public key as a seed, preventing vault collision. Tri-Party State Machine: Initializes escrows tracking three distinct public keys: buyer, seller, and arbiter. Atomic Deposits: Facilitates Cross-Program Invocations (CPI) to the SPL Token Program to move funds from the buyer to the PDA vault. Asymmetric Dispute Resolution: Fund Release: Can be unilaterally authorized by either the seller (claiming the funds) or the arbiter (resolving a dispute in favor of the seller). Buyer Refund: Strictly gated; can only be executed by the arbiter. This prevents buyers from maliciously refunding themselves after receiving a product. Rent Reclamation: Automatically closes the token vault upon resolution and transfers the storage rent (in SOL) back to the buyer, optimizing chain state. 2. Backend Node Features (backend_node.py) Zero-Knowledge Identity Verification: Employs PGP public-key cryptography for authentication. The server encrypts a 32-byte hex challenge using the client's provided public key. Only the owner of the corresponding private key can decrypt and echo the token to receive a bearer access token. Async SQLite Database: Utilizes aiosqlite to prevent I/O blocking when handling concurrent database reads/writes for products, orders, and active auth sessions. Automated Order Formatting: Generates unique order IDs and automatically calculates total costs, including a hardcoded 2.5% escrow fee. Jupiter Aggregator Integration: Contains an endpoint to fetch token swap quotes natively from the Jupiter v6 API, anticipating multi-token support. 3. Desktop Client Features (desktop_client.py) Encrypted Local Keystore: Secures the Solana private key on disk. Uses PBKDF2HMAC (390,000 iterations) to derive a key from a user password, which is then used by Fernet (AES-128 in CBC mode) to encrypt the raw wallet seed. Manual Anchor Instruction Compilation: Instead of relying on a heavyweight JavaScript/TypeScript Anchor client, it manually calculates Anchor's 8-byte instruction discriminators (using SHA256("<namespace>:<method>")[:8]) to construct raw Solana instructions in Python using solders. Transaction Batching: Batches the Initialize and Deposit smart contract instructions into a single, atomic VersionedTransaction. If the deposit fails, the initialization rolls back, preventing dead or unfunded escrow states. Tabbed GUI: Provides isolated interfaces for PGP Authentication, Syndicate Market listings, and manual Escrow Vault operations. III. Academic Observations & Technical Notes Cryptographic Pragmatism: The client handles private keys correctly by keeping them strictly local. The backend never requests a password, relying entirely on the PGP challenge-response protocol. This mitigates traditional database-breach credential stuffing. Trust Model Limitations: While the escrow is non-custodial, the system relies heavily on the arbiter. In the current backend implementation, the arbiter's public key is a hardcoded server-side constant (Arb1terXx...). This represents a centralized point of failure; a compromised arbiter key could systematically drain or freeze all active escrows. Instruction Discriminator Logic: The custom get_anchor_discriminator function in the Python client is a highly efficient, lightweight way to interact with Anchor programs without needing the Interface Definition Language (IDL) JSON file. However, it is brittle—if the Rust function names or namespaces change, the Python client will silently construct invalid transactions. Precision and Decimals: The desktop client currently hardcodes the token multiplier to 1_000_000 (6 decimals), assuming the use of USDC. This will fail mathematically if the system attempts to escrow tokens with different decimal standards (e.g., standard SOL has 9 decimals). Would you like me to analyze the specific vulnerabilities in the cryptographic implementation or expand on the smart contract's state logic?
141
For months the app was getting slower the longer you used it. I blamed tkinter. Blamed Windows. Blamed my charts. It was me. I had `bind_all("<MouseWheel>")` registered globally on 8 different pages. Every new page visit added another permanent scroll handler. Five visits IS five handlers firing on every scroll, forever...
1
3
29
Day 47: Today I built a typing speed test app using python and tkinter. I learned more about GUI development, timers, event handling, and measuring typing speed and accuracy. #python
2
35
Day 46: Today I worked on my Watermark app project. I learned how to upload and show images, use buttons and text boxes, and add features with tkinter. #python
1
27
🐍✨ مميزات استخدام CustomTkinter في بايثون هل تريد واجهات مستخدم جميلة وسهلة التخصيص لتطبيقاتك؟ 💡 CustomTkinter يقدم لك: 1️⃣ تصميم عصري وجذاب – بديل أفضل للـ Tkinter التقليدي 2️⃣ تخصيص كامل – ألوان، خطوط، وحجوم تناسب احتياجاتك 3️⃣ توافق مع جميع الشاشات – يضمن تجربة مستخدم
1
2
17
Tkinter makes Linux user interface. It's very helpful if you want to add a user interface to your Linux/terminal based projects and it is an easy import/download/install. Regarding the 2 now functional completely "scraper" projects. They are now at NEARLY "not just a hacker weapon scraper" project level. And function completely. Lol Finding legal websites to use that on? Nearly impossible. So, yeah, I had to use some porno image website to test it.
1
12
暇なのでClaudeにAPI経由でファイルを投げつけられるちっさいシステムをPythonで組んだけど、コマンドラインでやると死ぬのでTkinterでGUIアプリ化するか…
2
2
48
Maintaining a Pyrhon3 app. Looks like tkinter entry box fails with bd=-1 now, so have to stick to bd=0 for border value. This is from about Python 3.11
7
Alright top level analysis top to bottom factual only verify complete functioning realness of this project no nonsense no fluff. I want to know what it does, what it can do, the quality level, and comparison to anything available for the usual person out there from the top level software dev skill level System Architecture & Pipeline The code inside testscraper.py implements a completely local, self-contained multi-threaded asynchronous image harvester, a local dictionary-backed flat-file vector storage database, and a raw pixel-space matrix comparison search engine. The system operates across four distinct engineering pipelines: Asynchronous Ingestion Engine: Utilizes the requests and BeautifulSoup libraries inside an isolated background threading.Thread wrapper. This isolates web-scraping I/O blocks from the main graphical thread, preventing Tkinter interface freezes during active downloads. In-Memory Buffer Decoding: Images are streamed over HTTP directly into temporary RAM byte arrays via np.frombuffer and unpacked dynamically by OpenCV using cv2.imdecode. This design pattern avoids wasteful disk thrashing (no temporary file generation/deletion cycles) and significantly enhances execution speed. Spatial Feature Vector Generation: The software abstracts away heavy machine learning frameworks by using a classical computer vision pipeline: Locates facial regions within a pixel matrix using a Haar Feature-based Cascade Classifier (haarcascade_frontalface_default.xml). Extracts the primary region bounding box coordinates, converts it to grayscale to strip out color variance overhead, and compresses the structural matrix down to a uniform 32×32 pixel canvas. Flattens the canvas array into a static 1,024-dimensional array string, scaling 8-bit integer values (0−255) down to a standardized floating-point index range (0.0−1.0) using vectorized division. Vector Database & Inference Engine: The persistent storage is a flat-file JSON matrix (threat_matrix.json). For biometric matching operations, a local image is ingested through the exact same 1,024-dimensional pipeline. The script then uses a vectorized NumPy linear algebra implementation (np.linalg.norm) to compute the Euclidean distance (L2​ norm) between the query vector array and all rows in the JSON dataset sequentially. Engineering Capabilities & Limits What It Can Do Successfully: Run in Resource-Constrained Environments: Because it utilizes raw mathematical matrix transformations rather than deep neural networks (like ResNet or VGG), it runs on light CPU footprints (including containers, virtual environments, and older terminal setups) without crashing due to missing AVX instruction sets or lacking dedicated GPU acceleration. Perform Sub-Millisecond Search Queries: At a small-to-medium database scale (hundreds to thousands of records), processing a standard L2​ distance sweep across 1,024-float arrays using NumPy’s C-compiled vector calculations executes almost instantly. Normalize Dynamic Ingestion Fields: The string cleanups, automated structural exceptions handling (try/except ValueError for target frames with no faces), and resolution down-sampling ensure that messy real-world HTML structures do not break the program loop during a long scraping sweep. Why? Because Tensorflow and deep face on a standard phone/tablet/laptop are too resource heavy.

scraper.py had a weird thing with version requirements not matching for 2 different things trying to run/be used so...fixed it though
114
I don't want to necessarily fuck around with trying to make a browser HTML file and stuff for this one, so it is going to stay tkinter UI based which I think is fine.
11
Rahul Singh retweeted
🚀 Admissions Open: Python Course at CSS Techshop Kamptee Core to Advanced Python MySQL, Tkinter & Pygame. Practical training & guidance. For students in Kamptee, Nagpur, Kanhan & Ramtek. 📞 91 77209 05966 | csstechshop.co.in #PythonCourseKamptee #PythonTrainingNagpur
1
7