#user-interfaces

1 messages · Page 88 of 1

digital rose
#

sure, feel free to ping me. if you'd need to engage in an extended discussion, feel free to open a help channel #❓|how-to-get-help.

south moon
#

I'm giving PyQT5 a shot as my first GUI, it'll be relatively simple. Where could I find some decent tutorials on it?

autumn scaffold
#

I am still a beginner at python but I know the basics, if I wanted to learn how to make proper UI's where should I start?

digital rose
#

@autumn scaffold you can refer to this!

heavy cliff
#

I install pyquaternion in cmd promp but when i code something and run it it tells me ModuleNotFoundError: No module named 'pyquaternion'

#

do yall know why?

mortal crag
#

can anyone explain to me on the```py

dash=(200,250)

#
import tkinter as tk


main_win = tk.Tk()

shapes = tk.Canvas(main_win, width=500, height=500)
shapes.pack()

shapes.create_rectangle(130,25, 360,100, fill="#ff1400")
shapes.create_rectangle(130+10,25+10, 235,90, fill="blue")
shapes.create_rectangle(255,25+10, 350,90, fill="blue")
shapes.create_rectangle(10,100, 10+480,175, fill="#ff1400") #big rectangle
shapes.create_oval(100,150,100+50,150+50, fill="black")
shapes.create_oval(340,150,340+50,150+50, fill="black")
shapes.create_oval(120,170,120+10,170+10, fill="#a0a0a0")
shapes.create_oval(360,170,360+10,170+10, fill="#a0a0a0")
shapes.create_arc(450,150,500,200, style="pieslice", fill="#a0a0a0")
shapes.create_line(11,125, 490, 125, dash=(200,250),fill="white", width = 3)
import tkinter.colorchooser

def getColor():
    color = tkinter.colorchooser.askcolor()
    print(color)

tk.Button(text="Select Color", command=getColor).pack()

main_win.mainloop()
mortal crag
#

i saw this website just now

#

im confused as idk what is the difference between 4 pixel and 2 pixel

#

cuz they look the same to me

#

after i run my code

#

if i put dash at value 100,100

#

and 200,250 is the same

#

almost the same i guess

#

so im abit confused atm

native cradle
#

Try (1, 10)

mortal crag
#

the dots get smaller

#

"rectangles"

thorny crown
#

is BeeWare complete?

digital rose
#

What would be the best import module

#

for using HTML as my interface

#

I tried seleniun

#

selenium*

#

and Flask

#

and EEL

#

but so far none of them are working too well

#

is there a way to make my own web driver

#

and use that as a way

#

to like... run my interface

ripe shuttle
young sedge
#

it would be better if you describe better what u a trying to achieve

cedar zealot
#

Hi

sick carbon
sick carbon
young sedge
#

Most of the code for this stuff is purely frontend logic/code (Basically your project is made out of 100% frontend, if you did not add anything else to it)

#

So, nice style for frontend stuff

#

Oh, you made it as desktop app, funny, I just did not look at the code. I just in my mind quickly rematched it to Frontend capabilities 😉 (Your project can be theoretically remade with frontend framework, CSS / Javascript stuff as a web app)

#

That's why named it so

sick carbon
#

Yeah, it probably could be made with Javascript, React native, etc., but the point is that it isn't 🙂

young sedge
#

A bit too much thinking within web dev department

young sedge
sick carbon
#

lol, how would you do that with Python though. Electron is a very heavy framework for this. CEF maybe?

young sedge
#

So React / Vue.js / Angular stuff

#

Python would be participating at best only to have more sophisticated music storage

sick carbon
#

I definitely see the benefits of web and just going by the numbers that 's where development is focused and has been heading for a long time. In case of a web app, you would probably link it to the Spotify API as well. Why use local files when you are on the web?

But would you play your games on the web? Where would you draw the line? In this case, I like that the app unfurls and you can drag the app around. It provides a tactile experience to the player that web doesn't, not for me anyway.

#

Anyway, I take it as a compliment that you would see this as a frontendish web application!

stray jackal
#

dancing racoons - nice idea

#

i want to use Tkinter to talk to a existing CLI program for SDR ( sofware defined radio ) to control its functions -- is that a frontend ?

sick carbon
#

Is that question about Tkinter or Dear PyGui?

digital rose
#

Best way of Python GUI tool for beginners?

#

I heard that Tkinter is the ideal, but I wonder if there are alternatives too

brazen crag
digital rose
#

@digital rose you can refer to this giant essay i wrote.

solemn yacht
#

any simple tkinter app on github? i want to look at how ppl develop using tkinter before actually making my own programs

stiff geyser
sick carbon
# stiff geyser Very nice app. Looks great. I wish I had used pygui for a project I'm working on...

Thank you! Am I understanding you correctly that you want to use Dear PyGUi to add fonts to the registry of Tkinter? If so, I highly doubt that it would work. Doesn't Tkinter have theming for TTK or something? I never used Tkinter, but I see that mentioned sometimes.

You can always use Dear PyGui on your next project. Here are some other apps made with Dear PyGui.
https://github.com/hoffstadt/DearPyGui/wiki/Dear-PyGui-Showcase

There is a discord server for Dear PyGui as well in case you need help. By the way, it's called Dear PyGui. There is another, much older framework called PyGui, which is why the distinction is not trivial.

What are you working on?

stiff geyser
#

Yea, if that add_font() function adds it to the windows registry, then there is a slight chance it might work. But if its a pygui specific registry thing then yea, it probably won't work. I will look into it. And yea it has theming but there is no support for custom fonts as far as I know.

I'll definitely use dear pygui next time, thanks for the info! And the app is a GUI for a music splitting program.

sick carbon
stiff geyser
#

thank you^ will check that out

digital rose
stray jackal
#

ponder - ponder - ponder - have a drink - ponder ponder

stiff geyser
#

But I figured it out. These lines do the job

#

gdi32 = ctypes.WinDLL('gdi32')
gdi32.AddFontResourceW("Mercy.ttf")

#

AddFontResourceW() temporarily "installs" a font in Windows.

#

and tkinter can then use that font

digital rose
#

and since you've initialized the font publicly, it would work. why'd tkinter not recognize / access this font?

#

but anyways, you've solved it, and that's that i guess.

stiff geyser
#

Oh, so If I package that code with pyinstaller and the font file, it would just work like that?

#

If thats the case, I'd rather do it that way.

digital rose
stiff geyser
#

Okay, will try that out. Thanks for the info.

deft knoll
#

how to close tkinter window and create a new one with clicking a button?

uneven summit
uneven summit
graceful snow
sick carbon
# uneven summit which ui library did you used? it looks modern and beautiful

I appreciate your compliments! The GUI framework is Dear PyGui. It’s the only library used for the front end. The list box, scrollbar and buttons are Dear PyGui style (they are themeable with regard to colour and rounding). You can load any font you want, so I used four different fonts. All other elements are images. Dear PyGui is written in C/C++ (and uses the GPU for rendering, which makes it quite performant) with Python bindings.

barren tide
#

Does anybody use Qt here? I'm trying to get QWidget's real screen size. Is it possible?
I've tried:

self.size()
self.geometry.size()
self.frameGeometry.size()
self.frameSize()

None of these return real size.

rancid imp
#

Is there a font out there that includes color emojis that is compatible with tkinter?

ripe shuttle
granite rampart
#

You can also use this to remove all widgets and start over
root = Tk()
def fresh_window(root):
for i in root.winfo_children():
i.destroy()
fresh_window(root)

jovial pivot
#

I was making a program and was using the Label class, but it appears that when i display it to screen, the image is comepletely blank. Could it be an anchoring problem?
I have a very long code so i will just add the important things here

    titleScreen = Frame(window, width=width, height=height)

    titleScreenIMG = PhotoImage(file="Assets/TitleScreen.png")
    titleLabel = Label(titleScreen, image=titleScreenIMG)
    titleLabel.pack()
    titleScreen.pack()```
#

there seems to be no error with the image path either

mighty rock
#

Tkinter requires you to save a reference to the image somewhere. The easiest way to do it in your case is titleLabel.image = titleScreenIMG

#

And I think that should work

jovial pivot
#

I saw people talking about keeping a reference. i couldnt really understand that

#

btw in tkinter, does the layer of objects work as per the line where it was created or the line where it was placed

mighty rock
#

Placed/packed/gridded

#

But the ID of the object is generated by the order of creation

jovial pivot
mighty rock
#

Try packing the label with the options expand=True, fit="both"

#

Maybe just with expand=True and make sure the size of the image matches the size of the frame

jovial pivot
#

actually

jovial pivot
#

that i forgot to mention in the above code

#

and i commented it and it stopped displaying

#

but it worked only after i created a reference, as u told me to

mighty rock
#

Labels have the capability to display images by themselves, no need to use a canvas, yeah

jovial pivot
#

would u like to join a vc where i can screenshare my code?

#

because atm, its very messy to show someone

mighty rock
#

Okay

jovial pivot
#

@mighty rock would u like to do it in a dm call?

#

i cant verify myself

mighty rock
#

Yeah screen sharing is not possible here anyway

jovial pivot
#

alr

#

ill dm u

deft knoll
#

Sry for my bad english

clear crown
#

hi hi uhhh

#

i need help with PySimpleGUI

#

i regret even looking at this package but now i have to finish what i started

#

i need help plz ping me if someone knows it well

#

anyways no one wants to ping me

#

so im having some problem with the program im making, its technically a 10 question math thingy that it randomly asks 10 questions that are adding and then after those it gives you your score and the time you answered it

#

and im having problem with getting the answer and like almost everything

#

im so lost in the way pysimplegui works idk what to do

#

ik how to get an answer but idk how to put them in a table or data base then show it in another place

#

currently my code is working how it is coded but not the way i want it to

sinful pendant
#

Is there any way to move a shapes point,
Like i have a line in canvas and i want to move just the one end of point
Is that possible?

jovial pivot
digital rose
#

this is where canvas objects come into play. you can name the line based off of a specific tag / id, and use that to delete the line. for instance,

canvas.create_line(10, 10, 100, 100, tags = "line")

now if you'd call canvas.delete("line"), that particular line will not be rendered anymore.

sinful pendant
#

👍

#

Im just one thing needed that i want to get the canvas item in that points sure there is

#

😅working on simulation using tkinyer canvas

digital rose
sinful pendant
#

Yes

digital rose
# sinful pendant Yes

i think the canvas.find_closest(m, n) works just fine, since it will return the id of the object nearest to the position (m, n).

clear crown
#

hey um do anyone know how to work with pysimplegui?
im trying to make it so it will give me another random number every time i press the enter button but idk how to do it

#

plz help me i need it quick

eager beacon
#

If you're trying to get the size of the widget before its visible, it won't work.

#

.size() should give you the correct size excluding the window

barren tide
silver crown
#

hey, im trying to make the bg of my tkinter window a gif

org = Tk()
org.configure(bg = 'black')
org.title('X.M.')
org.geometry("569x800")

frameCnt = 44
frames = [PhotoImage(file='love-stars.gif',format = f'gif -index {i}') for i in range(frameCnt)]

def update(ind):

    frame = frames[ind]
    ind += 1
    if ind == frameCnt:
        ind = 0
    label.configure(image=frame)
    org.after(100, update, ind)

b1 = PhotoImage(file='button1.png')



button_1 = Button(org,image=b1,bg='black',command = months, text = 'VIEW MONTHS')
#button_1.config(font = ('Porter',19,'bold'), height = 2, width = 15,relief = GROOVE)
button_1.config(relief=FLAT)
button_1.place(x = 250,y = 100)

button_2 = Button(org,command = add_data, text = 'ADD DATA')
button_2.config(font = ('Porter',19,'bold'), height = 2, width = 15,relief = GROOVE)
button_2.place(x = 250,y = 300)

button_3 = Button(org,command = get_advice, text = 'GET ADVICE')
button_3.config(font = ('Porter',19,'bold'), height = 2, width = 15,relief = GROOVE)
button_3.place(x = 250,y = 500)

label = Label(org)
label.pack()
org.after(0, update, 0)

org.mainloop()
#

but the label hides the buttons

#

how do i make the buttons come on top

eager beacon
ripe shuttle
silver crown
#

u r a lifesaver

ripe shuttle
#

Happy to help

sinful pendant
#

It just gives weired effects on some cases like when on among x1 y1 is less than x0 y0 respectively

#

Test this code, this acts as draw circles program

#

I think i need to move the circle if it dont works proper on that problem

mint wind
#

hello, so I am making a random name generator, which should get a random name from a list, remove that name, then, when the button on the GUI is clicked, pick a new name that isnt in that list, until there is only 1 name left. i am kinda unsure of what to do rn tho because it can pick a random name and remove that name, but how do i make it so that it will pick another name that is in the list continually? here is the code:

from tkinter import *
import random

names = ["MESSI Lionel","RONALDO Cristiano","TRUMP Donald","BIDEN Joe","JOHNSON Boris"]
random_name = random.choice(names)


def new_name():
    window.destroy()
    names.remove(random_name)
    
window = Tk()

window.resizable(False,False)

name_gen = Button(window,text=random_name,
                    font=("Arial",40,"bold"),
                    fg="#3419e3",
                    activeforeground="#3419e3",
                    compound = "center",
                    command=new_name)
name_gen.pack()

icon = PhotoImage(file="C:/Users/thoma/Desktop/Screenshot 2022-02-13 133639.png")

window.iconphoto(True,icon)

window.title("Random Name Generator")

window.geometry("500x100")

window = mainloop()



coarse mirage
#

What's the simplest way to have a url link of a gif display in PyQt?

eager beacon
#

download the image at the link and display it as a QMovie on a QLabel

coarse mirage
eager beacon
coarse mirage
eager beacon
#

How do you plan to download the movie?

#

I assumed you were going to use an http request?

eager beacon
# coarse mirage "Raw data"? Sorry I'm a bit confused.

Here's an example

import requests
from PyQt5 import QtNetwork
from PyQt5.QtCore import  QUrl
from PyQt5.QtGui import QMovie
from PyQt5.QtWidgets import QApplication, QLabel

url = 'https://i0.wp.com/www.printmag.com/wp-content/uploads/2021/02/4cbe8d_f1ed2800a49649848102c68fc5a66e53mv2.gif?fit=476%2C280&ssl=1'

if __name__ == '__main__':
    app = QApplication([])
    label = QLabel()
    movie = QMovie()
    movie.setCacheMode(QMovie.CacheAll)
    label.setFixedSize(400, 200)
    label.setMovie(movie)
    # setup up the http request
    request = QtNetwork.QNetworkRequest()
    request.setUrl(QUrl(url))
    manager = QtNetwork.QNetworkAccessManager()
    # if the request was successful the reply will contain the image data
    reply = manager.get(request)
    # since QNetworkReply is a QIODevice we can use movie.setDevice
    movie.setDevice(reply)
    reply.finished.connect(movie.start)
    label.show()
    app.exec()
#

you can use requests instead of the QNetwork stuff

#

If you do, use a QByteArray and a QDataStream as the device

ripe shuttle
coarse mirage
# eager beacon Here's an example ```py import requests from PyQt5 import QtNetwork from PyQt5....

Thanks for this. Your code works. However, when I try to apply it and tweak it into my own it doesn't.

I get this traceback:

Traceback (most recent call last):
  File "c:\Users\nomar\Dropbox\Code\SecondScratchPad.py", line 93, in <module>
    ex = MainWindow()
  File "c:\Users\nomar\Dropbox\Code\SecondScratchPad.py", line 44, in __init__
    self.mw_attributes()
  File "c:\Users\nomar\Dropbox\Code\SecondScratchPad.py", line 55, in mw_attributes
    self.movie.setCacheMode(QMovie.CacheAll)
AttributeError: type object 'QMovie' has no attribute 'CacheAll'
#

This is my full code:
https://paste.pythondiscord.com/ekecokefoj.rb

Snippet:

class MainWindow(QWidget):
    
    def __init__ (self):
        super().__init__()
        self.title = "Pokédex"
        self.left = 200
        self.top = 300
        self.width = 520
        self.height = 924
        self.mw_attributes()
        self.start_button()
        self.show()
        
    
    def mw_attributes(self):
        self.setWindowTitle(self.title)
        self.setGeometry(self.left, self.top,self.width, self.height)
        self.setFixedSize(self.size())
        self.pokemon_gif_screen = QLabel("Label", self)
        self.movie = QMovie()
        self.movie.setCacheMode(QMovie.CacheAll)
        self.pokemon_gif_screen.setGeometry(170, 380, 472, 460)
        self.pokemon_gif_screen.setMovie(self.movie)
        request = QtNetwork.QNetworkRequest()
        request.setUrl(QUrl(url))
        manager = QtNetwork.QNetworkAccessManager()
        
        reply = manager.get(request)
        self.movie.setDevice(reply)
        reply.finished.connect(self.movie.start)        
        ```
eager beacon
coarse mirage
#

Thanks.
Ran it again and got this:

Traceback (most recent call last):
  File "c:\Users\nomar\Dropbox\Code\SecondScratchPad.py", line 93, in <module>
    ex = MainWindow()
  File "c:\Users\nomar\Dropbox\Code\SecondScratchPad.py", line 44, in __init__
    self.mw_attributes()
  File "c:\Users\nomar\Dropbox\Code\SecondScratchPad.py", line 59, in mw_attributes
    request.setUrl(QUrl(url))
TypeError: setUrl(self, QUrl): argument 1 has unexpected type 'QUrl'

I assume QUrl also chaanged?

eager beacon
#

No

#

An error like that usually means you have 2 different bindings imported

#

double check your imports

coarse mirage
# eager beacon double check your imports

Okay, I changed my imports to this:

#GUI
from PyQt6 import QtNetwork
from PyQt6.QtGui import*
from PyQt6 import QtWidgets
from PyQt6.QtWidgets import*
from PyQt6.QtCore import QUrl
#

App runs

#

but I don't see the gif 😦

#

My code seems fine to me:

url = 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/animated/shiny/6.gif'

class MainWindow(QWidget):
    
    def __init__ (self):
        super().__init__()
        self.title = "Pokédex"
        self.left = 200
        self.top = 300
        self.width = 520
        self.height = 924
        self.mw_attributes()
        self.start_button()
        self.show()
        
    
    def mw_attributes(self):
        self.setWindowTitle(self.title)
        self.setGeometry(self.left, self.top,self.width, self.height)
        self.setFixedSize(self.size())
        self.pokemon_gif_screen = QLabel("Label", self)
        self.movie = QMovie()
        self.movie.setCacheMode(QMovie.CacheMode.CacheAll)
        self.pokemon_gif_screen.setGeometry(170, 380, 472, 460)
        self.pokemon_gif_screen.setMovie(self.movie)
        request = QtNetwork.QNetworkRequest()
        request.setUrl(QUrl(url))
        manager = QtNetwork.QNetworkAccessManager()
        
        reply = manager.get(request)
        self.movie.setDevice(reply)
        reply.finished.connect(self.movie.start)       ```
eager beacon
#

You didn't use label.setMovie

#

the label is like the screen, you're going to need one of those

coarse mirage
#

self.pokemon_gif_screen = label

eager beacon
#

Does your widget have a layout set, and is the label in the layout?

coarse mirage
eager beacon
eager beacon
#

When a method finishes any local variables defined inside can be garbage collected(deleted) unless they are returned

#

A solution could be to define the manager /request in the __init__ or create a list in __init__ and append the manager/request/reply

#

@coarse mirage This works for me

import sys

# GUI
from PyQt6 import QtNetwork, QtWidgets
from PyQt6.QtCore import QUrl
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
url = 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/animated/shiny/6.gif'

class MainWindow(QWidget):

    def __init__(self):
        super().__init__()
        self.title = "Pokédex"
        self.setWindowTitle(self.title)

        self.movie = QMovie()
        self.movie.setCacheMode(QMovie.CacheMode.CacheAll)
        self.pokemon_gif_screen = QLabel()
        self.pokemon_gif_screen.setMovie(self.movie)
        self.pokemon_gif_screen.setStyleSheet('background:black;')

        self.button_s = QtWidgets.QPushButton()
        self.button_s.clicked.connect(self.startRequest)
        self.manager = QtNetwork.QNetworkAccessManager()

        self._layout = QGridLayout()
        self._layout.addWidget(self.button_s)
        self._layout.addWidget(self.pokemon_gif_screen)
        self.setLayout(self._layout)

    def startRequest(self):
        self.movie.stop()
        self.request = self.getRequest()
        self.request.setUrl(QUrl(url))
        reply = self.manager.get(self.request)
        reply.finished.connect(self.movie.start)
        self.movie.setDevice(reply)
        self.manager.setTransferTimeout(10)

    def getRequest(self):
        return QtNetwork.QNetworkRequest()

if __name__ == '__main__':

    app = QApplication(sys.argv)
    ex = MainWindow()
    ex.show()
    sys.exit(app.exec())
#

You should probably read the docs on the QNetwork stuff. I'm not all that familiar with it, so if you get stuck on something, you might be on your own to figure it out.

coarse mirage
#

@eager beacon Thanks it works. Gotta apply it to my current code. I booked marked your link. 🙂

mint wind
glacial moon
#

Hi everyone, just looking for recommendations for a framework, library, etc that's offline, to make a dashboard. I wanted to make a dashboard for weather, network health, etc of my home LAN , run it on a Raspberry Pi and display it on a currently unused monitor.

ripe shuttle
glacial moon
sacred dirge
#

Anyone have good tutorials on getting started with Qt programming for Python? I keep meaning to get into it but it always feels so daunting
I know their the Qt designer/creator app but even then I have no idea how to get started with it, or how to integrate it into existing projects

#

Cause right now I've been using the gooey library, which basically convert your argparse code into a GUI that you can customize, but it's very barebones

median ridge
#

Lots of good tutorials

vernal crystal
#

I am having a sort of mental hiccup / barrier, something’s not clicking for me. If it’s initialized without arguments, why does the example have arguments?

tribal path
ripe shuttle
#

Not really an alternative as kivy is the only multi-platform one I know but KivyMD is a option you might be aware of.

mighty scroll
# vernal crystal

those are just defaults to arguments, you can put those arguments in and itd override the defaults but you dont have to

digital rose
#

^

digital rose
#

for instance,

def func(var = True):
  print(var)

if you just call func without passing in a value for var, it would work. it's entirely optional to pass in a value in that case.

func() # works, prints True

# the following work too
func(False)
func("alabaster")
vernal crystal
#

Okay, I'm with you on the default arguments, but the documentation doesn't seem to go into any detail about what any of those default args actually mean, do, represent. If they're default and I could pass in something else, what would that do?

#

That's my hangup

digital rose
# vernal crystal Okay, I'm with you on the default arguments, but the documentation doesn't seem ...

no idea why the documentation is missing that piece of info, it seems like they started on it, but didn't finish it all the way. however, you can definitely do:

import tkinter
help(tkinter.Tk)

which yields a big chunk of text explaining what the __init__ args do, specifically:

__init__(self, screenName=None, baseName=None, className='Tk', useTk=True, sync=False, use=None)
 |      Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will
 |      be created. BASENAME will be used for the identification of the profile file (see
 |      readprofile).
 |      It is constructed from sys.argv[0] without extensions if None is given. CLASSNAME
 |      is the name of the widget class.

it seems like these args are quite trivial for an application.

#

(that does miss out on useTk , sync and use, no idea why.)

vernal crystal
#

I have to say, nothing makes me feel quite as braindead as programming.

#

The literature is dense and I'm never sure what questions I'm trying to ask, but thank you, that helps

digital rose
#

anytime, fasho.

sage elk
#

can i make a ui like this

solemn yacht
#

what is wrong in here??

#

does WxPython calls OnInit() before the init()?

young sedge
#

Which way looks better?

#

Version 1:

#

Version 2:

#

Version 3:

#

the difference is in the settings button located differently

wraith plover
#

Can i run kivy app from macbook to iOS without Xcode?

young sedge
#

After some thinking I came up I think with the ideal version. Thanks.

#

The button surely missed the description 😉

solemn widget
#

whats the best version of pyside to use?

vague parcel
hot yoke
keen idol
#

Guys what difference qt designer - qt creator what should i use

plucky hill
#

actually yea that v4 is the best

digital rose
old grove
#

guys help me

#

so that the system / file does not come out, how do you do it?

unique forge
#

please give us more information

stray jackal
#

cool

faint zenith
#

someone who know how to resize item in a HBoxLayout in ptqy5?

mystic jetty
delicate shadow
solemn yacht
#

also, i'm having lots of trouble making a custom button widget. I would like to create a button in the tkinter style, but tkinter is so simple it just doesnt fit my needs rn

#

this is what i have so far:

import wx

class Button(wx.Control):

    def __init__(self, parent, id, label, size, **kwargs):
        super().__init__(parent, id, **kwargs)

        self.SetLabel(label)
        self.SetInitialSize(size)

        self.Bind(wx.EVT_LEFT_DOWN, self._onMouseDown)
        self.Bind(wx.EVT_LEFT_UP, self._onMouseUp)
        self.Bind(wx.EVT_LEAVE_WINDOW, self._onMouseLeave)
        self.Bind(wx.EVT_ENTER_WINDOW, self._onMouseEnter)
        self.Bind(wx.EVT_ERASE_BACKGROUND, self._onEraseBackground)
        self.Bind(wx.EVT_PAINT, self._onPaint)

        self._mouseIn = self._mouseDown = False

    def _onMouseEnter(self, event):
        self._mouseIn = True

    def _onMouseLeave(self, event):
        self._mouseIn = False

    def _onMouseDown(self, event):
        self._mouseDown = True

    def _onMouseUp(self, event):
        self._mouseDown = False
        self.sendButtonEvent()

    def sendButtonEvent(self):
        event = wx.CommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED, self.GetId())
        event.SetInt(0)
        event.SetEventObject(self)
        self.GetEventHandler().ProcessEvent(event)

    def _onEraseBackground(self, event):
        # reduce flicker
        pass

    def _onPaint(self, event):
        dc = wx.BufferedPaintDC(self)
        dc.SetFont(self.GetFont())
        dc.SetBackground(wx.Brush(self.GetBackgroundColour()))
        dc.Clear()

        # draw whatever you want to draw
        # draw glossy bitmaps e.g. dc.DrawBitmap
        if self._mouseIn:
            pass# on mouserover may be draw different bitmap
        if self._mouseDown:
            pass # draw different image text
#

found this code on stackoverflow

#

my objective is to make a label appear at the center of the widget and make it sink on its press

#

i couldnt find a way to change the border state of anything in wxpython

#

also, i made several calculations using the size of the control but got no results in positioning a text on the center with the dc.DrawText()

#

It would be a bad practice I think, but what i could is instead of inheriting from Control, inherit from panel and then make the panel clickable

#

but then the problem of not being able to sink it would come anyway

delicate shadow
solemn yacht
#

interesting..

#

what is this project about?

delicate shadow
delicate shadow
#

(I am one of the authors)

solemn yacht
delicate shadow
solemn yacht
#

in reality... this project seems hella cool... I will dive deeper into it, seems a really useful thing for the framework

#

im working on a considerably big project rn, but for real someday i hope i can help with this

delicate shadow
coarse mirage
#

Full code: https://paste.pythondiscord.com/qoxaqivovo

So I have a label I created from this snippet:

    def mw_attributes(self):
        self.setWindowTitle(self.title)
        self.setGeometry(self.left, self.top,self.width, self.height)
        self.setFixedSize(self.size())
        self.pixmap = QPixmap()
        self.pokemon_image_screen = QLabel(self)
        self.pokemon_image_screen.setPixmap(self.pixmap)
        self.pokemon_image_screen.setGeometry(70, 80, 472, 460)

That is filled with an image from this url when this function runs:

    def start_button_click(self):
        url_image = requests.get(url_2)
        image = QImage()
        image.loadFromData(url_image.content)
        self.pokemon_image_screen.setPixmap(QPixmap(image))

The issue is that the image it imports is just huge. I was wondering what the simplest way would be to resize the image to scale it down to something smaller?

#

But it doesn't seem to transfer much to Python.

stable bough
#

I never promoted it, but I've shown it to friends and have used it at work and on pet projects a ton

stable bough
#

There are obviously a lot of libraries in python that color text that I have used, but I have used these other libraries and have never liked their syntaxes. For comparison, this is how you print a red, bold, underlined string in terminology:

from terminology import in_red

print(in_red('Danger').in_bold().underlined())

and this is how you do it with the other alternatives:

colorama

from colorama import Fore, Style                                                                                                                                                                                  
# Colorama doesn't support Underlined text because it 
# is struggling to make it work for windows users
# https://github.com/tartley/colorama/issues/38
print(Fore.RED + Style.BRIGHT + 'Danger' + Style.NORMAL)

termcolor

from termcolor import colored

# The string args in this make's this susceptible to typos that are only caught in runtime.
# Other libraries that rely on strings: termcolor, 
text = print(colored('Danger', 'red', attrs=['underline', 'bold']))

crayons

import crayons

# I actually am somewhat ok with the crayons syntax, but it 
# doesn't support underlined text because it is a wrapper to colorama
print(crayons.red('Danger', bold=True)

blessings

from blessings import Terminal

t = Terminal()

# These function names are so dynamic that you can't use autocomplete in an editor/terminal, 
# which is minor, but pretty annoying to me
t.bold_red_underline("Danger")

rich

from rich import print

# I find this syntax to be very annoying and a single typo can ruin all the formatting or cause an error
print("[bold red underline]Danger[/bold red underline]!")
#

one other thing I like is that the library's functions are idempotent, meaning in_red('text') == in_red(in_red('text')), which intuitively makes sense to me

lone hornet
#

import kivy
from kivy.app import App
from kivy.uix.label import Label

class Tigercargo(App):
def build(self):
return Label(text = "sa")

if name == 'app':
Tigercargo().run(
this code is not working please help :(

fleet iron
#

.run()

#

just add that parenthesis as I've told

#

!code next time please

proven basinBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

lone hornet
#

ok but I wrote to this channel beacuse I didnt know what parenthesis was

#

:(

#

fixed it

#

but still it doesnt work

fleet iron
fleet iron
lone hornet
#

it says "text provider ignored"

fleet iron
#

copy the error

#

don't type it

lone hornet
#

Provider: pil(['text_sdl2'] ignored)

#

🤷‍♂️

fleet iron
#

whoops

fleet iron
#

is that the full logs

lone hornet
#

the full log :[INFO ] [Logger ] Record log in C:\Users\Casper.kivy\logs\kivy_22-02-18_0.txt
[INFO ] [deps ] Successfully imported "kivy_deps.gstreamer" 0.3.3
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.3.1
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.3.0
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.3.1
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "C:\Users\Casper\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\kivy_init_.py"
[INFO ] [Python ] v3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)]
[INFO ] [Python ] Interpreter at "C:\Users\Casper\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe"
[INFO ] [Factory ] 186 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_pil (img_sdl2, img_ffpyplayer ignored)
[INFO ] [Text ] Provider: pil(['text_sdl2'] ignored

fleet iron
#

wrap it in code block please

fleet iron
lone hornet
#

I am sending it

fleet iron
fleet iron
lone hornet
#

I sent it

#

ok

fleet iron
#

most likely you need to install sdl2

lone hornet
#

ok

fleet iron
fleet iron
lone hornet
#
[INFO   ] [deps        ] Successfully imported "kivy_deps.gstreamer" 0.3.3
[INFO   ] [deps        ] Successfully imported "kivy_deps.angle" 0.3.1
[INFO   ] [deps        ] Successfully imported "kivy_deps.glew" 0.3.0
[INFO   ] [deps        ] Successfully imported "kivy_deps.sdl2" 0.3.1
[INFO   ] [Kivy        ] v2.0.0
[INFO   ] [Kivy        ] Installed at "C:\Users\Casper\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\kivy__init__.py"
[INFO   ] [Python      ] v3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)]
[INFO   ] [Python      ] Interpreter at "C:\Users\Casper\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe"
[INFO   ] [Factory     ] 186 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_pil (img_sdl2, img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: pil(['text_sdl2'] ignored
hahastaticpoop — bugün saat 10:36```,
fleet iron
#

back ticks

#

edit your message instead of sending one next time

lone hornet
#

ok

#

done :)

#

so?

fleet iron
lone hornet
#

requiment already satisfie

#

d

#

and

#

my error is not this

tribal path
#

either use a venv, build the latest nightly version or switch to a python.org version

grim lintel
drifting palm
#

Here, the GUI is looking a bit weird
I need help in

  1. Make it look better
  2. Put a space betwenn the 2 fields and labels
  3. Making phone number field look normal with there being 2 boxes, 1 for phone number code one for phone number
  4. Making it look neater
static barn
#

I'm currently writing a status bar, like polybar/waybar, for Windows with PyQt6. A few widgets I plan on writing, like a media player widget for example, rely on the winrt python module to retrieve information, e.g. currently playing media info.

I noticed that whenever I try to use (or even import) winrt within my PyQt application, the application will crash with

Traceback (most recent call last):
...
in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:\Users\den\PycharmProjects\yasb\src\core\widgets\win32\media_player.py", line 5, in <module>
    from core.utils.win32 import media_control
  File "C:\Users\den\PycharmProjects\yasb\src\core\utils\win32\media_control.py", line 3, in <module>
    from winrt.windows.media.control import GlobalSystemMediaTransportControlsSessionManager
  File "C:\Users\den\PycharmProjects\yasb\venv\lib\site-packages\winrt\__init__.py", line 4, in <module>
    _winrt.init_apartment()
RuntimeError: Cannot change thread mode after it is set.

A hacky fix is to simply import winrt before PyQt is imported within main.py, but this will still result in PyQt outputting the error:
Qt warning: QWindowsContext: OleInitialize() failed: "COM error ..."

Has anyone ran into this before, and are there any better workarounds? I found this issue https://github.com/microsoft/xlang/issues/690 and it looks like init_apartment is called both by PyQt and then winrt. A forked version of winrt is also linked in the above issue, but I don't know how i'd install it.

static barn
#

After searching the discord, I've just found this message explaining OleInitialize, which makes sense: #help-pear message
But executing the QApplication in a different thread doesn't seem to fix the issue.

solar hollow
#

best ui?

ripe shuttle
# drifting palm Here, the GUI is looking a bit weird I need help in 1) Make it look better 2) P...

You could try using ttk to make it look better. To make it come out neater, you could increase the padding. To make the phone number look more normal you could put the fields in a frame and put that frame in front of the Phone Number label. Also, it ought to be Generate Certificate instead of generate word if I am not wrong. The input fields can be aligned to the right of the window and the labels can be aligned to the left to make it look slightly better (Personal opinion). The submit buttons can be made more spread out.

PS: It doesn't look weird. It is fine.

ripe shuttle
ripe shuttle
#

I think kivy is your only option there. I do recommend you use it with kivyMD

drifting palm
#

padding where?

ripe shuttle
ripe shuttle
#

That often makes things look neater

#

Don't overdo it. Somewhere between 3-10 should be plenty

drifting palm
#

hmmm

#

okk

#

could you do the UI part

#

i suck at UI

odd nova
#

hi, what is more bueatiful than tkinter ?

mighty rock
#

Themed tkinter

stable bough
opaque pond
#

any website for good bootstrap templates?

stray jackal
#

Themed Tkinter - very good

opaque pond
#

@digital rose

native basalt
#

hi everyone need some help

#

def save_password():
if Website_.get() == "" or Username_.get() == "" or Password_.get() == "":
window = Tk()
Error_Message = Label(window, text = "Error! Please fill all the above fields.", bg = "red", fg = "white", font = ("Arial", 16))

        Error_Message.pack()
        window.mainloop()
        
    else:
        
        with open("Passwords.txt" , 'a') as file:
            file.write(Website_.get() + "|" + Username_.get() + "|" + Password_.get() + "\n")
            

        window = Tk()
        Message = Label(window, text = "Password successfully saved.", bg = "green", fg = "white", font = ("Arial", 16))
        
        Message.pack()
        window.mainloop()
#

can anyone tell me why the window is not created in tkinter even though the password to file is saved

digital rose
rocky valve
#

Hello, Anyone here can help me with ploting animation tkinter?

digital rose
#

those all themes in VS Code.

#

I hope you will find yours 👍🏼

digital rose
#

you are welcome 👍🏼

digital rose
#

yes as i see in your main.py

digital rose
# native basalt def save_password(): if Website_.get() == "" or Username_.get() == "" or...

i recommend to you to do:

window = Tk()
# Hide
window.withdraw()
.
.
.
def savepassword():
        if Website.get() == "" or Username.get() == "" or Password.get() == "":
            # Show
            window.deiconify()
            Error_Message = Label(window, text = "Error! Please fill all the above fields.", 
                                  bg = "red", fg = "white", font = ("Arial", 16))
            ErrorMessage.pack()

        else:
            # Show
            window.deiconify()
            with open("Passwords.txt" , 'a') as file:
                file.write(Website.get() + "|" + Username.get() + "|" + Password.get() + "\n")
            Message = Label(window, text = "Password successfully saved.", bg = "green", 
                            fg = "white", font = ("Arial", 16))
            Message.pack()
.
.
.
window.mainloop()
#

if the window was your main window

#

otherwise i advice you to use Toplevel():

def savepassword():
        if Website.get() == "" or Username.get() == "" or Password.get() == "":
            window = Toplevel()
            Error_Message = Label(window, text = "Error! Please fill all the above fields.", 
                                  bg = "red", fg = "white", font = ("Arial", 16))
            ErrorMessage.pack()

        else:
            window = Toplevel()
            with open("Passwords.txt" , 'a') as file:
                file.write(Website.get() + "|" + Username.get() + "|" + Password.get() + "\n")
            Message = Label(window, text = "Password successfully saved.", bg = "green", 
                            fg = "white", font = ("Arial", 16))
            Message.pack()
digital rose
# digital rose yes as i see in your `main.py`
  1. Make it look better:
    using bg, fg, activebackground, activeforeground and bd.

  2. Put a space between the 2 fields and labels:
    if you are using grid you should use pady and padx from their names the pady make a space in the y position and the same for the padx but in the x position. done via:

X.grid(row=N, column=N, padx=N, pady=N) # X = your widget, N = your number
  1. Making phone number field look normal with there being 2 boxes, 1 for phone number code one for phone number:
    i think by using the columnspan which can be done by (am not good at grid because i think place better than grid):
X.grid(...., columnspan=N) # X = your widget, N = your number
  1. Making it look neater
    i don't know what you want exactly do you want better UI look or ?

Note: the tkinter \ Tcl\Tk are a basic GUI library and not fancy GUI library like PyQt5.

errant wyvern
#

im using PyQt, I get this error

#

TypeError: addWidget(self, QWidget, stretch: int = 0, alignment: Union[Qt.Alignment, Qt.AlignmentFlag] = Qt.Alignment()): argument 1 has unexpected type 'sip.wrappertype'

deft knoll
#

why my tkinter bind buttons work incorrectly?
when i go on start bottun with mouse, about button will change!

#

this is my code:

def btns(self, x, y, text, bg, fg):
        def on_enter(ctx):
            self.btn['background'] = fg
            self.btn['foreground'] = bg
        def on_leave(ctx):
            self.btn['background'] = bg
            self.btn['foreground'] = fg

        

        # button
        self.btn = tk.Button(self, text=text, bg=bg, fg=fg, activebackground=fg, activeforeground=bg, border=0, width=42, height=2)
        

        self.btn.bind('<Enter>', on_enter)
        self.btn.bind('<Leave>', on_leave)
        

        self.btn.place(x=x, y=y)

if __name__ == '__main__':
    window = Panel()
    window.label()
    window.btns(0, 190, 'S T A R T', '#2b2e37', '#56fc03')
    window.btns(0, 230, 'A B O U T', '#2b2e37', '#f5ec42')
    window.mainloop()
#

i think i wrote my oop code incorrectly

#

i wrote this simple and worked

solemn widget
#

anyone familiary with pyside6 or pyqt?

#

I am looking at one of the examples in the docs and cannot figure out how to get it to run

digital rose
#

the self.btn you created from it the START button is the same as ABOUT button

digital rose
digital rose
digital rose
#

Anyone know how to embed a Matplotlib figure in a tkinter window and also support high resolution displays? I posted my question on Stack Overflow but haven't gotten much help. https://stackoverflow.com/q/71191121/1084875

stray jackal
#

use Pygame

delicate obsidian
#

I want to do this with PyQt5, but I'm not really sure where to look (sorry for the scuffed representation lol)

digital rose
kindred haven
#

Using PySimpleGUI
couldn't recognize data in image file "foo.png", can someone help me out?

digital rose
kindred haven
#

I'm not sure, I can see and open it on windows so it does exist

digital rose
digital rose
#

if you can show me your code

kindred haven
#

1 second, i wanna try something out

digital rose
#

👍🏼 .

digital rose
#

using PyQt5

digital rose
#

make the float a bit smaller

kindred haven
#
import urllib.request
import PySimpleGUI as sg

layout = [
    [sg.Image(r'',key='img1')],
    [sg.B('PlaceHolderButton',key='Button'), sg.B('Exit')],
    [sg.I(key="URL")]

]
window = sg.Window('PySimpleGUI Test',layout,size=(200,100))

while True:
    event, values = window.read()
    if event == 'Exit':
        break
    if event == 'Button':
        print(values['URL'])
        
urllib.request.urlretrieve(f"https://i.ytimg.com/vi/{values['URL']}/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLCS6cs4L97xxnXYTOVP7q7CMrN0Gw",'thumb_0.png')
        window['img1'].update(r'thumb_0.png')```
#

I am able to download the image and everything, but I can't open it in pysimplegui

digital rose
#

if you can save it in a real path will be better:

urllib.request.urlretrieve(f"https://i.ytimg.com/vi/{values['URL']}/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLCS6cs4L97xxnXYTOVP7q7CMrN0Gw",'C:\\Blah\\thumb_0.png')
        window['img1'].update('C:\\Blah\\thumb_0.png')
#

and i think if you want to change the image you should use Pillow

#
from PIL import Image, ImageTk
.
.
urllib.request.urlretrieve(f"https://i.ytimg.com/vi/{values['URL']}/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLCS6cs4L97xxnXYTOVP7q7CMrN0Gw",'C:\\Blah\\thumb_0.png')
im = Image.open('C:\\Blah\\thumb_0.png')
image = ImageTk.PhotoImage(image=im)
window['img1'].update(data=image)
#

because am bad at PySimpleGUI 👍🏼

digital rose
#

you are welcome 👍🏼

unique forge
#

It's a drag and drop interface where you can make exactly that

#

and once finished you can export it into a python file and program all the buttons and things like that

delicate obsidian
#

Sounds good, tysm

dusky epoch
#
def page2():
    screen2=Frame(root,bg='#8644f4')
    screen2.place(x=1000,y=700)

    search=Label(screen2,text='Search')
    search.pack()

def logcheck():
    user= str(user_entry.get)
    psw= str(pw_entry.get())
    if user=="h" or psw=="h":
        messagebox.showinfo('cool','you have logged in successfully')
        page2()
    elif user=="" and psw=="":
         messagebox.showerror('Error''All fields required')
    else:
        messagebox.showerror('error','Invalid Username/Password')

not able to show other frame using function page2

zenith gulch
#

hey guys, ive been stuck for integrating gmaps into the tkinter. anyone know how to solve?

indigo crane
#

filter, with tkinter

digital rose
#

Hey! Does anyone know from where we can get mentors to guide us? Like I need for ui ux!!
Since I am at beginner stage ibneed someone whose advice or tips I can follow!

bitter wadi
#

Hi, I'm coding a GUI using Tkinter which computes financial calculations across 3 different tabs. I have created the tabs and included a dropdown options menu on tab 1 to pick from gross margin, operating margin and net profit margin. I have been trying to code a function that includes if and elif statements so that when the user for example picks gross margin, I want a textbox and entry button to appear where the user can input values. However, I don't understand how to do this. Any thoughts? This is the code:

#

import tkinter as tk
from tkinter import ttk

root = tk.Tk()
root.title("Tab Widget")
tabControl = ttk.Notebook(root)

tab1 = ttk.Frame(tabControl)
tab2 = ttk.Frame(tabControl)
tab3 = ttk.Frame(tabControl)

tabControl.add(tab1, text='Tab 1')
tabControl.add(tab2, text='Tab 2')
tabControl.add(tab3, text='Tab 3')
tabControl.pack(expand=1, fill="both")

OPTIONS = ["Gross Margin", "Operating Margin", "Net Profit Margin"]
variable = tk.StringVar(root)
variable.set("Pick a calculation")
w = tk.OptionMenu(tab1, variable, *OPTIONS)
w.grid(column=0, row=1)

ttk.Label(tab1,
text="Profitability Ratios").grid(column=0, row=0, padx=30, pady=30)
ttk.Label(tab2,
text="Lets dive into the world of computers").grid(column=0, row=0, padx=30, pady=30)
ttk.Label(tab3,
text="My third tab for my coursework").grid(column=0, row=0, padx=30, pady=30)

def gross_margin():
if tk.OptionMenu == OPTIONS[0]:
gp = Label(root, tab1, text="Enter Gross Profit Value:", command=gross_margin()).pack()
gpe = Entry(root, tab1, textvariable=grossprofit, command=gross_margin()).pack()
salesentry = Label(root, tab1, text="Enter Sales Value:", command=gross_margin()).pack()
salese = Entry(root, tab1, textvariable=sales, command=gross_margin()).pack()
x = gpe / salese
Label(root, tab1, text=x, command=gross_margin()).pack()

root.mainloop()

north ore
#

Which gui is best?

digital rose
#

I need some help with pyqt5

#

I am trying to create a chart

#

Which will have multiple datas

#

But users have to drag to see the previous data

#

Like imagine I am making a chart for the popularities of programming languages

#

And lot of programing languages will be listed there

#

Imagine python is also there

#

So users will be able to see the popularity of python from 2010-2022

#

If they wants to see earlier, they have to drag the chart left

#

They can even resize the chart to however they wants

#

Like if they wants data from 2000-2022 they have to make the bottom row bigger

#

I mean you understood

#

If anyone helps then please ping me

#

You can say I am basically trying to make a tick chart

jovial pivot
#

I was making a listbox that displays the contents of a list in a for loop. Then I added a function that adds content to the list, but the new content does not show up in listbox. Am I doing something wrong with the order of code?
This is a small part of the program I am making.


window = Tk()

nameList = ["Joe", "JoeNathon", "Joestar", "Joelly"]

def add_name():
    nameList.append("FunnyNameXd")

listBox = Listbox(window)
listBox.pack(pady=15)

addButton = Button(window, text="Add", command=add_name)
addButton.pack(pady=5)

for i in nameList:
    listBox.insert(END, i)

window.geometry("300x300")
window.mainloop()
jovial pivot
#

make sure the page2 function is being defined inside a function made for page1

#

and screen1 defined before the page2 function

ripe shuttle
dusky epoch
jovial pivot
jovial pivot
jovial pivot
#

but i figured it out after looking through webs, thanks!

odd nova
#

Hello, hi use PyQt5 but i don't find how to switch a window by an other, do you have any ideas ?
(i have get my code by Qt designer)

kindred mist
#

Heyas, Good Morning!
Some PyQt5 Guru here?
I try with self.emp.treeViewFolderView.expandAll() but it dont expand the Folders oO any ideas?

digital rose
#

i need help i m facing this issue while installing tkinter on raspi4 B

ripe shuttle
#

BTW, tkinter is pre-installed with python as far as I know. I believe you can use it right out of the box.

#

just typing python3 in terminal followed by from tkinter import * should tell you if it is installed or not

digital rose
dusty anvil
#

Is it possible to use Pygame and Tkinter at the same time? Im making a sudoku game. I want to display statistics of the game after the game is over and i want a menu through which the player can select the next sudoku puzzle to play.

#

or a way to embed pygame into tkinter

#

or can i have it so that when i press a button on the tkinter GUI, pygame starts?
when it ends i can use the data collected while the user was playing to display stats in tkinter after pygame ends?

stray jackal
#

good idea

ripe shuttle
spice garden
#

pip3 install tk

digital rose
spice garden
#

👍 👍 👍

deft knoll
#

how to use while loop in tkinter with after method?

indigo crane
clear crown
#

anyone know how to work with pysimplegui and keyboard packages??
i wanna know how to make it so when i press enter on my keyboard something happens in my window that i made with pysimplegui

marble badge
#

does anyone know how to refer to a different screen when dealing with kivy

north ore
north ore
#

let me check ur code

digital rose
north ore
#

if you are looking to change screen then kivy has documentation on ithttps://kivy.org/doc/stable/api-kivy.uix.screenmanager.html

north ore
young sedge
sleek prawn
#

I have a list of tasks that take some time to do that should be run successively. The tasks are in a tkinter Treeview and display their statuses in a column.

def start(self):
    for item in self.queue.get_children():
        if self.queue.set(item, "status") == "":
            self.job = Job()
            self.thread = threading.Thread(target=self.job.run)
            self.thread.start()
            self.monitor_progress(item)
            # Stop here without freezing the entire interface
            print("Complete")

def monitor_progress(self, queue_item):
    if self.thread.is_alive():
        self.queue.set(queue_item, "status", self.job.progress)
        self.after(100, lambda: self.monitor_progress(queue_item))
    else:
        self.queue.set(queue_item, "status", "Complete")```
`monitor_progress` is used to update the column with the status. The issue is the loop continues after the call to `monitor_progress` which makes all tasks run at the same time.
I thought after() calling itself would make the script stop there but apparently not 🤔  How should I make the loop stop running until the thread exits without freezing the entire interface?
sleek prawn
#

Well I managed to fix this by putting a self.thread.join() inplace of the comment there and putting the whole start function in another thread

wary birch
#

Hi, I need help with a project I've been doing. So here's what I want:

I have 2 monitor screens. My main one is simply a usual screen to code and stuff, the other one will have no other function other than display an image in full screen. I want to be able to control the image displayed on the second screen like so:


while True:
  #Do stuff
  secondScreen.update_image(numpy_array)
  #Do more stuff

My problem/challenge is: I want to do this as simple as possible. What I've done so far is to use PyQt5 and create a widget that will be displayed on the second screen, and all the event handling is done from the main thread, while the data processing is done on the separate thread and they communicate through signals, that is:

class mainWidget(QWidget):
  def __init__(self):
    #init stuff
    secondMonitorWidget.showFullscreen()
    self.startThread()

  @pyqtSlot()
  def update_image(self,img):
    secondMonitorWidget.update_image(img)

  def startThread(self):
    thread=QThread()
    thread.new_img_signal.connect(self.update_image)

class worker(QThread):
  new_img_signal=pyqtsignal(np.ndarray)
  def __init__(self):
    #init_stuff
  def run(self):
    #Do stuff
    new_img_signal.emit(array)
    #Do more stuff

This is one way to do it, and it somehow works, but it feels like taking a tank to kill a fly. The most annoying part is that it forces me to have an event loop where there will be no events to detect on the GUI. Is there no other way to achieve this in a much simpler form?

#

(This is a lot of pseudo-code but I think the message gets across)

boreal elbow
#

hello

#

cam any one help me i am getting weird issue

#

i am using messagebox.askquestion prompt it works fine but

#

when i close my root window

#

ask question prompt re appears

#

what could be the issue?

indigo crane
#

otherwise you can also use the keyboard pypi package

digital rose
#

i need help

indigo crane
#

tip, you could straight up ask the question instead of saying that 👀

digital rose
#

'NoneType' object has no attribute 'tk' how to solve this error while insering values into entry box in tkinter

boreal elbow
#

any one please tell me why i am getting same message prompt again after closing my Application

#

here is what i am using to display error msg

#

tk.messagebox.askquestion(title = 'Wrong Input', message = 'Did you mean?' + " " + show , icon='warning')

#

and the 2nd one u can see in gif

jovial pivot
#

if i wanted to get the index of the selected item in a listbox, what function would i use in tkinter?

limpid jungle
jovial pivot
#

could u share any?

limpid jungle
#

wait

limpid jungle
#

removing that..

jovial pivot
#

yes!

limpid jungle
#
from tkinter import *
import tkinter.messagebox as msg

"""
List box is a widget in tkinter which basically works like a list, where we want to show items
in a similar way then we can use List Box widget.
"""

root = Tk()
root.geometry("550x460")
root.title("Listbox inside our GUI")
root.config(bg="#67ebd9")


def do_element(command):
    """This function adds element in our List box through the value entered by the user in entry widget's variable value"""

    if command == "add":

        if list_element.get () == "":
            msg.showinfo("Error !!", "Enter item name in box below to insert it in list. Don't let it empty.")
            return

        list1.insert(ACTIVE, f"{list_element.get()}")
        list_element.set("")

    elif command == "delete":
        list1.delete(ACTIVE)

        
# Main heading Label.

Label(root, text="List of tkinter widgets", font=("constantia", 30), bg="#f6ffcf").pack(fill=X, side=TOP, pady=7)

list1 = Listbox(root, background="#cef2ed", font=("georgia", 12, "italic"))

list1.pack(pady=20)

# Setting values of Listbox which will be their as default values.

list1.insert(1, "Label")
list1.insert(1, "Listbox")
list1.insert(1, "Button")
list1.insert(1, "Radiobutton")

list_element = StringVar()

# Making entery widget for getting value of another elements for adding in Listbox.

Entry(root, textvariable=list_element, font=("book antiqua", 12)).pack(ipady=7, pady=15)

frame1 = Frame(root, borderwidth=5, height=200, bg="#67ebd9")
frame1.pack(side=BOTTOM, pady=15)

# Our button which will add element in list box by add_element() function.

Button(frame1, text="Add element", font="comicsans 15", command=lambda: do_element("add")).pack(pady=4, padx=7, side=LEFT)
Button(frame1, text="Remove element", font="comicsans 15", command=lambda: do_element("delete")).pack(pady=4, side=LEFT)

root.mainloop()
jovial pivot
#

but i need the index because i am also removing it from a list

#

ah holdup

limpid jungle
#

running in your vs code

#

I made this while I was learning tkinter..

jovial pivot
#

the code looks really good

limpid jungle
#

thanks..

#

but you can see their in code how I deleted that element!

jovial pivot
#

ah yes

limpid jungle
#

You just select that element and click remove element button .. that will be deleted.

jovial pivot
#

that works too, but i need the index to remove the object from a list too

#

so is there like a method "ACTIVE.index"

limpid jungle
jovial pivot
#

oh

#

but thank you

limpid jungle
#

having any doubts in tkinter just ping me

#

or ask here

#

I'll help

jovial pivot
#

thank you, i will be sure to

zealous sphinx
#

Hello Guys, Just a doubt with tkinter, how can we give spaces between two widgets ? For e.g. in the given figure how can I minimize the space between two buttons? I am new in UI so please don't mind the design 😅 😅 I will refactor the size and design later.

jovial pivot
zealous sphinx
#

i have used grid()

ripe shuttle
digital rose
#

Can i post GitHub links here ?For showcasing project ?

young sedge
#

then your calculator could be used to calculate expressions like (3 + 5) * (7 – 2), instead of just two numbers

digital rose
zealous sphinx
#

Can someone please clarify, why the same button orientation (height and width) appears different in mac OS and different in Windows? Does Canvas behaves differently with OS?

quaint island
#

Anyone has any idea on how to take gui app to server side

#

?

young sedge
quaint island
young sedge
young sedge
young sedge
#

And that is with assumption I understood correctly that u wish to reimplement your app in form of web site

quaint island
young sedge
#

and exposes public endpoint to query in https request

#

you can query it even with your pyqt application

young sedge
#

then you could simplify your logic, and to be not exposing connection to database as rest api

#

just do it directly in backend framework and render html images as responses

quaint island
static cove
#

@rocky dragon Have you run into any issues with porting PySide2 QThread or QRunnable code to PySide6?

rocky dragon
sinful pendant
#

Is there any tkinter application where the inheritance is used to add some custom attributes to modify a widget(like button, lable etc) class

#

I am making an app (nearly intermediate level) and this time i wanted to add some other attributes in constructor my xyz class inheriting from frame class

shy torrent
#

Anyone has a link to some custom Layout for PyQt/Pyside.

Like actually Layout subclasses. I would like to create my own, but the only examples I can find are either extremely convoluted nested Layouts or from the Pyside Doc and they either are in C++ or some python look a like pseudo code language.

Thanks!

analog spire
#

Hi, I've been trying to help a classmate diagnose an issue he was having with validating input in a Tkinter Entry() widget... it now only accepts numbers, the only issue now is that the value of the two entries, when printed, are ".!entry" and ".!entry2". For context, the programs purpose is to take the given radius and height of a cylinder, and will output the surface area and volume of said cylinder.

proven basinBOT
analog spire
glacial gust
#

You're printing out the widgets themselves. They just return the internal Tk name/ID when str() is called on them by print(), which looks like that. You probably wanted to call .get(), or print the values you already had + the result?
Also, the surface area/volume display code isn't going to be run again when you set variables, you need to update the widgets yourself.

#

I'm not sure why you're putting things in a canvas, it's not required. Canvas widgets are for things like drawing lines and shapes in a region. For just positioning widgets, the pack, grid and place managers are far better.

#

pack() is kinda simple, you specify a side and it puts widgets in place. Makes it easy to use, but less customisable.

dusky marsh
#

Sup Carrot? I can help you with tkinter.

glacial gust
#

grid() positions widgets in rows/columns, and is what you usually want to use.

#

place() does what you are doing with the canvas, places stuff at specific X/Y coordinates. The others check the size of the widget and move stuff around to match.

dusky marsh
#

So the problem with text boxes in tkinter, is that they automatically insert some weird character at the beginning of the string. So just put a quick if statement: if the the string length is greater than 0 cut off the first character.

#

Oops, never mind, it puts a weird character at the end not the beginning.

glacial gust
#

What character?

analog spire
dusky marsh
#

I'm not entirely sure...

glacial gust
#

I've not had that happen.

analog spire
#

but i'll pass it along

glacial gust
#

Ah.

dusky marsh
#

I'm using the ScrolledText object when I get that weird idiosyncrisy.

glacial gust
#

What you should perhaps be doing is use your DoubleVar objects. They're linked to the entry widgets, so you can call get() to fetch the data as a float.

analog spire
#

done that :)

#

have you read the code?

glacial gust
#

Yeah, but you're then calling float() which is a little pointless.

dusky marsh
#

I'm reading the code now... comments would have been nice...

analog spire
#

^ i agree

dusky marsh
#

can you tell me what self.rad is ? What's a tk.Doublevar ?

analog spire
#

from my understanding DoubleVar simply returns the float from the input in the Entry widgets, which makes sense as to what Spen was saying

#

self.rad is simply a variable called "rad" within the class

dusky marsh
#

Well you're treating self.rad as like a textbox or something. What's the point of the .get() call if it's just tkinters internal double variable type?

glacial gust
#

That's correct.

#

A tk variable is more like a named holder of a value - other things can register with it, and get notified when it changes.

#

So for instance you can pass the same variable to multiple widgets, and then editing one has the others update in sync.

analog spire
#

got it sorted, thank you guys for your help, i'll be sure to pass along the other stuff as well :)

dusky marsh
#

Wait, so what's the bug?

#

I mean, it seems that the data is being calculated... but it's just not being displayed. Uh, where exactly is the label where the output goes?

analog spire
#

we got a bit of tunnel-vision there, sorry for the confusion

dusky marsh
#

Glad we could help. Yeah, I wish that I could follow the code better.

#

Post the fixed version.

#

Reading other people's code is interesting. I hear that as a professional, reading other people's code and modifying it is like a bread and butter skill.

quartz rampart
lucid totem
#

how can i program a custom title bar like in vscode using pyqt6, with the topbar being on the samel level as the title of the application n the minimize, maximize n close buttons, with custom icons for the 3 btns?

(plz ping when reply)
_

vestal jetty
#

What's the script to create a basic ui?

#

I want to create a test program that might be useful later

sinful pendant
#

Uhh doing this much work is also pain when the ui is outdated 😂, layout managers are sometimes paint when not work properly

#

Just a static prototype for my "Too Doo" app

dim geyser
#

gonna sound stupid here but is pysimplegui better than tkinter? i've always had trouble writing efficient code without overly long lines for the simplest text and idk how to shorten it or just make it readable

#

like i dont want to have a code that's 2/3 of gui

sinful pendant
#

Idk, i never went out of tkinter 😀

digital rose
digital rose
quartz rampart
#

should I get rid of it?

digital rose
#

Ah, no that seems like a worthwhile endeavor IMO

#

Or you can use web hooks and show on discord

plain junco
#

What's the quickest way to create a desktop GUI (windows)? What language/framework to use?

grave onyx
#

could anyone help me with an HTML inline question?

sinful pendant
tawdry mulch
marble badge
#

is anyone having issues with kivymd MDChip? I keep getting error pos_hint But I have not used pos_hint anywhere yet. I checked kitchen_sink demo and same error

subtle verge
gusty adder
midnight kestrel
#

I'm making a typing game with tkinter, where you have to type a certain number of words before the timer finishes. To implement the timer I used threads, which seemingly works, but I still get an error each time my program closes (thread is not in main thread). I was wondering if there was a way to add a timer without using threads since tkinter is not thread safe ?

fervent iris
#

A PyQt5 question:
I am using the designer and loading the form ui through loadUi method.
Right now my source code directory layout is like:

main.py
mainform.ui
...

I create an executable via pyinstaller. If the executable runs in a directory other than the project root directory, the program throws an exception that it cannot find eg. mainform.ui.
I think I understand why this happens, but shall I better define the UI paths, somewhere in a .spec file?
Can otherwise the design files be 'embedded' in the executable?

sinful pendant
# midnight kestrel I'm making a typing game with tkinter, where you have to type a certain number o...

U can use methods like

Tk().update()
Tk().update_idletasks()

As per my experience idletask just displays the tasks which are currently done inside the function its currently running
Whereas update will go for the current task u doing like if u dragging the window what u will notice is that the window is moving but things running indie has been paused
But in case of idletask the window stores ur drags and after the function is done it will do that window drag task
.
But if u still going with thread option so u can do is that

# if thread2 os the thread u made
thread2.join()

This will do the work and that will join the mthread running the main code

hollow gorge
#

I am learning tkinter, any projects ideas to try?

digital rose
#

filename='password.txt')
await ctx.send(file=file)
  else:
embed = nextcord.Embed(title="Snipe", 

Else is error anyone know why

sterile flax
#

This Variable doesn't work at the second yellow line

#

Why ?!

sinful pendant
#

U cant acess that like this, and code isnt fully visible

fervent iris
tawdry mulch
sinful pendant
#

No this is just an update method provides to view the changes in real time when tkinter os running a function having a endless loop so if we have this method there in loop it will also act to the commands we are giving, just jad less experience in this method (i used it in some of the projects only)

marble badge
#

does anyone know kivy enough to help or at least tell me what to google because I cant find what I'm looking for. I want to create a dropdown menu from a list

hollow gorge
#

Can I change the master of a widget in tkinter, for example I want a button to go from a LabelFrame to other LabelFrame, is it possible?

tawdry mulch
tawdry mulch
#

You can copy the settings and recreate the widget for the new frame

quartz basin
#

help. i can’t install pyqt5, pyqt5-tools and kivy. i get this error every time(python 3.10.2) in cmd

#

i tried(in cmd):
python -m pip install pyqt5

python -m pip install pyqt5-tools

python -m pip install kivy

quartz basin
#

i also used kivy_venv to install kivy but it didn’t work

sinful pendant
#

Do pip install pyqt5 works?

quartz basin
sinful pendant
quartz basin
#

also is it possible to somehow download the files from the internet

quartz basin
tawdry mulch
tawdry mulch
#

In this tutorial you will learn How to Add Python Installation to Path Environment variable in Windows 10.

When we install we have an option to set the path. but by default this option is not selected.
Here first we need to find the location / folder here Python is installed and then we have to add that to Path in System variables section.
Ever...

▶ Play video
quartz basin
#

sorry if asked stupid questions (i’m a beginner)

hollow gorge
tawdry mulch
#

It is not a huge task, but none the less, that might not solve your original issue

quartz basin
tawdry mulch
#

No

quartz basin
#

i saw that on qt website

tawdry mulch
#

But the last time I tried to install this( a few months back ), it wasnt supported on python 3.10 yet, so might want to check the compatible version of python and then proceed

tawdry mulch
#

But I am not much aware about that aspect

quartz basin
#

ok

tawdry mulch
#

95% confident it works with python 3.8 atleast

quartz basin
#

ok thanks

tawdry mulch
# quartz basin

and also dont post pictures of errors, like in this example, it is hard for others to see the error. If you are posting such images make sure the text is clearly visible(might want to zoom in) or paste the text(not directly)

quartz basin
#

ok

quartz basin
fossil hill
#

guys i'm trying to learn kivy and i'm wondering how you can make a scatter layout translate its children widgets 1 to 1 with itself (so as to maintain relative placement within itself) and also how to restrain it to stay inside the main window

#

or zoom out the main window to keep the scatter inside ig that works too but i'd preffer the scatter the bound inside the window for translation and maybe only zoom out for rotation and only allow the scatter getting oob when scaled larger than the main window (or whichever container it's in)

digital rose
#

Hello so I saw someone doing this:


        print(f"{Fore.BLUE}          ███▄ ▄███▓▓█████  ██▀███   ▄████▄   █    ██  ██▀███ ▓██   ██▓")
        print(f"{Fore.BLUE}         ▓██▒▀█▀ ██▒▓█   ▀ ▓██ ▒ ██▒▒██▀ ▀█   ██  ▓██▒▓██ ▒ ██▒▒██  ██▒")
        print(f"{Fore.BLUE}         ▓██    ▓██░▒███   ▓██ ░▄█ ▒▒▓█    ▄ ▓██  ▒██░▓██ ░▄█ ▒ ▒██ ██░")
        print(f"{Fore.BLUE}         ▒██    ▒██ ▒▓█  ▄ ▒██▀▀█▄  ▒▓▓▄ ▄██▒▓▓█  ░██░▒██▀▀█▄   ░ ▐██▓░")
        print(f"{Fore.BLUE}         ▒██▒   ░██▒░▒████▒░██▓ ▒██▒▒ ▓███▀ ░▒▒█████▓ ░██▓ ▒██▒ ░ ██▒▓░")
        print(f"{Fore.BLUE}         ░ ▒░   ░  ░░░ ▒░ ░░ ▒▓ ░▒▓░░ ░▒ ▒  ░░▒▓▒ ▒ ▒ ░ ▒▓ ░▒▓░  ██▒▒▒ ")
        print(f"{Fore.BLUE}         ░  ░      ░ ░ ░  ░  ░▒ ░ ▒░  ░  ▒   ░░▒░ ░ ░   ░▒ ░ ▒░▓██ ░▒░ ")
        print(f"{Fore.BLUE}         ░      ░      ░     ░░   ░ ░         ░░░ ░ ░   ░░   ░ ▒ ▒ ░░  ")
        print(f"{Fore.BLUE}                ░      ░  ░   ░     ░ ░         ░        ░     ░ ░     ")
        print(f"{Fore.BLUE}                                    ░                          ░ ░     ")``` is there a more efficient way
fathom epoch
#

hi , I am trying to implement some coding challenges from the coding train .which GUI libraries is/are required or I can start with for 2d/3d?

digital rose
mighty rock
#

I would use a list

digital rose
#

Like print(“
Fjskdi

“)

sinful kernel
digital rose
#

i got it

digital rose
#
print(Fore.BLUE+"""
          ███▄ ▄███▓▓█████  ██▀███   ▄████▄   █    ██  ██▀███ ▓██   ██▓
         ▓██▒▀█▀ ██▒▓█   ▀ ▓██ ▒ ██▒▒██▀ ▀█   ██  ▓██▒▓██ ▒ ██▒▒██  ██▒
         ▓██    ▓██░▒███   ▓██ ░▄█ ▒▒▓█    ▄ ▓██  ▒██░▓██ ░▄█ ▒ ▒██ ██░
         ▒██    ▒██ ▒▓█  ▄ ▒██▀▀█▄  ▒▓▓▄ ▄██▒▓▓█  ░██░▒██▀▀█▄   ░ ▐██▓░
         ▒██▒   ░██▒░▒████▒░██▓ ▒██▒▒ ▓███▀ ░▒▒█████▓ ░██▓ ▒██▒ ░ ██▒▓░
         ░ ▒░   ░  ░░░ ▒░ ░░ ▒▓ ░▒▓░░ ░▒ ▒  ░░▒▓▒ ▒ ▒ ░ ▒▓ ░▒▓░  ██▒▒▒ 
         ░  ░      ░ ░ ░  ░  ░▒ ░ ▒░  ░  ▒   ░░▒░ ░ ░   ░▒ ░ ▒░▓██ ░▒░ 
         ░      ░      ░     ░░   ░ ░         ░░░ ░ ░   ░░   ░ ▒ ▒ ░░  
                ░      ░  ░   ░     ░ ░         ░        ░     ░ ░     
                                    ░                          ░ ░     """+Style.RESET_ALL)
#

!e

print(Fore.BLUE+"""
          ███▄ ▄███▓▓█████  ██▀███   ▄████▄   █    ██  ██▀███ ▓██   ██▓
         ▓██▒▀█▀ ██▒▓█   ▀ ▓██ ▒ ██▒▒██▀ ▀█   ██  ▓██▒▓██ ▒ ██▒▒██  ██▒
         ▓██    ▓██░▒███   ▓██ ░▄█ ▒▒▓█    ▄ ▓██  ▒██░▓██ ░▄█ ▒ ▒██ ██░
         ▒██    ▒██ ▒▓█  ▄ ▒██▀▀█▄  ▒▓▓▄ ▄██▒▓▓█  ░██░▒██▀▀█▄   ░ ▐██▓░
         ▒██▒   ░██▒░▒████▒░██▓ ▒██▒▒ ▓███▀ ░▒▒█████▓ ░██▓ ▒██▒ ░ ██▒▓░
         ░ ▒░   ░  ░░░ ▒░ ░░ ▒▓ ░▒▓░░ ░▒ ▒  ░░▒▓▒ ▒ ▒ ░ ▒▓ ░▒▓░  ██▒▒▒ 
         ░  ░      ░ ░ ░  ░  ░▒ ░ ▒░  ░  ▒   ░░▒░ ░ ░   ░▒ ░ ▒░▓██ ░▒░ 
         ░      ░      ░     ░░   ░ ░         ░░░ ░ ░   ░░   ░ ▒ ▒ ░░  
                ░      ░  ░   ░     ░ ░         ░        ░     ░ ░     
                                    ░                          ░ ░     """+Style.RESET_ALL)
proven basinBOT
#

@digital rose :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'Fore' is not defined
digital rose
#

!e

from colorama import *
print(Fore.BLUE+"""
          ███▄ ▄███▓▓█████  ██▀███   ▄████▄   █    ██  ██▀███ ▓██   ██▓
         ▓██▒▀█▀ ██▒▓█   ▀ ▓██ ▒ ██▒▒██▀ ▀█   ██  ▓██▒▓██ ▒ ██▒▒██  ██▒
         ▓██    ▓██░▒███   ▓██ ░▄█ ▒▒▓█    ▄ ▓██  ▒██░▓██ ░▄█ ▒ ▒██ ██░
         ▒██    ▒██ ▒▓█  ▄ ▒██▀▀█▄  ▒▓▓▄ ▄██▒▓▓█  ░██░▒██▀▀█▄   ░ ▐██▓░
         ▒██▒   ░██▒░▒████▒░██▓ ▒██▒▒ ▓███▀ ░▒▒█████▓ ░██▓ ▒██▒ ░ ██▒▓░
         ░ ▒░   ░  ░░░ ▒░ ░░ ▒▓ ░▒▓░░ ░▒ ▒  ░░▒▓▒ ▒ ▒ ░ ▒▓ ░▒▓░  ██▒▒▒ 
         ░  ░      ░ ░ ░  ░  ░▒ ░ ▒░  ░  ▒   ░░▒░ ░ ░   ░▒ ░ ▒░▓██ ░▒░ 
         ░      ░      ░     ░░   ░ ░         ░░░ ░ ░   ░░   ░ ▒ ▒ ░░  
                ░      ░  ░   ░     ░ ░         ░        ░     ░ ░     
                                    ░                          ░ ░     """+Style.RESET_ALL)
proven basinBOT
#

@digital rose :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'colorama'
digital rose
#

bot can't do modules xd

last terrace
#

Does anyone here happen to have experience with gtk and glade? I'm attempting to convert an application i made awhile back using tkinter to gtk, but am having some trouble. My program needs to be able to dynamically add widgets, and i can't figure out how to use a container designed in glade in my code as it's own object that i can instantiate when needed.

waxen ruin
#

is Error 503 always server side? Or could it be due to a bad header/endpoint client side?

coarse mirage
#

So, typically when I want to change a label image in PyQt, I use a template like so:

class Update():
    
    changed_text = ""
    
    def __init__(self, text = None):
        self.text = text
        
    def get_text(self):
        return self.text
    
    def set_text(self, new_text):
       self.text = new_text
       
    def text_update(entered):
        pull = Update()
        pull.set_text(entered)
        result = pull.text
        template = Template("$text")
        text_string = template.safe_substitute(text = result)
        Update.changed_text = text_string

and

    def transform (entered):
        Update.text_update(entered)
        template = Template("$t_score")
        transformed_score = template.safe_substitute(t_score = Update.changed_text)
        
    def paste_info(self,pre, text_variable):
        template2 = Template("$text")
        label_string = template2.safe_substitute(text = Update.changed_text)
        text_variable(pre + label_string)   

With the following code showing it in action:

        Data.transform(self.name)
        Data.paste_info(self, "", self.name_screen.setText)

While I can update images this way in PyQt, it doesn't seem to work when I change button backgrounds. Is there a way to do this or it isn't possible?

last terrace
# last terrace Does anyone here happen to have experience with gtk and glade? I'm attempting to...

Well, i ended up answering my own question, so, in case anyone else comes looking for an answer to this question, the solution was to use gtk templates. I set up a separate template file for each of my classes, then used the Gtk.Template() decorator on them. This allowed me to have a class dedicated to the container that needs to be added dynamically, from there i can just instantiate new instances of it as needed.
Source:
https://gist.github.com/jjlrjjlr/b1c7a5f11e239480d612605cd90f2b75

digital rose
#

!e

print ("\
          ███▄ ▄███▓▓█████  ██▀███   ▄████▄   █    ██  ██▀███ ▓██   ██▓\
         ▓██▒▀█▀ ██▒▓█   ▀ ▓██ ▒ ██▒▒██▀ ▀█   ██  ▓██▒▓██ ▒ ██▒▒██  ██▒\
         ▓██    ▓██░▒███   ▓██ ░▄█ ▒▒▓█    ▄ ▓██  ▒██░▓██ ░▄█ ▒ ▒██ ██░\
         ▒██    ▒██ ▒▓█  ▄ ▒██▀▀█▄  ▒▓▓▄ ▄██▒▓▓█  ░██░▒██▀▀█▄   ░ ▐██▓░\
         ▒██▒   ░██▒░▒████▒░██▓ ▒██▒▒ ▓███▀ ░▒▒█████▓ ░██▓ ▒██▒ ░ ██▒▓░\
         ░ ▒░   ░  ░░░ ▒░ ░░ ▒▓ ░▒▓░░ ░▒ ▒  ░░▒▓▒ ▒ ▒ ░ ▒▓ ░▒▓░  ██▒▒▒ \
         ░  ░      ░ ░ ░  ░  ░▒ ░ ▒░  ░  ▒   ░░▒░ ░ ░   ░▒ ░ ▒░▓██ ░▒░ \
         ░      ░      ░     ░░   ░ ░         ░░░ ░ ░   ░░   ░ ▒ ▒ ░░  \
                ░      ░  ░   ░     ░ ░         ░        ░     ░ ░     \
                                    ░                          ░ ░     ")
proven basinBOT
#

@digital rose :white_check_mark: Your eval job has completed with return code 0.

          ███▄ ▄███▓▓█████  ██▀███   ▄████▄   █    ██  ██▀███ ▓██   ██▓         ▓██▒▀█▀ ██▒▓█   ▀ ▓██ ▒ ██▒▒██▀ ▀█   ██  ▓██▒▓██ ▒ ██▒▒██  ██▒         ▓██    ▓██░▒███   ▓██ ░▄█ ▒▒▓█    ▄ ▓██  ▒██░▓██ ░▄█ ▒ ▒██ ██░         ▒██    ▒██ ▒▓█  ▄ ▒██▀▀█▄  ▒▓▓▄ ▄██▒▓▓█  ░██░▒██▀▀█▄   ░ ▐██▓░         ▒██▒   ░██▒░▒████▒░██▓ ▒██▒▒ ▓███▀ ░▒▒█████▓ ░██▓ ▒██▒ ░ ██▒▓░         ░ ▒░   ░  ░░░ ▒░ ░░ ▒▓ ░▒▓░░ ░▒ ▒  ░░▒▓▒ ▒ ▒ ░ ▒▓ ░▒▓░  ██▒▒▒          ░  ░      ░ ░ ░  ░  ░▒ ░ ▒░  ░  ▒   ░░▒░ ░ ░   ░▒ ░ ▒░▓██ ░▒░          ░      ░      ░     ░░   ░ ░         ░░░ ░ ░   ░░   ░ ▒ ▒ ░░                  ░      ░  ░   ░     ░ ░         ░        ░     ░ ░                                         ░                          ░ ░     
digital rose
#

lol

jolly flower
#

lol

magic tide
#

Guys

#

Using tkinter

#

Entry(...)

#

How do u get the string of the Entry?

cobalt elbow
magic tide
#

Oh... Didn't understand how to get the output

#

I mean something kind of a .read() function

austere bough
#

hello! im having trouble with tkinter and ive posted my problem in the help-potato channel. please do help!

pseudo forge
#

hey i got some trouble with tkinter its in #help-cake pls help

magic tide
languid gate
#

!e get

#

!get

proven basinBOT
#

Often while using dictionaries in Python, you may run into KeyErrors. This error is raised when you try to access a key that isn't present in your dictionary. Python gives you some neat ways to handle them.

The dict.get method

The dict.get method will return the value for the key if it exists, and None (or a default value that you specify) if the key doesn't exist. Hence it will never raise a KeyError.

>>> my_dict = {"foo": 1, "bar": 2}
>>> print(my_dict.get("foobar"))
None

Below, 3 is the default value to be returned, because the key doesn't exist-

>>> print(my_dict.get("foobar", 3))
3

Some other methods for handling KeyErrors gracefully are the dict.setdefault method and collections.defaultdict (check out the !defaultdict tag).

fathom epoch
#

I wanted to make the plot whole screen . and also it seems like stretched. How to make it full screen and remove the stretching?

steep timber
#

Just asking,
Are you using tkinter??

fathom epoch
#

matplotlib

steep timber
#

In matplotlib,

#

you can actually use
figManager=plt.get_current_fig_manager()
figManager.window.showMaximized()

fathom epoch
steep timber
steep timber
#

Welcome

mighty rock
# magic tide How do u get the string of the Entry?

If calling its get method doesn't work, then you should use a StrVar or however it's called in tkinter. You instantiate an instance of it and pass it into the variable or textvariable or something of the entry widget. This will allow you to call the variable's get and set methods to get and set the text in the entry.

magic tide
#

The tkinter entry box isn't a class so i can use the .get function

languid gate
sinful pendant
magic tide
#

Now i see if it works

austere bough
jagged geyser
#

@scenic garden try this

import tkinter as tk

window = tk.Tk()
window.geometry("800x600+300+100")
window.title("App")
window.config(bg="#6C47F5")
window.resizable(False, False)
window.grid_rowconfigure(0, weight=1)
window.grid_columnconfigure(0, weight=1)

content = tk.Frame(window, bg="#6C47F5")
content.grid()

nick = tk.Entry(content)
password = tk.Entry(content)
nick.grid(column=0, row=0, pady=20)
password.grid(column=0, row=1, pady=20)

window.mainloop()
#

if you change the content frame background colour it helps to visualize whats happening when you experiment with changing options

grim lintel
#

I want to ask, which UI Lib can be used to create a simple GUI quickly and efficiently + easy to understand?

magic tide
magic tide
sinful pendant
# magic tide

The variable stores None not that tkinter widget with whom u using cget() method

magic tide
#

Ok i done it

#

But

#

Now i have the problem to identify of the button is clicked

sinful pendant
#

What u can do is that add commamd to button

#

Like
Button(master, command=function_object)

magic tide
#

But how is the function

#

How i know if the button is clicked

sinful pendant
#

Can u explain me what u are doing

magic tide
#

I need to do something like this...

#

If button is cliked:
Entry.get()

sinful pendant
#

Yeah then do that entry.get thing inside a function and supoose the function name is foo() so in that button writ one more argument called command with foo as value

magic tide
#

Till here i am

#

But

#

Inside the function what do i put

sinful pendant
#

Let me gove u a small snippet of code and try that out

magic tide
#

Oke

sinful pendant
#

Whenever u check a button is clicked or not u add a commamd to it

magic tide
#

Ok got it out

#

Did it

#

I first didn't understand command with function

magic tide
#

Guys

#

How to run a loop in "background"

#

I need to run a tkinter interface and every second an output starts

#

Like

#

Every 2 seconds print...

#

Without stopping the script

ripe shuttle
tawdry mulch
ripe shuttle
tawdry mulch
magic tide
#

Ok i got into another trauma...

#

How do i make global a variable in a function. But it mustn't be executed

sinful pendant
sinful pendant
tawdry mulch
magic tide
tawdry mulch
#

Rather than asking on how to do it, now

sinful pendant
#

I know i know there ain't need fo that but my momd said to do that thats it 😅

magic tide
#

Brb

#

import time
import tkinter as tk

def clicked():
global x
try:
x=print(int(number.get()))
except ValueError:
print()

#WORKING ON THE WINDOW
root=tk.Tk()
root.title('HB Converter')
root.geometry('250x130')
root.resizable(False, False)

#LABEL INPUT
label_top=tk.Label(root,text='INPUT ANYTHING TO CONVERT').pack()

#NUMBER TO CONVERT
number=tk.Entry(root,text='',bd=1)

#CONVERT BUTTON
button=tk.Button(root, text='convert',bd=0,command=clicked)
button.place(x=150,y=17)
y=button.invoke()

def try1():
try:
bin(int(number.get()))
except ValueError:
print()
def try2():
try:
hex(int(number.get()))
except ValueError:
print()

#ENTRY BOX BIN
number_bin=tk.Entry(root,text=try1(),bd=1).place(x=60,y=73)
#ENTRY BOX HEX
number_hex=tk.Entry(root,text=try2(),bd=1).place(x=60,y=100)
#BIN LABEL AND HEX LABEL
label_top3=tk.Label(root,text='bin').place(x=10,y=75)
label_top4=tk.Label(root,text='hex').place(x=10,y=101)

number.place(x=7,y=20)

root.mainloop()

#

i'm having issues in the #ENTRY BOX BIN paragraph

proven basinBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

magic tide
tawdry mulch
#

First format the code accordingly

magic tide
#

Al i need is to make of it a variable

#
import tkinter as tk

def clicked():
    global x
    try:
        x=print(int(number.get()))
    except ValueError:
        print()

#WORKING ON THE WINDOW
root=tk.Tk()
root.title('HB Converter')
root.geometry('250x130')
root.resizable(False, False)

#LABEL INPUT
label_top=tk.Label(root,text='INPUT ANYTHING TO CONVERT').pack()

#NUMBER TO CONVERT
number=tk.Entry(root,text='',bd=1)

#CONVERT BUTTON
button=tk.Button(root, text='convert',bd=0,command=clicked)
button.place(x=150,y=17)
y=button.invoke()

def try1():
    try:
        bin(int(number.get()))
    except ValueError:
        print()
def try2():
    try:
        hex(int(number.get()))
    except ValueError:
        print()

#ENTRY BOX BIN
number_bin=tk.Entry(root,text=try1(),bd=1).place(x=60,y=73)
#ENTRY BOX HEX
number_hex=tk.Entry(root,text=try2(),bd=1).place(x=60,y=100)
#BIN LABEL AND HEX LABEL
label_top3=tk.Label(root,text='bin').place(x=10,y=75)
label_top4=tk.Label(root,text='hex').place(x=10,y=101)

number.place(x=7,y=20)

root.mainloop()```
tawdry mulch
#

No bro

magic tide
#

Oh sry

tawdry mulch
#

!code

#

!code

magic tide
#
import time
import tkinter as tk

def clicked():
    global x
    try:
        x=print(int(number.get()))
    except ValueError:
        print()

#WORKING ON THE WINDOW
root=tk.Tk()
root.title('HB Converter')
root.geometry('250x130')
root.resizable(False, False)

#LABEL INPUT
label_top=tk.Label(root,text='INPUT ANYTHING TO CONVERT').pack()

#NUMBER TO CONVERT
number=tk.Entry(root,text='',bd=1)

#CONVERT BUTTON
button=tk.Button(root, text='convert',bd=0,command=clicked)
button.place(x=150,y=17)
y=button.invoke()

def try1():
    try:
        bin(int(number.get()))
    except ValueError:
        print()
def try2():
    try:
        hex(int(number.get()))
    except ValueError:
        print()

#ENTRY BOX BIN
number_bin=tk.Entry(root,text=try1(),bd=1).place(x=60,y=73)
#ENTRY BOX HEX
number_hex=tk.Entry(root,text=try2(),bd=1).place(x=60,y=100)
#BIN LABEL AND HEX LABEL
label_top3=tk.Label(root,text='bin').place(x=10,y=75)
label_top4=tk.Label(root,text='hex').place(x=10,y=101)

number.place(x=7,y=20)

root.mainloop()```
tawdry mulch
#

Perf

#

Someone will help you soon hopefully now

magic tide
#

Oh wata fak?!

#

Lmao

#

I thought u were gonna help me lol

rapid elbow
#

Is there a software that allows me to design a GUI by just dragging and dropping objects onto a canvas/frame. For example, a section for the design and a section for the code.

magic tide
#

In order to design GUI apps you need to code positions. Like (x=-17,y=22)

rapid elbow
magic tide
#
import time
import tkinter as tk

def clicked():
    global x
    try:
        x=print(int(number.get()))
    except ValueError:
        print()

#WORKING ON THE WINDOW
root=tk.Tk()
root.title('HB Converter')
root.geometry('250x130')
root.resizable(False, False)

#LABEL INPUT
label_top=tk.Label(root,text='INPUT ANYTHING TO CONVERT').pack()

#NUMBER TO CONVERT
number=tk.Entry(root,text='',bd=1)

#CONVERT BUTTON
button=tk.Button(root, text='convert',bd=0,command=clicked)
button.place(x=150,y=17)
y=button.invoke()

def try1():
    try:
        bin(int(number.get()))
    except ValueError:
        print()
def try2():
    try:
        hex(int(number.get()))
    except ValueError:
        print()

#ENTRY BOX BIN
number_bin=tk.Entry(root,text=try1(),bd=1).place(x=60,y=73)
#ENTRY BOX HEX
number_hex=tk.Entry(root,text=try2(),bd=1).place(x=60,y=100)
#BIN LABEL AND HEX LABEL
label_top3=tk.Label(root,text='bin').place(x=10,y=75)
label_top4=tk.Label(root,text='hex').place(x=10,y=101)

number.place(x=7,y=20)

root.mainloop() 

I got issues with this, i need to make x global and transform it into an integer

#

Some helps would be really appreciated because in a week i didn't find an answer

final escarp
#

Hi, I'm trying to recreate my Figma design, is it possible to make something like the selected layer in Figma? I use Tkinter btw

final escarp
mighty rock
#

There is a drop down selecting widget like the one shown in the screenshot, and you can always create new secondary windows using a Toplevel widget

#

Let me find you the menu widget

final escarp
#

ah thank you!

mighty rock
#

It's called OptionMenu, you import it as you import any other tkinter widget

mighty rock
#

You could try tkinter.ttk.ComboBox, too. tkinter.ttk provides new widgets, some of which are remakes of existing widgets. They are supposed to look more.. modern, and you can style some of them more than tkinter widgets.

#

To style these widgets you need to use a Style object

buoyant fulcrum
#

in my opinion having used both, TTK combo box is much much better than option menu

#

So guys, I need some help with GUI layout

#

Does this look like a bad GUI layout?

#

It's a toplevel window used to edit a specific feature

ripe shuttle
mighty rock
tawdry mulch
magic tide
#

Ty

#

I need to get the output of "button" and store it into a variable

#

But integer

tawdry mulch
magic tide
#

Oh yes sorry

tawdry mulch
#

Okay not output, input*

#

Did you do any tkinter tutorials?

magic tide
#

No

#

I want the output

#

But i want it after clicking it not when the program is executed

tawdry mulch
#

I might be able to give you the answer here, but you will encounter more problems if you dont go through a basic tutorial and understand how tkinter works

#

Basically you want to show the output of the functions in the entry widgets after the button is clicked

magic tide
#

Yep

#

I got tkinter inported as tk

tawdry mulch
#
import tkinter as tk

#WORKING ON THE WINDOW
root = tk.Tk()
root.title('HB Converter')
root.geometry('250x130')
root.resizable(False, False)

def clicked():
    # Clear the entries first
    number_bin.delete(0,'end')
    number_hex.delete(0,'end')

    try:
        inp = int(number.get()) # Get the input and covert to int

        # Conver the input
        binary = bin(inp) 
        hexa = hex(inp) 

        # Insert the converted values onto the respective widgets
        number_bin.insert('end',binary)
        number_hex.insert('end',hexa)
    
    except ValueError:
        print('Input proper numbers')
        return

#LABEL INPUT
tk.Label(root,text='INPUT ANYTHING TO CONVERT').pack()

#NUMBER TO CONVERT
number = tk.Entry(root,bd=1)
number.place(x=7,y=20)

#CONVERT BUTTON
button = tk.Button(root, text='convert',bd=0,command=clicked)
button.place(x=150,y=17)

#ENTRY BOX BIN
number_bin = tk.Entry(root,bd=1)
number_bin.place(x=60,y=73)

#ENTRY BOX HEX
number_hex = tk.Entry(root,bd=1)
number_hex.place(x=60,y=100)

#BIN LABEL AND HEX LABEL
tk.Label(root,text='bin').place(x=10,y=75)
tk.Label(root,text='hex').place(x=10,y=101)

root.mainloop()
magic tide
#

Ok

#

Imma try later

#

Now i have other work to do

#

Thank you

tawdry mulch
tawdry mulch
jolly flower
buoyant fulcrum
#

Yes

jolly flower
#

looks so clean as if its a C# form app

#

how is that

#

like the buttons style

#

and the sort of text

buoyant fulcrum
#

I used ttk buttons

jolly flower
#

how

#

its so different

#

to me

#

mine looks so garbage and old

#

idk how people could make some nice form apps look ,like this with tkinter

buoyant fulcrum
#

1 sec

#
root = Tk()
root.geometry("700x700")        

button1 = tk.Button(root, text = "TK Button")
button1.pack(pady = 10, padx = 10)

button2 = ttk.Button(root, text = "TTK Button")
button2.pack(pady = 10, padx = 10)

root.mainloop()
jolly flower
#

oh

#

is that yours?

buoyant fulcrum
#

thats just some sample code

jolly flower
#

yea i just want to see how is that

#

cool

#

thanks

buoyant fulcrum
#

np

#

try ComboBoxes too, they are amazing

jolly flower
#

oh

#

yes

magic tide
#

My friend that has already finished school told me that for GUI, pygame is the best library

jolly flower
# magic tide My friend that has already finished school told me that for GUI, pygame is the b...

Dear ImGui is a GUI library for C++ that has Python bindings. Let's see how to use these Python bindings, and then go through the process of adding a more Pythonic interface to the library by added context manager "with" statement support.

Note: the PR in this video has been ACCEPTED! Coming to a release near you soon!

― mCoding with James Mur...

▶ Play video
#

its not relevant but idk

jolly flower
#

trnn

jolly flower
#

cuz i had a problem with some things that are undefined

#

oh ok

#

nvm

#

i got it

#

bruh the buttons style

#

looks ass

jolly flower
#

oh i got nvm again

#

lol

nimble sierra
#

hay guys i have a problem

#

who will help me out with a math

buoyant fulcrum
#

Did it work?

tawdry mulch
#

u can ask and v vl help u out

digital rose
#

fastest and easiest way to make Linux GUIs?

#

not using tkinter it's a pain in the ass

stray jackal
#

use Pygame for the hi-res screen and Tkinter for the click - click interface

buoyant fulcrum
#

Pyqt5 is an alternative to Tkinter. It’s difficult to learnt though (so I’ve heard)

jolly flower
#

sus

full marlin
stray jackal
#

WOWEEEEE!!!

digital rose
#

why does my program crash

#

it just stops working and says (not responding) everytime

final escarp
tawdry mulch
magic tide
#

Root is meant to be the window variable, for example root = Tk()

fleet lynx
#

How can I update my Tkinter Gui and then return to the main code? So I have a program like this:

while True:
   x = int(input("x:"))
   y = x*x
   update_gui(y) # how do I implement a function like this?
ripe shuttle
#

(assuming you imported tkinter as tk and named your base window as root)

fleet lynx
#

But I want to update the window with some information that I computed ( the variable y in my case) how do I do that?

ripe shuttle
#

For instance, if you were adding the info in the form of a label, you create the label and position it. tkinter would automatically update the gui. I add the tk.Tk.update(root) as good measure.

#

say you want to update a name.

import tkinter as tk

#YOUR CODE HERE

def update_name():
  Label(root, text=text).pack()
  tk.Tk.update(root)

#Shows the lebel on screen.
fleet lynx
#

It seems to work!!

#

Do I need root.mainloop anywhere?

fleet lynx
#

Any way to fix that (I would guess I need threading)

river steeple
#

@full marlin this is sick

jolly flower
#

and easy

jolly flower
#

for it

buoyant fulcrum
#

Oh cool

jolly flower
#

it makes you feel like if youre making a C# form app but its with python source

fierce nova
#

can i ask about react + python here or no

final escarp
#

nvm found it

final escarp
sleek hollow
#

Does anyone know how I can maintain a stretch (QSpacerItem) at the end of my vbox items?

#

I have a vbox I dynamically add buttons to but I want it to always end with a stretch

#

right now I'm thinking of removing the stretch, adding the new button, then adding the stretch back in, but that seems excessive. Can I simply reorder the vbox?

sleek hollow
#

ahh found the solution, there's an insertWidget method

tawdry mulch
tawdry mulch
tawdry mulch
fleet lynx
# tawdry mulch `after()` exists

How does it work/ how would you implement it?
I want something like this: ```py

this could also be handled in a class

root = tk.Tk()
txt = tk.Text(root)

put a few lines of text on txt

txt.pack()

while True:
line_num = int(input("line num"))
highlite_line(line_num)

I know how to highlight a line with `txt.tag_options` and so on, but I don't know how to use `after`. Maybe you need an `on_idle` function 🤷
#

How would you implement highlight_line

mild flume
#

anyone here a multiprocessing expert?

crisp pier
#

How can I make a window unselectable?

#

in tkinter

#

I am trying to make the root not be able to be clicked

#

so whenever you click it will just pass through it

#

I have it set to be always on top

#

since it is kind of a overlay

crisp pier
#

How would I also hide the root

tawdry mulch
crisp pier
tawdry mulch
mortal crag
#

i need help on tkinter problems

#

anyone could help me

#

it is my first time using classes with tkinter

#

i got some errors here and idk how to repair it for my class

ebon raft
#

hi guyssssssssssss

scenic sun
#

is TKinter used for Just GUIs?

mighty rock
#

Yes

unique forge
unique forge
digital rose
#

pyside6

#

fast af

#

and painless too!

unique forge
brittle smelt
#

Hmmm

final escarp
#

How to make a button disable if combobox is empty in tkinter? Thanks

mortal crag
#

may i ask what is keyword arguments in python

mortal crag
final escarp
#

yeah but idk how to make a condition if the combobox is empty

mortal crag
#

so maybe u can say like if .get() the entrybox == "" then ...

final escarp
sinful pendant
#

Tkinter canvas while drawing sucks at this thing, the line isnt continuous when moise moves so fast

tawdry mulch
mortal crag
#

ok noted

mighty rock
sinful pendant
#

But the points arent continuous

mighty rock
#

Yeah. I think it might be a limitation of the mouse, its update intervals might not be small enough

#

I know that Windows doesn't store mouse positions, but rather offsets (notice how each time you start a Windows computer, your mouse is set at the center of the screen)

#

So in each update, it tells the operating system how right or down it moved

sinful pendant
#

It seems like it has missed some points, but then how paint gets this all right

#

I think i need to manually comnect the dot with revording each last location 😅

#

Yeah boiii big brain plau 😀

#

🤣 new problem arrived, that when width is at 10 it still gives some edge problem

#

I think i need to draw tiny circles

ripe shuttle
sinful pendant
#

So edges arnt smooth

midnight kestrel
#

Hey! I'm programming a typing game with tkinter and I was wondering if anyone had an idea how to make a stylier user interface 🙂

feral crow
umbral oracle
#

what library would u guys recommend for a beginner

#

to GUIs

umbral oracle
#

whats the diff between that and pyside other than licence?

fleet iron
#

but you can with pyside

full marlin
rain quarry
deep knoll
tribal path
#

for loop through images

sinful pendant