#user-interfaces

1 messages ยท Page 58 of 1

digital rose
#

imma research

#

do you want example

#

already made photo :/

#

no

#

ok

#

how do i out photo on window?

#

put*

#

example?

#

you can place it on Label or Frame or Button

#

ok

#

what is parameter name?

#

Photoimage

#

ok

#

thx

#

but there is some steps before that

#

thx
@digital rose you're welcome

#

is photoimage a widget?

#

no

#

it's to open image

#

then put it

#

on any widget

#

example:

from tkinter import *
from PIL import ImageTk, Image
import os

root = Tk()
img = ImageTk.PhotoImage(Image.open("c:\\Users\Shihab\Desktop\M1z4UJsahf.png"))
panel = Label(root, image = img)
panel.pack(side = "bottom", fill = "both", expand = "yes")
root.mainloop()
#

output:

#

sec

#

is PIL required?

#

no

inland notch
#

example:

from tkinter import *
from PIL import ImageTk, Image
import os

root = Tk()
img = ImageTk.PhotoImage(Image.open("c:\\Users\Shihab\Desktop\M1z4UJsahf.png"))
panel = Label(root, image = img)
panel.pack(side = "bottom", fill = "both", expand = "yes")
root.mainloop()

@digital rose Instead of going to a location on your desktop, you can just but the photo in the project file

digital rose
#

You mean the relative path?

#

is not work lemon_pensive

#

look

inland notch
#

I'm sure it does. I've used it before

digital rose
#

like this

#
from tkinter import *
from PIL import ImageTk, Image
import os

root = Tk()
img = ImageTk.PhotoImage(Image.open("M1z4UJsahf.png"))
panel = Label(root, image = img)
panel.pack(side = "bottom", fill = "both", expand = "yes")
root.mainloop()
inland notch
#

weird

digital rose
#

is not get the relative path

#

weird
@inland notch ?

inland notch
#

it's weird how it's not working

digital rose
#

yeah

#

maybe I want to tell he to get the relative not the abslute

#

How

#

I don't know

#

I fixed it

#

I just import the os library

#

then

#

I was adding str prop

#

then

#

the same name of the prop

#

I make this

#
os.path.join(os.path.dirname(__file__), path)
#

like this

#
path = 'M1z4UJsahf.png'
path = os.path.join(os.path.dirname(__file__), path)
#

this

#

join

#

or

#

get the file path in relative

#

that mean c:\\Users\Shihab\Desktop then join it with file name M1z4UJsahf.png

#

from the realtive path

#

get the abslute

#

then join it with the name

#

then boom

inland notch
#

can you convert hex codes to rgb values?

digital rose
#

yes

#

wdym

#

you mean get the hex number

#

then

inland notch
#

yeah

#

wait no

digital rose
#

convert it to rgb values

inland notch
#

Yes

#

that

digital rose
#

ah

#

this

inland notch
#

I mean via code

digital rose
#

?

inland notch
#

I mean can I right code in python to convert a hex code to rbg values

digital rose
#

ah

#

maybe yes

#

I don't really sure

#

@inland notch

#

in tkinter how can i set the font in a stringvariable?

#

easy

#
from tkinter import *
root = Tk()
font = ("arial", # The font name
        20, #size of the font
        "bold") # second font
Label(root, text="Hello World :D", font=font).pack()
root.mainloop()
#

nonono

#

i mean

#

i make a stringvariable, i set the text in it

#

wait

#

nvm

inland notch
#
        if rgbval[0] <= 255:
            Mainmenucanvas.itemconfig(playbutton, fill=_from_rgb((rgbval[0]+1, rgbval[1], rgbval[2])))```
```def _from_rgb(rgb):
    return "#%02x%02x%02x" % rgb


def _from_hex(hex):
    h = hex.lstrip('#')
    return tuple(int(h[i:i + 2], 16) for i in (0, 2, 4))```
this code isn't working?
#

nvm

digital rose
#

i make a stringvariable, i set the text in it
@digital rose ah

#

You mean

#

like this

#
from tkinter import *
root = Tk()
text_var = "Hellow World :D"
Label(root,text=text_var).pack()
root.mainloop()
#

yes

#

ah cool

#
        if rgbval[0] <= 255:
            Mainmenucanvas.itemconfig(playbutton, fill=_from_rgb((rgbval[0]+1, rgbval[1], rgbval[2])))```
```def _from_rgb(rgb):
    return "#%02x%02x%02x" % rgb


def _from_hex(hex):
    h = hex.lstrip('#')
    return tuple(int(h[i:i + 2], 16) for i in (0, 2, 4))```
this code isn't working?

@inland notch this is stranger

#

new avatar

sly horizon
#

so is there now a not-bad way of making cross-platform pygame2 games?

#

or cross platform in general

#

I know things have changed since I used kivy a few years ago

#

I have read that pygame2 is basically modern now

#

and there are alternatives to kivy now

#

and that pygame2 works with most things now? Anyone have experience?

#

If I wanted to just jump in and make an android game with python

#

and have it not be shit

#

what should I use?

eager beacon
sly horizon
#

I thought people who do UI stuff would know faster

#

it is still pretty cutting edge stuff

eager beacon
#

I think Kivy has a way to create android apps but I don't know much about the pros and cons of using it over java/kotlin

sly horizon
#

It does but it's not native and it's not that good TBH. Massive pain in the ass to use, and I haven't tried it with the new pygame yet

eager beacon
#

I can't remember or not if beeware had a solution to running python on android or not.

sly horizon
#

I believe so. I'm just looking for suggestions though. I know quite a few things work now, but working and being practical are different things

#

I will ask #game-dev too

bleak dock
#

I posted a question about what I'm pretty sure is an easily confirmable bug in plotly in #help-carrot, can someone take a look?

fervent current
#

Is tkinter the best ui to use ??

eager beacon
#

If you already know tkinter and don't know other frameworks then it is

digital rose
#

tkinter is trash but it is fun

inland notch
#

it's not trash

icy crane
#

Tkinter is kinda easy to use.

inland notch
#

Yeah. might be a little slow, but it's really good

digital rose
#

if all you need is a basic UI

#

I like it and the canvas is underrated but it doesn't handle graphics very well

inland notch
#

I'm making a game, and tkinter is perfectly fine

eager beacon
#

tkinter lacks customization functionality

#

someone here asked how to modify a table widget so that the header row would be a few pixels taller than the data rows

#

but the header row seems to be connected directly to the row height

#

there are a lot of little things like that example that make it harder to work with when you want to customize the UI

#

it also doesn't have the greatest documentation

inland notch
#

effbot is GREAT documentation

eager beacon
#

I would agree that it's the best documentation that is available

digital rose
#

Hi

eager beacon
#

hello

digital rose
#

are u have a problem ?

eager beacon
#

Nope

#

Are you?

digital rose
#

ah cool

#

Are you?
@eager beacon nope

eager beacon
#

alright then

digital rose
#

but

#

I really want to make alpha bg in widgets

eager beacon
#

what are you using?

digital rose
#

Tkinter

eager beacon
#

as far as I know you can either have an alpha on all of your widgets or none but you can't do it on a widget by widget basis

digital rose
#

yeah

#

this my big problem

eager beacon
#

tkinter lacks customization functionality
@eager beacon
This is a good example of what I was saying earlier

digital rose
#

yeah

uncut silo
#

any GUI that I can learn (please don't put tkinter)

inner nest
#

Pyside2, PyQt5 or wxpython for example

solemn cloud
#

YES I KNOW I HAVENT ACTIVATED WINDOWS IGNORE IT ๐Ÿ˜‚

digital rose
#

ah cool

#

keep going

indigo crypt
#

i dont know if any of you are familiar with the brand Supreme, but their clothes sellout in seconds so i coded a bot to checkout for me. this is the UI i made in tkinter for it

#

made it photoshop but the buttons and labels are all overlayed in tkinter

digital rose
#

wow thats amazing

sinful chasm
eager beacon
#

@sinful chasm what OS are you using

#

can you show the code where you start the app?

sinful chasm
#

The code works when its in venv. The problem is when i try to run it via daemon

merry mulch
#

Is it running without an X server?

sinful chasm
#

I guess so? I didnt set one up (new to this)

merry mulch
#

When you say "run it via daemon", what do you mean exactly?

eager beacon
#

Are you using Threading.daemon or something different

sinful chasm
#

So i can control the app over systemctl

#

Im using normal threading in form of a function decorator

eager beacon
#

can you show the code?

#

you can't start the app in a thread you created

#

if thats what your doing

merry mulch
#

I'm not super-familiar with doing it in systemd, but you should make your app start after X has started

eager beacon
#

if you are, move application out and run it before any other stuff

solemn cloud
digital rose
#

anyone know how to make something like Snipping Tool for windows with tkinter

#

i press "New", draw a rectangular area by dragging my cursor, and then it uploads the screenshot to my django server

mighty gale
#

how would I implement flood fill on a tkinter canvas (non array based because it is a paint program)

inner nest
#

I'm having fun on a side project application to manage recipes and their various stages of preparation. I am using tkinter
for the interface and the data are in a sqlite file managed with SQLAlchemy.
I'm still quite a beginner on python and OOP but I'd like to apply the object paradigm to my project to train myself.
For the moment the data part works but I have difficulties to link my data with my interface.

For now, I have created different "views" that inherit from the tk.Frame class. I would like to be able to navigate between these differents frames by displaying and hiding them.
I manage to do this when the content is fixed by creating a dictionary with the frames inside that I manage with a function where I forget the current frame and display the new frame.
But I can't do it when the content of the frames has to be dynamically generated according to the user's behaviors.
with the data of the database
. I couldn't find similar projects on github or advanced tutorials. I would like to have your suggestions. Thanks !

application.py extract :

App(Tk):
    def __init__(self, *args):
    Tk.__init__(self, *args)
    self.frames = dict()
    self.frames["home"] = Homepage(root=self) # self is the parent widget of homepage
    self.frames["showrecipes"] = ShowRecipes(self)
    self.current_frame = self.frames["home"]
    self.current_frame.pack

    def frame_handler(self, new_frame):
    self.current_frame.pack_forget()
    self.current_frame = self.frames[new]
    self.current_frame.pack()
digital rose
#

hi

digital rose
#

when I run tkinter in VScode it gives me 100 errors and it says import error wildcat

#

does anybody know how to fix it?

plain elk
#

disable the linter

digital rose
#

disable the linter
@plain elk thank you! It worked!

quasi sinew
#

what is the easiest way to create a GUI with 'draggable' elements snapped to irregular grid?

rotund vault
#

what is the easiest way to create a GUI with 'draggable' elements snapped to irregular grid?
@quasi sinew

PyQT/QTDesigner? Unless you mean, drag widgets around while running. Then I've got no idea ๐Ÿ˜‹

quasi sinew
#

yes, while running

#

i found out about tkinter, reading up rn,
i think its the highest level i can get for this task

#

found nothing more specific

rotund vault
#

Hmm I have no idea

#

I'm very far from an expert though

#

Irregular grid makes it a hard one

crystal sentinel
#

how can i change a tkinter variable from outside the class its made in?

class LoginPage(Frame):
    def checkLogin(self,controller):
        caller = MenuPage(self,controller)
        caller.setUserInfo()

class MenuPage(Frame):
    def __init__(self,parent,controller):   
        Frame.__init__(self,parent)    
        self.infoVar = StringVar(parent)
        self.infoVar.set("first str")
        label1 = Label(self,textvariable = self.infoVar)
        label1.pack()
    def setUserInfo(self):
        self.infoVar.set("second str")

in the code above, i need infoVar to be "second str" but its still "first str" ty in advance

royal pebble
#

Guys, just a beginner question about tkinter:

What exactly the **update_idletasks() **function does? Any examples?

unique forge
#

Hi, I have a self.ui.spinBox and I would like the value of the spinbox to be set as the font size for the whole app. I have this line of code to grab the value, and it works perfectly value = self.ui.spinBox.value() but I cant figure out how to change the font size. Thanks, Famous8

whole dagger
#

iirc you can use stylesheets to set the "font-size" to something. (Assuming this is PyQt5) @unique forge

digital rose
#

@crystal sentinel wdym

#

ah

#

I know now

crystal sentinel
#

sorry i didn't really explain

digital rose
#

why you make Stringvar() there is another way better to change the text of widgets

#

sorry i didn't really explain
@crystal sentinel no problem

crystal sentinel
#

oh is there another way?

digital rose
#

yes

#

the .configure

crystal sentinel
#

ok thankk youu i will look into that

digital rose
#

You're welcome

#
class LoginPage(Frame):
    def checkLogin(self,controller):
        caller = MenuPage(self,controller)
        caller.setUserInfo()

class MenuPage(Frame):
    def __init__(self,parent,controller):   
        Frame.__init__(self,parent)    
        self.label1 = Label(self,text = "First Text")
        self.label1.pack()
    def setUserInfo(self):
        self.label1.configure(text="second text")
crystal sentinel
#

hmm i still have the same problem

#

it works if it call it from the same class, but not from a different class

#

i think its because the self is different?

digital rose
#

can you screenshot for error please

#

you mean error not defined?

#

or another error

#

hello?

#

@crystal sentinel

crystal sentinel
#

theres no error, the text just doesn't change

digital rose
#

because you doesn't call the function correct

crystal sentinel
#

oof

digital rose
#

you call it from widget

#

sec'

#

is not widget

crystal sentinel
#

im not sure what you mean

digital rose
#

I think there is no problem with you'r code

#

but

#

you don't make -master option actually no problem but maybe from this because I don't see any problem

#

stranger

crystal sentinel
#

hmm

digital rose
#

maybe you want to make timer then run the function

#

timer = w.after(time, callback)

#

w is var

crystal sentinel
#

what would that do though?

digital rose
#

wait time then run the func

#
class LoginPage(Frame):
    def checkLogin(self,controller):
        caller = MenuPage(self,controller)
        caller.after(20, setUserInfo)

class MenuPage(Frame):
    def __init__(self,parent,controller):   
        Frame.__init__(self,parent)    
        self.label1 = Label(self,text = "First Text")
        self.label1.pack()
    def setUserInfo(self):
        self.label1.configure(text="second text")
crystal sentinel
#

setUserInfo not defined, not sure about that

digital rose
#

ah

#

just add caller. befor it

#
class LoginPage(Frame):
    def checkLogin(self,controller):
        caller = MenuPage(self,controller)
        caller.after(20, caller.setUserInfo)

class MenuPage(Frame):
    def __init__(self,parent,controller):   
        Frame.__init__(self,parent)    
        self.label1 = Label(self,text = "First Text")
        self.label1.pack()
    def setUserInfo(self):
        self.label1.configure(text="second text")
crystal sentinel
#

no errors, but it still didn't work

digital rose
#

hmm

crystal sentinel
#

indeed

unique forge
#

@whole dagger how can I use Style Sheets?

whole dagger
#

You can try spinBox.setStyleSheet("font-size: 20px"). Alternatively something higher/lower than 20 if that's what u want

inner roost
#

I have a very odd problem. I've been using blessed for a while to colorize terminal output. But when I import either librosa or pytorch, the colorization doesn't work and I'm stuck with 16 colors.
edit: nvm, I figured it out. Somewhere along the import process stdout and stderr were being replaced by some wrappers that don't work well with blessed. py sys.stdout = sys.__stdout__ sys.stderr = sys.__stderr__
fixes it

uncut pawn
#

I am trying to use PyQt5? But I am having some problems "Undefined variable 'QApplication', 'Undefined variable 'QPushButton' and 'Undefined variable 'QMainWindow' what do I do?

unique forge
#

import them

#

@uncut pawn please send the code

#

@whole dagger what if I want to set the font size to a variable

#

also im trying to change the font size for the WHOLE entire app

digital rose
#

what module you're using?

uncut pawn
#

PyQt5

#

@unique forge

unique forge
#

ok

#

do this

#
from PyQt5.QtWidgets import (QApplication, QMainWindow,)
from PyQt5 import QtWidgets
uncut pawn
#

do I add that

#

on my code

unique forge
#

replace it

uncut pawn
#

all

unique forge
#

with the top two lines

uncut pawn
#

k

unique forge
#

actually

#

add it on

uncut pawn
#

no it did not

unique forge
#

but remove the first line

#

also change QPushButton to self.QPushButton

uncut pawn
unique forge
#

dont import QPushButton

uncut pawn
#

it still has the same problem

whole dagger
#

@unique forge you can set the stylesheet for your main widget, if you want a global font size

unique forge
#

ok

whole dagger
#

And what do you mean by set the font size to a variable?

unique forge
#

can you tell me how

#
value = self.ui.spinBox.value()
uncut pawn
#

What about me

unique forge
#

run the code

whole dagger
#

And you want value to be the font size of your application?

uncut pawn
#

it does not work

unique forge
#

yes @whole dagger

#

what is the error @uncut pawn

uncut pawn
#

Traceback (most recent call last):
File "c:\Users\Owner\Downloads\GUI\GUI2.py", line 44, in <module>
window = Window()
File "c:\Users\Owner\Downloads\GUI\GUI2.py", line 17, in init
self.UiComponents()
File "c:\Users\Owner\Downloads\GUI\GUI2.py", line 26, in UiComponents
button = self.QPushButton("CLICK", self)
AttributeError: 'Window' object has no attribute 'QPushButton'

unique forge
#

ok

#

did you change it to self.QPushButton

uncut pawn
#

yes

unique forge
#

try importing it

#

from QWidgets

uncut pawn
#

how do I do that

unique forge
#

what you just did

#

top line

#

do that

#

import QPushButton

uncut pawn
#

does not work

unique forge
#

also there is a easier way to create GUI's

#

you can install QT Designer

#

which is a drag and drop interface

#

which does all of this code fore you

#

you seem like a beginner

uncut pawn
#

I am

unique forge
#

and QT Desinger would be very helpful for you

uncut pawn
#

BUt I want to learn HOw to code

unique forge
#

also do you know the basics of Python

#

QT Designer still requeires code

uncut pawn
#

Will I use Tkinter and made a interface

unique forge
#

Tkinter is good

uncut pawn
#

NOt I just Started with PyQT5

whole dagger
#

Basically what you need to do is
widget.setStyleSheet(f"font-size: {value}px") where widget is your central widget of your app. ( @unique forge )

unique forge
#

yes

#

use QT Designer

#

you still have to program AFTER you create the GUI

uncut pawn
#

I want to code

unique forge
#

yes

#

do you know the basics of python?

uncut pawn
#

I think so

unique forge
#

because you didnt seem to know what importing is

uncut pawn
#

IMporting is want you want to import a Module like Pyqt and others

#

TKinter

unique forge
#

yes

#

ok

#

well QT Designer still requires code

uncut pawn
#

I read a book

#

Fine

unique forge
#

so try out QT Designer

#

I used it and thought you didnt have to code

#

but you did

uncut pawn
#

Do I use pip install Qt Designer

unique forge
#

no

#

you go to the website and install the exe

uncut pawn
#

k

#

thx

#

cya

unique forge
#

let me send the link

#

@uncut pawn

#

@whole dagger when I change the value of spinbox, the font doesnt change, instead it shuts down the app

whole dagger
#

Do you call a function when the value is changed?

unique forge
#

yes

#
self.ui.spinBox.valueChanged.connect(self.fontChange)
#
def fontChange(self):
        value = self.ui.spinBox.value()
        widget.setStyleSheet(f"font-size: {value}px")
#

@whole dagger

whole dagger
#

Well, widget is supposed to be your central widget, I just named it widget because I don't know what yours is named

unique forge
#

oh

#

ok

#

how do I name my central widget

#

wait

whole dagger
#

You most likely have one. Did you generate your code using designer?

unique forge
#

its called centralwidget

whole dagger
#

Yeah

unique forge
#

yes

#

QT Designer

whole dagger
#

Try doing self.centralwidget instead of widget

unique forge
#

ok

eager beacon
#

and put an ; at the end of your string

unique forge
#

Thank you so muchj

#

it works

#

can you help me with another thing

whole dagger
#

Sure

unique forge
#

I have a copy button

#

that should copy the text in a variable

#

here is the code

#
def copysqr(self):

        clipboard = QApplication.clipboard()
        clipboard.setText(s2)
#

but again

#

the app shuts down

#

every time I press the button

#

actually, i need help with a lot of things

eager beacon
#

what OS?

unique forge
#

Windows

#

its the same app you helped me develop a while ago

#

what does !help have to do with this

#

what are you doing

#

please stop

eager beacon
#
clipboard.clear(mode=clipboard.Clipboard)
setText(s2,mode=clipboard.Clipboard)
unique forge
#

Things I want to do. 1. Create a Layout in QT Designer without changing the location of all the widgets 2. Make the QLineEdits expand or resize to the length of the text 3. Make the copy buttons work

#

@quasi slate what are you doing

#

please stop

#

why do you keep doing !help

whole dagger
unique forge
#

ok

#

but thats not how you do it

#

you take a available help channel

#

@eager beacon I added the new code but it still shuts down the app

eager beacon
#

hmm

#

what are you copying text from and what is the text?

unique forge
#
def showsqr(self):
        s1 = float(self.ui.lineEdit.text())
        squared = s1*s1
        s2 = str(squared)
        self.ui.lineEdit_2.setText(s2)
#

@eager beacon the code

eager beacon
#

oh lol

#

its because s2 isn't defined in the copy

unique forge
#

oh

#

@quasi slate why are you back

#

get a help channel

#

and ask your question there

#

thats not how you get help

#

@eager beacon what should I do

#

should I make a new variable

#
copys2 = s2
eager beacon
#

that won't work either

#

it needs to be self.s2

#

or you need to accept an argument in the copy function

#

and pass the text to copy on press

#

I actually shouldn't have said or

#

the variable needs to be saved some how and self.s2 is the easiest way

unique forge
#

im back

#

should I do ```py
clipboard.clear(mode=clipboard.Clipboard)
setText(self.s2,mode=clipboard.Clipboard)

#

@eager beacon

eager beacon
#

yes

unique forge
#

the code ends again

#

and the app shuts down

#
 def copysqr(self):
        clipboard.clear(mode=clipboard.Clipboard)
        setText(self.s2,mode=clipboard.Clipboard)
#

the code

#

@eager beacon

eager beacon
#

show me setText

unique forge
#

?

eager beacon
#

setText

unique forge
#

what about it

eager beacon
#

oh you coped the answer

#

its supposed to be clipboard.setText

unique forge
#

oh

#

ha

#

it still doesnt work

#

it still shuts down the app

#

without copying the text

#

@eager beacon

#
def copysqr(self):
        clipboard.clear(mode=clipboard.Clipboard)
        clipboard.setText(self.s2,mode=clipboard.Clipboard)
eager beacon
#

thats because you removed clipboard = QApplication.clipboard()

unique forge
#

oops

#

still doesnt workk

#
def copysqr(self):
        clipboard = QApplication.clipboard()
        clipboard.clear(mode=clipboard.Clipboard)
        clipboard.setText(self.s2,mode=clipboard.Clipboard)
eager beacon
#

lets see showsqr

unique forge
#
def showsqr(self):
        s1 = float(self.ui.lineEdit.text())
        squared = s1*s1
        s2 = str(squared)
        self.ui.lineEdit_2.setText(s2)
#

@eager beacon

#

any suggestions

eager beacon
#

well you never set s2 to self.s2

#

so that would be a good starting point

unique forge
#

it worked!

#

thank you so much

#

I now want to complete these tasks

#
  1. Create a Layout in QT Designer without changing the location of all the widgets 2. Make the QLineEdits expand or resize to the length of the text
#

@eager beacon

eager beacon
#

I don't use QtDesigner often so I can't help with that

unique forge
#

ok

eager beacon
#

i guess you could use self.line.fontMetrics().width(self.line.text())) to set the width in a function that connects to textChanged

unique forge
#

ok

#

but the thing is

#

there is a lot of LineEdits

#

20 to be exact

eager beacon
#

then in the function use self.sender() instead of the specific self.line

unique forge
#

ok

eager beacon
#

just to clarify

unique forge
#

like this

#

self.ui.sender.fontMetrics().width(self.ui.sender.text()))

eager beacon
#

you will need to refine that

unique forge
#

ok

#

by doing what

eager beacon
#

well for one that doesn't set the width of anything

unique forge
#

ok

eager beacon
#

it only returns the width of the text

unique forge
#

how would I set the width to the length of the text

eager beacon
#

and 2, i don't think you want to enter an empty line edit thats 200 pixels wide and type a letter and have it shrink down to 2px

unique forge
#

yeah

#

I just want it to expand

eager beacon
#

same way you set a width on any widget with the code i sent you as the width

unique forge
#

I guess I will leave those things for the next update

digital rose
#

what is you'r problem @unique forge ?

unique forge
#

Hi

#

arent you the guy who doesnt know PyQT

#

only Tkinter

digital rose
#

yeah

unique forge
#

you cant help then

#

its a PyQT question

digital rose
#

ah sorry

unique forge
#

its fine

digital rose
#

๐Ÿ‘

unique forge
#

@eager beacon do you know how to create a layout without QT Designer

digital rose
#

in tkinter, how do i put an image over a checkbox?

uncut pawn
eager beacon
#

is the code not workng?

digital rose
#

hey, can you open qt designer even after you convert to the code? it wont let me

#

ping pls if you have an answer

eager beacon
#

@digital rose what do you mean it won't let you open designer?

#

what happens

unique forge
#

@digital rose what is the problem

#

Does the app not open?

#

How do you convert the ui file

digital rose
#

I translated the code to python on pycharm and I cannot retouch the GUI in qt designer

unique forge
#

Hmm

#

How did you convert

#

With pyuic5?

#

@digital rose

digital rose
#

Yessir

unique forge
#

So you used pyuic5

#

What OS?

#

And what happens when you open QT Designer

#

@digital rose

digital rose
#

Iโ€™m on Mac and

#

It just wonโ€™t let me use QT

#

It wonโ€™t open

unique forge
#

Hmm

#

Why did you close it in the first place?

#

Also im not familiar with Mac

#

So Im not sure if I can help

eager beacon
#

are you using the .ui file?

unique forge
#

Because QT Designer should open

digital rose
#

Well I didnโ€™t chose to close it

#

It close after I translated the code

unique forge
#

The converting with pyuic5 probably has nothing to do with the app not opening

#

Hmm

digital rose
#

Iโ€™m not quite sure, Tbh

unique forge
#

You did use pyuic5

#

Correct

digital rose
#

Yes

unique forge
#

And it worked

eager beacon
#

restart your computer

unique forge
#

Yes

#

Try restarting

#

Did the conversion work?

eager beacon
#

qt creator and designer bug out in weird ways

digital rose
#

I donโ€™t see why i would have to restart my computer

eager beacon
#

i just told you

unique forge
#

QT designer isnt working

#

Restart it

#

And it should work

#

There is some bug

#

Restarting fixes 50% of PC bugs

eager beacon
#

turning it off and back on fixes more things than you'd think

unique forge
#

Yeah

#

So many things happen

#

Once I thought I lost all my data

#

Restart

#

And boom everything is in working order

digital rose
#

Alright

#

Iโ€™ll try

#

Thank you

delicate tendon
#

im am trying to recreate this game and was wondering what would be the most efficient way to make the buttons in tkinter?

next hare
#

is pyqt better than tkinter?

fleet wedge
#

Can't get mouse.move to work anymore and the mouse.click hasn't worked at all? Would there be a better way to code it or?

eager beacon
#

where did you get this mouse thing from?

#

@next hare yes

fleet wedge
#

Umm

#

Pip3 install mouse

eager beacon
#

I'd just never heard about it

#

usually people are using pyinput

fleet wedge
#

oh

eager beacon
#

I think your problem is the sleep

#

you click and go straight into a .5 second sleep

fleet wedge
#

yes

#

It should still click tho correct?

eager beacon
#

why don't you try moving it under the sleep to see what happens

#

I don't know if it will or not

fleet wedge
#

k

eager beacon
#

no idea how its implemented

fleet wedge
#

If not should I swap to pyinput?

#

New to Python so not entirely sure what to be using

eager beacon
#

you would need to significantly change your code if you did

#

so may be best to get this working if possible

fleet wedge
#

kk

eager beacon
#

have you tested outside a loop clicking on things to see if it even works on your machine?

fleet wedge
#

no

#

Probably should lol

eager beacon
#

I would

fleet wedge
#

K

#

It clicks

#

And moves

eager beacon
#

so its the loop or the sleep

#

move it under the sleep

#

.

digital rose
#

in tkinter, how do i put an image over a checkbox?
@digital rose -imageoption

#

is pyqt better than tkinter?
@next hare maybe

next hare
#

wdym

#

maybe

digital rose
#

some things is not in pyqt and another things is not in tkinter

#

as beginner the tkinter is better

digital rose
#

Restarting fixes 50% of PC bugs
@unique forge only on windows though

delicate tendon
#

hey I was wondering if I could please get help with my code in tkinter?

digital rose
#

in tkinter, if you need to tell the user something, like "Enter text here: ", and never use the label again, is it fine to just declare it?

#

You mean

#

Delete Label ?

#

@digital rose

#

no

#

i mean is it ok to just do Label() if u wanna put some text on the screen

#

or to store it in a variable

uncut pawn
#

in my code, it is telling me that "No name 'QApplication' in module 'PyQt5.QtWidgets'" but it works so what do I do?

#

I uninstall PyQt5 and reinstall it. upgraded pip and it still tells me that "No name 'QApplication' in module 'PyQt5.QtWidgets'"

formal iris
#

Should I use pyqt or tkinter?

#

Im leaning towards tkiner, but I haven't touched either yet

uncut pawn
#

Tkinter is easy to use But PyQt5 has more options

formal iris
#

like what options?

uncut pawn
#

U can use Pyqt with Css

formal iris
#

Since I haven't used pyqt or tkinter, I don't know how useful that is lol

uncut pawn
#

Css is a programming language that bassically makes your app look better

formal iris
#

I know what css is

#

I just didn't know it could be used with python gui

uncut pawn
#

BUt I think start with Tkinker it is easy

formal iris
#

alright thx

uncut pawn
#

np

formal iris
#

oh, I didn't realize Pyqt requires a license to use commercially

formal iris
#

free for open source commercial use

#

free for individual use

#

Not free for commercial use

uncut pawn
#

do you know what GPL mean

#

General Public License

#

it is Free]

formal iris
#

It means free for commercial use, but even pyqt FAQ says u have to purcahse license

uncut pawn
#

yes u don't need to pay the license

#

the way to install is pip install PyQt5

formal iris
#

well I know that

slim bronze
#

i'm quite new to python and i've been using tkinter for my UI's is there anything else i could use? something else a little more clean and sophisticated?

maiden dragon
#

@slim bronze i have been using wx.python for a few months now

#

its quite powerful in my experience but i have never used anything else

#

.
.
side note: reason I came here is i am getting a weird issue in pyinstaller when i terminate my program it doesn't clean up the temporary files. does anyone have a fix for this?

slim bronze
#

ah ok thank you iโ€™ll have a look into it

maiden dragon
#

sure feel free to ping me i may have encountered an issue you run into. kutiekatj9 was also a massive help to me early on when working with it but i cant offer up her help myself. she definatly just seems like one of the more expirenced people in this channel

slim bronze
#

ok thanks, the only thing i can suggest with my extremely limited knowledge is maybe using โ€”onefile but itโ€™s probably not the fix youโ€™re looking for

maiden dragon
#

ty yeah i thought of that but I think --onefile doesnt make an impact when you use a .spec file to specify all the properties

#

@slim bronze theres also like PYQT5 or something i think thats similar but idk what it is tbh

slim bronze
#

oh ok iโ€™ll have a look at that too

#

and thanks for the help, sorry i couldnโ€™t help you more

maiden dragon
#

all good im going to keep looking into it and maybe someone else will come along who has some useful info. worst case senario is i stay up real late tonight so i did not lie to my boss on when this will be fixed by xD

slim bronze
#

๐Ÿ˜‚

uncut pawn
#

HOw to use multiple files in PyQT5?? So like 1 file has a window and the other has a button put on the window does anyone know how to do that?

unique forge
#

@uncut pawn did you use QT Designer

uncut pawn
#

NO I found the problem. It was in the Pylint and coded some C code and done. It now works

#

@unique forge

uncut pawn
#

is there way to make a simple drag-and-drop interface?

upper coral
#

hello , i am a beginner for python and want to learn it . can u tell me with what and where should i begin ?

uncut pawn
#

@upper coral Start of knowing the basic of programming.

#

Creating Variables

#

If ... Else

#

for loop and While loop

upper coral
#

OK , so after downloading python i have to do that

uncut pawn
#

k

upper coral
#

thanks

uncut pawn
#

here is website

#

that will help u

upper coral
#

thank u very much

uncut pawn
#

np

digital rose
#

or to store it in a variable
@digital rose ah

#

.configure

#
from tkinter import *
root = Tk()
def clicked():
    GG_Label.configure(text="Changed :D")
GG_Label = Label(master=root,text="GG")
click_change_btn = Button(master=root,text="Click to change the GG text")
GG_Label.pack()
click_change_btn.pack()
# To call func
click_change_btn.bind("<Button1>", clicked)
root.mainloop()
digital rose
#

how do i try except it?

digital rose
#

nevermind

vague gale
#

how can i delete a widget inside a stacked widget

#

doesn't seem there's any option for doing so

digital rose
#

nevermind
@digital rose sorry

#

I take a while to answer you

#

sorry

#

doesn't seem there's any option for doing so
@vague gale?

vague gale
#

well, i can't see how to delete it

digital rose
#

just doing except:seems to work

#

well, i can't see how to delete it
@vague gale is this made with tkinter

vague gale
#

no that's qt designer

digital rose
#

I'm not good at pyqt

#

sorry

#

only tkinter

copper lintel
#

@digital rose can you help me in tkinker

cosmic nymph
#

I'm trying to settle on which GUI library to use for a project of mine, it's a chemistry software that's trying to optimize values from experimental data; the user inputs initial data into a form (a quite big one) and then launches the calculation itself.
I'm looking for some kind of framework that can allow me to use read-write tables that can be used as inputs and can be modified in number of rows/columns when the input for that is changed. Some input fields also needs to be disabled if some conditional inputs are checked and I would like to have this happening on the fly kind like it's possible in a reactive envoirment such as RShiny.
Is there something that could appeal to me given my requirements?

whole dagger
#

@cosmic nymph I suggest using Pyqt5 for this, and the gui wont take that long to implement either if you use the qt designer software. PyQt5 also has some widgets for displaying tables.

#

@vague gale If you still havent figured it out, what you can do is to use the buttons on the stacked widget to get to the widget you want to delete, then right click the stacked widget then you'll se an option "Page x of n", then there is a delete option there which u can click to delete it.

vague gale
#

thanks @whole dagger

whole dagger
#

no problem

solid aurora
#

Has anyone here had any bad experiences with Dear PyGui? Or just good stuff?

storm jay
#

someone who knows how to exit fullscreen in kivy.....because whenever i run the code it automatically goes to complete fullscreen....in which the entire screen is the output...i cannot see the taskbar nor anything...is there a way to prevent this

plush stream
#

The QtWinExtras.QtWin.blurBehindWindow doesn't seems to work on windows 10

#

But it does on windows 7

eager beacon
#

just set a QGraphicsBlurEffect as the widgets graphicsEffect

plush stream
#

That would've just blurred the widgets, e.g slider, label, button, etc

#

But not the window

eager beacon
#

@plush stream How did you set the widgets alpha?

plush stream
#

The main window?

eager beacon
#

Any of them

plush stream
#

I just use the combination of QtWinExstras.QtWin.enableBlurBehindWindow() and self.setAttribute(Qt.WA_TranslucentBackground, True) to make the window translucent

#

That would've just blurred the widgets, e.g slider, label, button, etc
Actually, it won't even blurred anything

#

I can't seems to apply QGraphicsBlurEffect on QMainWindow

eager beacon
#
from PySide2 import QtWidgets
from PySide2.QtCore import Qt


class Widget(QtWidgets.QMainWindow):
    def __init__(self, parent=None):
        super(Widget, self).__init__(parent)
        self.setAttribute(Qt.WA_TranslucentBackground, True)
        self.layout = QtWidgets.QGridLayout()
        self.setLayout(self.layout)

#

This sets the alpha for you?

plush stream
#

It wouldn't work without QtWinExtras.QtWin.enableBlurBehindWindow(self)

#

If you only use self.setAttribute(Qt.WA_TranslucentBackground, True) it will only make the window black

bronze basin
#

But it does on windows 7
@plush stream maybe it is not supported in windows 10 yet?

plush stream
#

I think so too

bronze basin
#

and plus we also talked about this some time ago and like could not find any documentation as I somewhat remember you trying before

plush stream
#

The blur effect seems to be activated by the window 7 aero theme

#

Well, there's nothing wrong with trying again

bronze basin
#

yeah

#

maybe something to do with the themes in windows 10?

#

you could try that maybe

plush stream
#

That's what i'm trying to figure out

#

Windows 10 have aero like theme but i don't think pyside can access it yet

grim bronze
#

I wish there was a QTtt designer-like tool for Kivy's kv language

#

that would be so handy tbh

bronze basin
#

there is @grim bronze

#

??

grim bronze
#

I didn't know tthat

unique forge
#

can you send the link for i @bronze basin

bronze basin
#

or just search it up

#

Qt designer

eager beacon
#

QtCreator is a bit more powerful than designer so you may want to look at that also

remote dove
#

Someone help me?

#

witch python + tkinter + treeview + sqlite3 lemon_unamused

eager beacon
#

just ask your question and someone will respond if they know the answer

remote dove
#

To connect sqlite3 in python with tkinter it is necessary to use self or parameters?

#

And i have the database connected it works, I receive the data, but when I try to make it appear in treeview, it does not appear

eager beacon
#

if the method is in the a class and is not a staticmethod you will need to use self

remote dove
#

Ooh i see

eager beacon
#

You'll need to post the code where your adding the data to the view for help with that one if it's not working

unique forge
#

@bronze basin thats a link for QT Designer. He asked for a Kivy equvialent

bronze basin
#

@grim bronze oh sorry I misunderstood your question I thought you wanted a Qt designer app

#

my bad

remote dove
#

You'll need to post the code where your adding the data to the view for help with that one if it's not working
@eager beacon where?

eager beacon
#

@remote dove !paste

#

hm

#

!paste

proven basinBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

remote dove
eager beacon
#

I don't see where you are inserting any of the values

quasi sinew
#

How can I add custom attribute to tkinter widget?

unique forge
#

@eager beacon would you like to try out the app you helped me create?

eager beacon
#

Yeah, I'll check it out in a few

unique forge
#

thanks

#

you need to install all the files in a zip

#

extract it

#

and open the EXE

delicate tendon
#

can anyone here help me with a project of mine in tkinter please

neat brook
#

i'm needing help with a school project

eager beacon
#

@unique forge why does this have pyqt5 and tkinter in the repo?

unique forge
#

Tkinter???

#

I never used Tkinter

eager beacon
unique forge
#

idk

#

but it doesnt seem to work without it

eager beacon
#

lol

#

I managed to crash it!

unique forge
#

did you get it to work?

#

@eager beacon

eager beacon
#

yeah it works

#

my inputs just crashed it

unique forge
#

what do you think

eager beacon
#

its pretty neat

unique forge
#

thanks

eager beacon
#

you should think about checking if square_lineEdit.isdigit() first and if it is using abs() on the sqrt

#

or cmath.sqrt

unique forge
#

what is that

eager beacon
#

cmath.sqrt?

#

its for doing math on complex numbers

#

the functions returns complex numbers also

unique forge
#

ok

#

do you have any good project ideas @eager beacon?

eager beacon
#

you could make a timer app that uses the QTrayIcon

#

make it so you can set the duration and start/pause/dismiss the timer from the tray icon

unique forge
#

ok

#

is it possible to make mobile apps with PyQT?

#

or do I have to use Kivy

uncut pawn
#

how do I make a button that shows other buttons under it?

#

in PyQT5

eager beacon
#

make a widget and put buttons in the layout and hide it

#

click the button to toggle

uncut pawn
#

Thx

delicate tendon
#

here is a recording of my program in tkinter, the problems in it are when the timer hits zero it doesnt display the next round and when you click on the correct color (that matches the background color) the timer doesnt reset and the round counter does not increase by 1 and when the timer hits zero it says X Timeout! but doesnt disappear when the timer resets, can someone please look at any of these problems and help me with any one of these problems that you know how to solve please and thank you!
as I am trying to recreate this game in tkinter http://kolor.moro.es/

static cove
#

@delicate tendon what is your code for the program?

delicate tendon
#

hold up ill send you the link

delicate tendon
#

@static cove are u still there?

digital rose
#

HI

#

welcome @delicate tendon

#

what is you'r problem

delicate tendon
#

when the timer hits zero it says/displays X Timeout! but doesnt dissapear when the timer resets?

keen torrent
#

You could always use GD3 itโ€™s code uses nothing but English sentences and commands and turns that into a script for exactly what you want and compile, so it needs every detail in English information and it is a easy to use highly powerful popular expensive program and you could for example say
Create a social network similar to Facebook and Twitter merged together and then thatโ€™s it. It would do it

#

An artificial intelligence created the software

#

It also is the software, who created the Artificial intelligence? Nobody knows

#

I certainly did not

digital rose
#

when the timer hits zero it says/displays X Timeout! but doesnt dissapear when the timer resets?
@delicate tendon you make timer ? and can you send code ?

#

@delicate tendon are you arabic because you'r name is arabic

delicate tendon
#

for some reason I cant send the link in the group chat so do I send it to you in dm's?

#

and no i am not arabic

digital rose
#

yes and okay

keen torrent
#

That is the program I was talking about GPT-3

digital rose
#

Hi

#

guys

#

I have q

#

in tkinter

#

How to make fixed position with the window of a widget in tkinter?

#

How to make fixed position with the window of a widget in tkinter?
@digital rose grid?

#

place

#

i havent learned place yet

#

i cant help you

#

hope you find your answer

#

yeah

#

can u

#

help me if I have grid

digital rose
#

@digital rose welcome

#

ok so in tkinter i have an optionmenu and i want a function to run every time i select somethig else in that optionmenu, is that possible?

#

How to make fixed position with the window of a widget in tkinter?
@digital rose can't you do like place(x=23, y=44)

hybrid light
#

hi im new here

digital rose
#

@digital rose can't you do like place(x=23, y=44)
@digital rose this is not what I want I want to make this changed when the size of the window is increased

#

hi im new here
@hybrid light welcome

#

ok so in tkinter i have an optionmenu and i want a function to run every time i select somethig else in that optionmenu, is that possible?
@digital rose wdym

#

you mean you want to get if that button click

#

yes

#

.bind

#

sec

#

is that up label ?

#

its optionmenu

#

or combubox

#

ah this is menu

#

can u show you'r code ?

#

sure

#

its extremely untidy

#

thx

#

i mean menu part but yeah

#

the update function isn't complete

#

@digital rose so you found a solution?

#

you want -command

rancid veldt
#

Why the heck r u pinging me everywhere

deep hornet
#

sry

#

i got exited when i saw

polar wave
#

Hello! I don't know if this is the right channel to ask, but is there a library that you can use to make star reviews? or at least clickable text where when you click on it, some code will run.

#

You can ping me if you have answers, i will research on libraries

deep hornet
#

uMM

digital rose
#

you want -command
@digital rose from tkinter import * root = Tk() def print_hi(): print("Hi") things= list("1234567890") options = StringVar() options.set("LOL") optionmenu = OptionMenu(root, options, *things, command=print_hi) optionmenu.pack() mainloop()

#

its not working

digital rose
#

apparently this worked optionmenu = OptionMenu(root, options, *things, command=lambda _: print_hi())

digital rose
spare ice
#

With Django vs Tkinter, which is better to use, when?

digital rose
#

With Django vs Tkinter, which is better to use, when?
@spare ice django and tkinter are two different things. Django is for website dev while tkinter is for Gui

spare ice
#

@digital rose can it be used for the Admin for Django? .... how often is GUI needed vs web with Django? Thanks!

meager skiff
#

Do you mean, web app with django and react or smthing similar vs tkinter GUI?

spare ice
#

@meager skiff yes

meager skiff
#

ooh

#

well the answer is simple.

#

If you want something that looks very nice, potentially cross platform, and overall very polished, go with django and react. keep in mind they do take a bit of time to learn and implement

#

If you want something that just gets the job done, and basic GUI, well tkinter is your answer

#

or if you want kinda like the middle ground, you should check out PyQt

#

i think its native to PC platforms and it is more complex and flexible than tkinter

#

It should help you build a pretty good GUI. It has a lot of handy stuff like the QTdesigner and stuff

spare ice
#

@meager skiff thank you. Well Iโ€™ve been using Django for a while now and I like it. It really helps to have a admin setup right away, and it seems to be more realistic with โ€œstepsโ€ being simpler than what you do with React to make just a simple CRUD app.

#

@meager skiff is GUI in constant need of python? Or what part of python is in a stable demand that, you donโ€™t need college for?

meager skiff
#

You can do a lot with python. But GUI? It has never been one of pythons strong points. PyQt is pretty good. But if you are more into GUI and frontend, i highly suggest Javascript, React and those kinda stuff

#

I'd say python has a lot of uses and a lot of stuff like machine learning, big data, server side stuff like django are very popular

#

but not gui

#

anything but gui

#

why not dive into linkedin or anyother job findnig website and take a look for youself

spare ice
#

anything but gui
@meager skiff ok, but with machine learning, or anything thatโ€™s a fairly stable precise demand, donโ€™t you need college? Iโ€™m familiar with react and vue, Iโ€™m getting better at hooks

meager skiff
#

front end is a very popular sector, and if you ask me, i honestly have no idea what you need or dont need college for. If you are going front end though, invest in javascript

static gorge
#

i love ui

unique forge
#

?

nimble dune
#

Hi all, I cannot for the life of me remember the name of those scrolling news tickers on top of a website. What would be a proper name for that component?

#

For example, you go to a stock market website and you usually see how markets are preforming via the scrolling bar

arctic sequoia
#

no one knows what they're called

junior quiver
#

im trying to make a very simple ui for my work computer. I cannot directly install python on it. would tkinter be the way to go with using py2exe or should i go a different direction all together?

cold cargo
#

anyone here has experience with kivymd?

#

I am trying to import an image to my screen but dont know how... I tried googling it but which ever i try it gives an error or it just closes it self.

junior quiver
#

@cold cargo are you trying to make it a background?

cold cargo
#

no just import it to the screen

#

as a logo

junior quiver
#

are you doing this in kv or python?

#

putting an image in isn't really a kivymd specific thing nor do they have a simple just image component. the kivy way of doing it in KV would look something like this @cold cargo FloatLayout: Image: source:"img/IMG_2330.PNG" pos_hint: {'center_y':0.9, 'center_x':0.5} size_hint_x: 0.5

#

@cold cargo python would be something like this python myimg = Image(source='img/IMG_2330.PNG')

mighty blaze
#

i want to made a small chat app with gui
and socket server but the problem here is
client server and ui have a single loop
and i cant connect them
because one of them will work and other will not ,
i tried Theard and its work but when i try to add text to gui form client server loop its say QObject::setParent: Cannot set parent, new parent is in a different thread ,any idea?
-pyqt5

delicate tendon
#

i am trying to recreate this game http://kolor.moro.es/ and was wondering how I could make the score counter in this game in tkinter?

uncut pawn
#

I am trying to learn PyQt5 and I come from Tkinter how does the button know which window the button is going to be placed. IN PyQT5

frank snow
#

Hey guys. I am trying to make a website connected to my bot. When you hit sign in on the site, it redirects you to the ouath2 link for the bot ("The bot would like to access your username and profile")
etc
And I want the website to display the username and profile after logged in
My bot is in discord.py, I just dont know how to connect the bot to the site in terms of code.

digital rose
#

oh hi

#

guys ho i verefy

#

?

#

how*

#

verefy?????

#

in voice room!!!

#

ah ok

#

chat*

#

;-;

#

anyone

#

you mean

#

what i do

#

any channel ? verefy?

#

what is your problem

#

in tkinter ?

frank snow
#
etc
And I want the website to display the username and profile after logged in
My bot is in discord.py, I just dont know how to connect the bot to the site in terms of code.```
#

reposted question because it was somewhat burried

static cove
#

@frank snow So a website is a bit out of scope for this channel. #web-development might be a better option. Typically you would use a database as the connection between the bot and website. So the bot would access the database and so would the website.

I'm a bit inexperienced with OAuth portion of discord bots though.

frank snow
#

Ah alright, thanks!

next hawk
#

i want the 2 blank text fields to be directly below the red 'authorisation' label

#

but it seems to weirdly correct itself, i'm using grid

digital rose
#

whats the grid

next hawk
#

button = Button(root, font='Tahoma 20', width=10, height=2, text='Authorisation')
text1 = Text(root, font='Tahoma 20', width=15, height=1, bg='white')
text2 = Text(root, font='Tahoma 20', width=15, height=1, bg='white')
enter1 = Entry(root, font='Tahoma 20', width=7)
enter1.insert(END, 'Login:')
enter1.config(state='disabled')
enter2 = Entry(root, font='Tahoma 20', width=7)
enter2.insert(END, 'Password:')
enter2.config(state='disabled')
label = Label(root, text='Authorisation', font='Tahoma 20', bg='red', width=60)
label.grid(row=0, column=0)
enter1.grid(row=1, column=0, sticky='w')
enter2.grid(row=2, column=0, sticky='w')
text1.grid(row=1, column=1, sticky='s')
text2.grid(row=2, column=1, sticky='s')
button.grid(row=3, column=0, sticky='w')

heavy halo
#

Hmmmm try increasing the length of the red label

#

Or use place instead of grid

#

So you can use x and y coords

next hawk
#

well, i'm doing a little course, and i have a homework that tells me to do grid instead of place

#

i did it with place already

heavy halo
#

Oh

next hawk
#

increasing the length made the situation only worse

#

it seems to correct itself according to the label, but the label has to be full width of the screen

heavy halo
#

Use label.grid(sticky="n")

#

What changes you see ?

next hawk
#

or instead of last line

heavy halo
#

After column=0 write , sticky="n"

next hawk
#

i've tried playing around sticky

#

i guess there's just no good way to do this with grid

heavy halo
#

Yes grids even torture me,
But there will always be a way

#

It is just we are not able to figure out

#

Try using all the options you get in grid view

next hawk
#

I've tried to read all sorts of documentation but still can't crack this one

heavy halo
#

Lol

next hawk
#

well, guess i'll play around with grid some more

heavy halo
#

Hmm sleeping time for here sorry i couldn't help much even after having experience but someone will of course help

next hawk
#

thanks for the help anyway

heavy halo
#

@next hawk yesss

next hawk
#

It's just good to see that people help each other in the programming community

amber roost
heavy halo
#

Then he can use sticky="e"

#

But i guess he wants it to be directly under the red label and completely towards west

digital rose
#

Use .place much better @next hawk

digital rose
#

Guys Help

#

How to get the current option of combobox ?

#

I mean

#

tha true value

eager beacon
#

pyqt?

#

combo.currentText() for qt

prisma yarrow
#

lol

abstract sundial
#

I am facing a similar issue as @pupsik. I am using pysimplegui to place 6 sliders. What happens is when the code is run, every slider is side by side. I want them to be one on top of another. What do I need to do?

#

Oh I literally just figured it out

#

What I didn't do was surround each SG.slider() with [], just the entire block. Adding the brackets fixed it.

#

Actually, new issue. Can I add a label to the side of a slider?

#

I'm on a roll, sorry for this flooding. I realized I can add SG.text() beside the slider code. I'm really new to python and coding in general. Sorry again.

heavy halo
#

Its ok lol

digital rose
#

hello can someone help me fix a problem in my tkinter?

heavy halo
#

For that you need to post some code and your problem

#

Dont ask just do it

#

People will of course help

jovial hamlet
#

Hey ! I need help, I use Tkinter library and I want to create a label into a frame, but, when my label appear (he is called by a button), the frame is diseaperring ...

Thank you for your help !
||Sorry for this message, there is probably many incorrect sentences, im bad in english Xd||

#

Tell me if U need some code

digital rose
#

Hi

#

your problem is really easy @jovial hamlet

jovial hamlet
#

Hi !

digital rose
#

welcome

jovial hamlet
#

Thx !

#

So, were is the problem ?๐Ÿ˜„ @digital rose

digital rose
#

the problem is when you defined

#

the vars

#

you placed it on the frame

jovial hamlet
#

How can I tell to the Label to go into.the frame ? @digital rose

digital rose
#

place it on the frame I mean place the frame .place first then place the Label

jovial hamlet
#

I have found the solution ! I juste had to do a .pack_propagate(False) ! Thank you very much for your help !

digital rose
#

You'r welcome

digital rose
#

{Pyqt} does anybody know how to change the size of the circle of QRadioButton? i tried this method, setting the stylesheet but it's not working, it does decrease the size when i set the width to 12 and height to 12 but it's not increasing the size
QRadioButton::indicator { width: 30px; height: 30px;}

digital rose
#

i'm bad in Pyqt sorry

#

Guys How can I delete the background of the canvas?

frail vault
#

Hi, I am trying to create a tkinter label (left) and button (right) for every item in a list. How do I do this?

#

Never mind, I got it working by putting the labels in a list and looping through the list to pack them

digital rose
#

I'm currently creating a small pokemon game where your suppose to track scores, the problem is when the player loses or the AI loses both side loses points instead of only one

#

these are my set of code

#

def button1():
global playerChoice
playerChoice = 1
showResults()
showComputer()

gameArea.update()

def button2():
global playerChoice
playerChoice = 2
showResults()
showComputer()

gameArea.update()

def showComputer():
global compChoice
compChoice = random.randint(1,2)
showResults()

def showResults():
global playerChoice, compChoice, onixHealth, userHealth
if playerChoice == 1 and compChoice == 1:
gameArea.itemconfig(message, text = (playerName," uses tackle and Onix uses Hard! PLAYER WIN"), font = ('courier new', '10'))
onixHealth = onixHealth - 1
gameArea.itemconfig(cScore, text = onixHealth)

elif playerChoice == 2 and compChoice == 2:
    gameArea.itemconfig(message, text = (playerName," uses Growl and Onix uses Slam! PLAYER WIN"), font = ('courier new', '10'))
    onixHealth = onixHealth - 1
    gameArea.itemconfig(cScore, text = onixHealth)
        
elif playerChoice == 2 and compChoice == 1:
    gameArea.itemconfig(message, text = (playerName, " uses Growl and Onix uses Harden! PLAYER LOSE"), font = ('courier new', '10'))
    userHealth = userHealth - 1
    gameArea.itemconfig(pScore, text = userHealth)
        
elif playerChoice == 1 and compChoice == 2:
    gameArea.itemconfig(message, text = (playerName, " uses Tackle and Onix uses Slam! PLAYER LOSE"), font = ('courier new', '10'))
    userHealth = userHealth - 1
    gameArea.itemconfig(pScore, text = userHealth)
#

the player lost 2 points for some reason

uncut pawn
#

Can I use Qt designer for commercial usage?

#

For free

bronze basin
#

no

uncut pawn
#

who about just coding it in Pyqt5

digital rose
#

Guys How can I make scrollbar in tkinter ?

wise dawn
#

here

#

Here is example:

#
from Tkinter import *

root = Tk()
scrollbar = Scrollbar(root)
scrollbar.pack( side = RIGHT, fill = Y )

mylist = Listbox(root, yscrollcommand = scrollbar.set )
for line in range(100):
   mylist.insert(END, "This is line number " + str(line))

mylist.pack( side = LEFT, fill = BOTH )
scrollbar.config( command = mylist.yview )

mainloop()```
digital rose
#

If anybody has time for Tkinter please check the germanium chat, my questions are there

delicate tendon
#

hey how would I make that when I stretch the size of the window of maximize the window size how would I keep the positioning the same of the labels and buttons on the window in tkinter?

unique forge
#

@bronze basin you can use QT Designer for Commercial use, as long as credited

#

Check out the QT licensing page