Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: How add button to certain TAB using TAB-index
Post: RE: How add button to certain TAB using TAB-index

I agree with deanhystad. Is this something what you are wanting. Tabs with buttons using a loop. Each tab has five buttons numbered. #! /usr/bin/env python3 import tkinter as tk from tkinter import t...
menator01 GUI 3 91 Sep-22-2021, 10:41 PM
    Thread: Change a list to integer so I can use IF statement
Post: RE: Change a list to integer so I can use IF state...

Have you had a look at this doc? I don't understand why you are putting the cpu_percent in a list bracket. #! /usr/bin/env python3 import psutil from time import sleep max_pct = 90 cpu_pct = psutil...
menator01 General Coding Help 3 138 Sep-21-2021, 01:24 AM
    Thread: Auto increament in Entry field. in tkinter GUI
Post: RE: Auto increament in Entry field. in tkinter GUI

I done a version of your code #! /usr/bin/env python3 # Do the imports import sqlite3 import tkinter as tk from functools import partial # Create/Connect to the sqlite3 database conn = sqlite3.con...
menator01 General Coding Help 7 315 Sep-16-2021, 12:19 AM
    Thread: Auto increament in Entry field. in tkinter GUI
Post: RE: Auto increament in Entry field. in tkinter GUI

I would put it in its own function. As it stands now you are calling it when you insert the form data.
menator01 General Coding Help 7 315 Sep-15-2021, 10:24 PM
    Thread: Auto increament in Entry field. in tkinter GUI
Post: RE: Auto increament in Entry field. in tkinter GUI

This is with sqlite3 but queries are the same #! /usr/bin/env python3 import sqlite3 import tkinter as tk conn = sqlite3.connect('test.db') cursor = conn.cursor() cursor.execute('drop table if exist...
menator01 General Coding Help 7 315 Sep-13-2021, 09:11 AM
    Thread: Auto increament in Entry field. in tkinter GUI
Post: RE: Auto increament in Entry field. in tkinter GUI

Get a row count from the database and add 1to display the next number
menator01 General Coding Help 7 315 Sep-13-2021, 07:31 AM
    Thread: Raw Image Data Viewer using tkinter
Post: RE: Raw Image Data Viewer using tkinter

Pyside2 version. Image formats are png, jpg, ico, and bmp. The jpg images seem to take a few sewconds to display. Maybe because the files are large? #! /usr/bin/env python3 import sys from skimage.i...
menator01 Code sharing 1 331 Sep-07-2021, 07:08 PM
    Thread: Raw Image Data Viewer using tkinter
Post: Raw Image Data Viewer using tkinter

#! /usr/bin/env python3 from skimage.io import imread import tkinter as tk from tkinter import filedialog from os import sys import argparse parser = argparse.ArgumentParser() parser.add_argument('...
menator01 Code sharing 1 331 Sep-06-2021, 02:25 AM
    Thread: looking for scripts that do simple image display
Post: RE: looking for scripts that do simple image displ...

Rewrote the code a little. #! /usr/bin/env python3 from skimage.io import imread import tkinter as tk from tkinter import filedialog from os import sys root = tk.Tk() root.geometry('1020x600+250+2...
menator01 GUI 10 446 Sep-06-2021, 02:10 AM
    Thread: looking for scripts that do simple image display
Post: RE: looking for scripts that do simple image displ...

This is one of the links I used here.
menator01 GUI 10 446 Sep-06-2021, 02:09 AM
    Thread: looking for scripts that do simple image display
Post: RE: looking for scripts that do simple image displ...

Quote:where do i get skimage from? pypi? I did pip install, buts been renamed to scikit-image Quote:it imports imshow and never uses it I forgot to remove it. Quote:was this taken from a larger scri...
menator01 GUI 10 446 Sep-06-2021, 12:13 AM
    Thread: looking for scripts that do simple image display
Post: RE: looking for scripts that do simple image displ...

Not sure if this is what you want. #! /usr/bin/env python3 # Do the imports from skimage.io import imread, imshow import tkinter as tk from tkinter import filedialog from os import sys # Start tki...
menator01 GUI 10 446 Sep-05-2021, 11:05 PM
    Thread: PysimpleGUI - listbox with list
Post: RE: PysimpleGUI - listbox with list

import PySimpleGUI as psg nums = range(1, 11) layout = [ [psg.Listbox(values=nums, size=(30, 10))] ] win = psg.Window('Some Text', layout,).read()
menator01 GUI 2 229 Sep-05-2021, 01:00 PM
    Thread: Multiple inputs on the same line (beginner)
Post: RE: Multiple inputs on the same line (beginner)

Might could do something like this: #! /usr/bin/env python3 bday = input("Enter bday format 20/01/1991: ").split() print("/".join(bday))Output:Enter bday format 20/01/1991: 20 01 1991 20/01/1991
menator01 General Coding Help 9 340 Sep-02-2021, 07:11 PM
    Thread: Running A Loop Until You See A Particular Result
Post: RE: Running A Loop Until You See A Particular Resu...

You might can use a try except clause. Something like. Code not tested. #! /usr/bin/env python3 import requests as rq import random as rnd import copy url = 'testurl.com' proxy_list = ['173.68.59....
menator01 General Coding Help 6 6,356 Sep-01-2021, 08:07 AM
    Thread: Line 42 syntax error..Help!!1
Post: RE: Line 42 syntax error..Help!!1

I liked this. I did a version. #! /usr/bin/env python3 # Do the imports import random as rnd # Get the lottery numbers lottery_nums = rnd.sample(range(1, 61), 5) # Sort the lottery numbers for dis...
menator01 General Coding Help 4 275 Aug-31-2021, 07:08 PM
    Thread: random.choice HELP
Post: RE: random.choice HELP

Here is one way import random array = ["Hello","Dog","Cat","Ball"] x = random.choice(array) print(f'Text -> {x} index -> {array.index(x)}')Output:Text -> Ball index -> 3
menator01 General Coding Help 4 357 Aug-08-2021, 10:58 AM
    Thread: How to change odd to even numbers in the list?
Post: RE: How to change odd to even numbers in the list?

here is one way #! /usr/bin/env python3 x = [[2, 4, 6], [1, 3, 5], [7, 8, 9]] for inner_list in x: for num in range(0, len(inner_list)): if inner_list[num] % 2 != 0: inner_l...
menator01 General Coding Help 8 428 Aug-08-2021, 10:40 AM
    Thread: Basic Music Player with tkinter
Post: RE: Basic Music Player with tkinter

yes. I'm just playing around with classes. It's even easier getting the code to work if it's just a function or methods in the same class.
menator01 Code sharing 4 698 Jul-30-2021, 06:44 PM
    Thread: Nested Conditionals
Post: RE: Nested Conditionals

What is already_fed? Guessing it's a variable set to True. Here is one way using a dict #! /usr/bin/env python3 animals = { 'Lion': ('meat', True), 'Zebra': ('grass', True), } animals['Warthog'] = ...
menator01 General Coding Help 3 403 Jul-28-2021, 07:23 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020