#user-interfaces

1 messages ยท Page 60 of 1

keen path
#

like the first argument

meager pilot
#

i think its required

keen path
#

k

meager pilot
#

like in which window the icon must be placed

proven basinBOT
#

Hey @keen path!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

โ€ข If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

โ€ข If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

keen path
#

alt

#

!paqste

#

!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.

keen path
#

try this

#

@meager pilot

#

tell me if it works

#

hello

digital rose
#

oui

keen path
#

?

#

@digital rose

#

oui ?

#

@meager pilot did it work

meager pilot
#

yup

keen path
#

ok

#

now u can send

#

the whole folder

#

Dice Simulator

digital rose
#

Hello

keen path
#

hey

#

@digital rose u need help

digital rose
#

No

keen path
#

k

digital rose
#

i thought this was the main chat

keen path
#

ah k

modern marsh
#

hmm

keen path
#

is the gen chat

keen path
modern marsh
#

hey ๐Ÿ˜„

keen path
#

wassup

modern marsh
keen path
#

cuz im a GUI dev

#

in other ways frontend dev

#

but im also obliged to do all the backend work too

#

since im not yet working in a company

modern marsh
#

ahh ok

digital rose
#

man

#

i was making GUI earlier and it was working fine

#

but not idk why it is showing error

#

i have to submit a project by tommorow and idk what this error even mean

#

do mention me when u get to know wht error it is ๐Ÿ˜ญ

keen path
#

@digital rose

#

hahayes very ez problem

#
img=ImageTk.PhotoImage(Image.open("D:\documents\cardsp\2H.jpg"))

Should be :

img=ImageTk.PhotoImage(Image.open(r"D:\documents\cardsp\2H.jpg"))
#

i just added the r before the directory

#

@radiant anchor do u need help ?

radiant anchor
#

Hey,
can someone tell me how to set a frame size in tkinter to actually 0?

top_frame = Frame(window, height = 20, width = 100, bg = 'blue')
top_frame.pack_packpropagate(0) # disable rescaling
top_frame.pack(expand = False)
mid_frame = Frame(window, height = 0, width = 100, bg = 'green')
mid_frame.pack_propagate(0)
mid_frame.pack(expand = False)
bot_frame = Frame(window, height = 20, width = 100, bg = 'red')
bot_frame.pack_propagate(0)
bot_frame.pack(expand = False)

mid_frame is still at least 1 px high

#

(the gap is the mid frame)

#

yes i do @keen path , sorry. took me a while to type

keen path
#

ok

radiant anchor
#

ok

digital rose
#

i just added the r before the directory
@keen path man thanks h lot bro ,someone in webdev answered me lol ,I am making blackjack game like the one we get with OWO BOT of discord

keen path
#

@digital rose

#

np happy to know that i helped someone else

alpine ember
#

PyQt5, can someone help me out

tidal island
#

I'm using tkinter scrolledtext to, well, scroll text. How can I allign this text to the centre of the scrolledtext label though?

#

Also, how can I have it automatically scroll?

unique forge
#

@alpine ember I can help with pyqt5

#

But please, just ask

alpine ember
#

sure @unique forge

#

So I created the pyqt5 design on designer then converted to py file

unique forge
#

Ok

alpine ember
#

Normally I would edit that file and attach functions to buttons

#

But there was the issue of : if I wanted to change the gui design, it deletes all that stuff

#

So I'm trying to have a separate file for all the functions being attache to buttons

unique forge
#

You are supposed to do that

alpine ember
#

yeah, I'm a noobie

unique forge
#

It literally says at the top of the page dont add or make chanhes

alpine ember
#

I realised after watching a video of "what not to do"

unique forge
#

Yeah

alpine ember
#

Anyways

#

I've set it up wrong

unique forge
#

You are supposed to create another file

#

And import the other file

alpine ember
#

Cause whenever I attach functions to buttons, it doesn't even call them

#

I'm not even sure if the init function is getting called

#

I will share the code

#

BUT

#

The gui opens?

unique forge
#

If the GUI opens, then the init was called

alpine ember
#

I put prints in it and they don't display

unique forge
#

Send code please

alpine ember
#

Here you go my good sir

#

So I followed a guide for the main at the bottom but it didn't originally work

unique forge
#

The thing with QT Designer, it has almost no tutorials

#

Does the GUI work?

alpine ember
#

Yeah

#

But the buttons dont

unique forge
#

Ok

#

Show me the GUI

alpine ember
#

Sure

#

El voila

#

Do you like my basic non-professional standard invoice generator

unique forge
#

It looks nice

#

What type of buttons are they

#

Push Buttons?

meager ravine
#

Is it possible to extract text from a game for instance, without saving the region as a screenshot?

alpine ember
unique forge
#

You haven't used QMainWindow

#

from PyQt5.QtWidgets import (QApplication, QMainWindow,)

#

class MainWindow (QMainWindow):

alpine ember
#

I don't understand

unique forge
#

You are using Clean_GUI

#

You need to use QMainWindow for it

#

So import QMainWindow

#

And make your class include QMainWindow

alpine ember
#

How would I include it in my class

#

Via the parameters

unique forge
#

I sent it above

#

Also change def init

#

if __name__ == "__main__": app = QtWidgets.QApplication(sys.argv) MyWindow = MainWindow() MyWindow.show() sys.exit(app.exec_())

#

Finally, change def init

#

def __init__(self): super().__init__() self.ui = PTCGUI.Ui_MainWindow() self.ui.setupUi(self)

#

Replace PTCGUI with the name of the other file

alpine ember
#

Ui_MainWindow has no show attribute apparently

tidal island
#

I'm using tkinter scrolledtext to, well, scroll text. How can I allign this text to the centre of the scrolledtext label though?

alpine ember
#

@unique forge It doesn't like it

unique forge
#

Send the new code

alpine ember
#
clean_gui.py", line 77, in setupUi
    MainWindow.setCentralWidget(self.centralwidget)
AttributeError: 'InvoiceGenWindow' object has no attribute 'setCentralWidget'
unique forge
#

Dont import clean gui

alpine ember
#

but that's where the designer stuff is

#

@unique forge

#
File "/Users/user/Documents/Projects/MyProjects/invoice-generator/clean_gui.py", line 77, in setupUi
    MainWindow.setCentralWidget(self.centralwidget)
AttributeError: 'InvoiceGenWindow' object has no attribute 'setCentralWidget'
unique forge
#

Where did it tell you to import clean gui

#

What documentation or tutorial

alpine ember
#

Author Alan D Moore describes some common pitfalls of using QtDesigner with PyQt5, and the proper way to combine the two to build GUI applications.

Follow Alan at https://www.alandmoore.com

Purchase a copy of Mastering GUI Programming with Python here: https://www.amazon.com/Mastering-GUI-Programming-Python-cross-platform-ebook/dp/B07S9WFD92/
...

โ–ถ Play video
#

It doesn't say import the gui as a whole

#

just ui window

#

either wya

#

this tutorial doesnt work

#

I just get the same errors

#

@unique forge

#

Any idea why it doesn't work ๐Ÿ˜‚

unique forge
#

I think you need to start again

#

But dont delete the functions

#

But start a new file

radiant anchor
#

Can someone help me with tkinter problems?

cosmic nymph
#

I'm working on a PyQt5 app, I want to implement something similar to the classic "File>New".
For the time being I'm triggering a function that resets every field to its default value but I think as the application is getting bigger this could be a lot of repetition in the code and the execution time might become an issue.
Is there a way to reistantiate the main window with an action?

alpine ember
#

what

#

Just add a menu bar, then connect the widget 'new' to the function you wanna call ? Done?

tidal island
#

How can I stop a tkinter window from ever being the current focused window? it's always drawn on top of other things, but I'd like the applications below it to receive the click events.

radiant anchor
#

Hey,
i created a Frame with tkinter.
The Frame has a height of 0.
When pressing a certain button the frames content gets created or deleted.
Even though the height is set to 0 the frame is about 1-2 px high on startup.
When content gets added the Frame will resize to fit its content as desired.
When content is deleted the Frame will stay it the size of the deleted content instead of scaling down to 0.
Can someone help me with this?

#

Note: When i readd content of a smaler size than the old content the Frame will scale down to fit the content, but when i remove all content it will stay at the size it was when it had content.

meager pilot
lost dragon
#

In PyQt5 is there a way to not remove focus from the active window when the GUI is clicked on?

unique forge
#

no

#

not PyQT

#

its your PC

tidal island
#

Programs can still control it, in some way.

#

It's a matter of working out how, which I want to do.

unique forge
#

its your PC I think

#

there must be some setting

tidal island
#

Programs can control it

unique forge
#

where did you read that

tidal island
#

(look at the likes of msi afterburners overlay)

#

Clicking on the overlay doesn't affect the overlay at all
There's also others, msi afterburner was just the one I could think of off the top of my head

inland notch
#

can you use python with java to create a ui?

unique forge
#

Not with Java

tidal island
#

@inland notch why would you use both when either one can do it alone?

unique forge
#

Yeah

#

Use one of them

#

I reccomend Java, I think it is better for UIs

tidal island
#

Generally most people asking for help here are relatively well versed in python and as such will learn python modules easier than other languages

Nonetheless both are very capable, and I would personally recommend just using the one you're more experienced with

inland notch
#

python for the computing, java for the ui

spice jacinth
#

What about Tkinter ?

inland notch
#

tkinter's slow

spice jacinth
#

I'm making some scripts etc but Always get stucked when i have to UI'ze all

inland notch
#

It's what i'm currently using, but it's really slow, and I think java would imporove the FPS

spice jacinth
#

Videogames ?

inland notch
#

yeah

spice jacinth
#

I just want to develop some specific softwares

inland notch
#

what

#

I'm talking about me

spice jacinth
#

Yup

#

But develop videogames in python seems weird

#

Java >

#

C++ too

inland notch
#

I know, but it's what I was using at the time that I got the idea to make a video game, so I made it with python, but it's slow so I want to use python in conjunction with java to improve fps

fallow shadow
#

how can i stop kerning in tkinter labels?

#

i think a monospace font will fix it, but i havent found one yet

#

can anyone help?

#

ive tried a bunch but it overrides it somehow

plush stream
#

Hey, How do i keep the position of the window same even though i changed the screen resolution?

#

How do i keep that white square stay on the very edge of the screen like in the 1360x768 even if i changed resolution?

keen path
#

well first u havent specified what that is ( which module are u using )

digital rose
hoary dagger
#

What's the meaning of user-interface? Frontend?

strange sable
#

Hello, is there any GUI library that can display opaque text with transparent window?

vale orchid
#

My Tkinter code is defined in frames in classes and I'd like the entire GUI to exit and restart when I press a button. It should do both simultaneously. ex, I press 'Restart', it should close the mainloop() and reinitialize

#

Any solution you suggest?

keen path
#

i wish i could see that happen

wispy zephyr
keen path
#

alr

wispy zephyr
#

have to do differently on each OS though..

strange sable
#

@wispy zephyr@keen path
Yes, I did use that method but there's a problem
The color between text and background has a slightly different shade of color that doesn't get removed

#

I tried to make it smooth by making the BG 'the same' as the text color
By 1 different on RGB color (0,0,1) to (0,0,0) for example

#

It kinda works but still depends on the color, it's a bit bad on some color (pixelated or very thin)

marsh perch
#

I have a tkinter listbox with names, but I want the names to be sorted on alphabetical order. How can I do that?

vale orchid
marsh perch
#

Idk if i understand it correct but maybe make 1 main function for all the other functions

split ferry
split ferry
vale orchid
#

Oh okay, understood. I'll give it a go right now and let you know

vale orchid
#

@split ferry I did what you mentioned, and the program restarts correctly. But the first window does not close

#

I end up with 2 windows, but the 2nd one works as expected

#
def exitrestart(self):
  self.destroy()
  rerun()
#
def rerun():
    if __name__ == '__main__':
        app = MainWindow()
        app.mainloop()
split ferry
#

Give me a couple of minutes. I'll try this code and get back to you.

vale orchid
#

Okay, thank you so much

#

Do let me know when you do sort it out!

split ferry
#

Sure

#

@vale orchid
import tkinter as tk

def main():
global window
window=tk.Tk()

window.columnconfigure(0,minsize=800)
window.rowconfigure(0,minsize=600)

button=tk.Button(master=window,text='Generate',command=okay)
button.grid(row=10,column=4,pady=15,ipady=12,ipadx=12,sticky='e')

def okay():
global window
window.destroy()
main()

main()

window.mainloop()

#

You can use the same logic. It works fine

split ferry
vale orchid
split ferry
#

Okay

vale orchid
split ferry
#

Try the logic first. If it doesn't work, then share the code.

vale orchid
#

Yup

#

I'm having a doubt here. I'm using classes to define the frames. So do I have to move all the classes into a main() function and then try this logic?

split ferry
#

Not really. Just initialize the classes within the main function

#

@vale orchid All the static code can stay outside the function, but all the working code has to go in. If your working code needs the class, then it has to go in

vale orchid
split ferry
#

Yea, exactly

vale orchid
#
if __name__ == '__main__':
        app = MainWindow()
        app.mainloop()
#

Only this bit would be outside I think

#

Am I mistaken?

split ferry
#

what about app=mainwindow() line? you need to recreate it every time you click restart, right?

vale orchid
#

Yes

#

Ohhh, makes more sense now

#

This HAS to be inside the loop too, and then I can execute the logic you showed

split ferry
#

yea. If you read the code i sent you carefully, i have called a new window in every recursive loop after destroying the old one.

#

So, you have to create a new tkinter window within the main() function

vale orchid
#

IT WORKED!

#

Thank you so much

split ferry
#

Welcome! I can feel your excitement lol

vale orchid
#

Oh you have no idea. I've been working on all the intricacies for a while now and to see it come together! Have a great day

split ferry
#

Sure

quasi atlas
#

@split ferry Thank you very much buddy! I'm working on the same project as @vale orchid and with your help I think we are almost done with our project!

split ferry
#

@quasi atlas No problem. Good luck with your project.

quasi atlas
dusty yew
#

can someone tell me is learning kivy worth it?

#

how powerful is it for mobile platform?

plush stream
#

well first u havent specified what that is ( which module are u using )
@keen path oopsies, i use PySide2

keen path
#

ah, never heard of it

bleak egret
#
        x = ""
        def ok():
            cfrom = cfromx.get()
            cto = ctox.get()
            val = inputtxt.get("1.0", "end-1c")
            x = convert(cfrom , cto, val)
            
        label1 = tk.Label(self, text=(f"Output: {x}"), font=LARGE_FONT)
        label1.pack(pady=10,padx=10)
        
        button = tk.Button(self, text="Convert!", command=lambda: ok())
        button.pack()


        button1 = tk.Button(self, text="Back to Home",
                            command=lambda: controller.show_frame(StartPage))
        button1.pack()

so this is a snippet of my code using tkinter
i sorta need help on getting the output of ok() into the label1 "output: " to show the value, but im having trouble doing it. can someone help?

#

ping me if anyone answers pls

split ferry
#

@bleak egret I'm not sure if I got your question right, but I assume you want to change the text in label 1 whenever you click Convert button.
If I'm not wrong, your 'x' within the ok() function is a local variable and it is not changing the default value of global x. Try adding a line "global x" within ok() and run it. If it doesn't work, then you can use label.configure method to directly change the text within the ok() function.

bleak egret
#

I tried that still doesnโ€™t work

split ferry
#

Global x?

bleak egret
#

Ye

#

Oh

#

Label.config?

#

Never seen that b4

#

Iโ€™ll try it later thanks

split ferry
#

Okay. There are resources on stack exchange in how to use it. Do refer them. Also, global x won't work if your label1 is not getting updated recursively

#

Ping me if it doesn't work. I'll write the logic and send it to you

keen path
unique forge
#

yes?

#

@keen path

keen path
#

yeah

#

nothing'

#

@unique forge

unique forge
#

ok?

keen path
#

ok?

unique forge
#

why are you posting this

#

do you need help

#

it seems to be succesful

keen path
#

nah

#

just showing

unique forge
keen path
#

why

unique forge
#

or another off topic channel

keen path
#

it's related to user interfaces no ?

unique forge
#

these channels are meant for help

#

but it looks pretty cool

#

may I have the code?

mystic spoke
#

hi

#

hi

#

hi

uncut pawn
#

I am using Qt designer and I want to press a button and a label will pop out. HOw do I do that?

unique forge
#

hi @uncut pawn

#

so basically, you want a label to become visible when you press a button

bronze basin
#

just hide the label and when you press the button show it?

unique forge
#

@bronze basin that isn't very helpful

#

at least tell him how to

#

anyway, you need to do self.ui.label.show and self.ui.label.hide and then connect it to a button, like so

#
self.ui.label.hide
self.ui.pushButton.clicked.connect(self.showbutton)

def showbutton(self):
    self.ui.label.show
bronze basin
#

yeah I wasnt fully on my pc so didnt have time to post the code before you posted it haha

unique forge
#

oh

#

ok

#

but last time your answer was wrong, you said that you can't use QT Designer for Commercial use

bronze basin
#

yeah that was my bad I thought he was talking about the module Pyqt itself and the code

#

because most people would want to know about the whole module instead of one specific software

unique forge
#

ok

#

thats fine

digital rose
#

in tkinter when i try to make the text larger the boarders of the gui get larger to, how can i make the text bigger and not the gui

covert iron
#

i was trying to convert a ui file to py file since im using the qtdesigner and i want to see the code behind the window
it throws me an error
saying

#

C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe: No module named pyuic5

unique forge
#

I see

#

basically, you have to go to the path of pyuic5.exe @covert iron

#

and run the program there

digital rose
#

h

digital rose
#

i need very simple help with tkinter if anyone could help

bleak egret
#

ye what

#

state your question

digital rose
#

@bleak egret , i want to make the text bigger on the gui but when i make the text bigger on the gui the gui boarders also get further away from the text, I can't find anyway to fix this

bleak egret
#

if i understood your question properly, you want to have text within closer borders?

digital rose
#

i think that is right

#

i have a box touching the boarders of the gui that the text is in, so when the text gets bigger the boarder gets further away from the box and its like a box in the middle of the gui instead of the top middle touching all corners

bleak egret
#

try using padding spacing

#

like padx and pady

#

ill give you an example

#

hold on

#
label = tk.Label(self, text="Convert Currecncy here!", font=LARGE_FONT)
label.pack(pady=10,padx=10)
#

heres a project i did a while back, this adjusts the label padding area around it

#

this is what it looks like

#

(the top label)

digital rose
#

import tkinter.font as tkFont

root = Tk()

root.geometry("420x260")

title = Label(root ,text="DGS, LLC Customer Sales Database",height=7, width=60, bg="grey",font=LARGE_FONT)
title.pack(pady=20,padx=20)

root.mainloop()``` is there something i am missing?
#

it is not getting larger

bleak egret
#

hold on

#

larger nos in padx and pady means it will get larger

#

try =100 to see a significant difference

#

and the relative scaling

digital rose
#

i put it to 100 and it made no difference

bleak egret
#

im not sure if it works with title tags but

#

i usualy use labels for title so

digital rose
#

i thought that was just a name

bleak egret
#

oh wait sorry

#

i thought there was a thing like a title tag when i saw yours

#

didnt realise it was a name

digital rose
#

oop , well idk maybe my computer broken lol

bleak egret
#

then why do you have a height and width for?

digital rose
#

for backround color of a box

#

i ment

#

height and width of a box

bleak egret
#

oh ye

#

well

#

hold on

digital rose
#

WAIT

#

I AM SO DUMB

#

i have two test.py and i was opening the wrong one

bleak egret
#

oh

#

because i just tested your code

#

and it worked

digital rose
#

why is it a small box in the middle for me

#

when i add padding it makes it super small and in the middle of the gui

#

what kinda witchcraft

bleak egret
#

i dont have a fixed geometry

#

not that that breaks stuff

#

but

#

try fullscreening your page

digital rose
#

from tkinter import *

import tkinter.font as tkFont

root = Tk()

title = Label(root ,text="DGS, LLC Customer Sales Database",height=7, width=60, bg="grey")

title.pack(pady=100,padx=100)

root.mainloop()

bleak egret
#

so is that wrong?

digital rose
#

it is supposed to look like this

#

but with bigger letters

bleak egret
#

this si what i get with your geometry

#

thats font siz then

#

try increasing font size

digital rose
#

you know there is a screen shot function built into windows 10 right?

bleak egret
#

LARGE_FONT= ("Verdana", 12)

#

wait what

#

if you mean sccreen snip

digital rose
#

type screen shot into the search bar

#

ya

#

that

bleak egret
#

i have to save it everytime

#

this is a quick one click sjortcut

digital rose
#

ah

bleak egret
#

and i dont have to save

digital rose
#

how do i add LARGE_FONT= ("Verdana", 12) to my coe?

bleak egret
#

where have you defined LARGE_FONT

#

"veranda" is font name

#

12 is size

#

you can add it at the top

#

after you import everything

digital rose
#

sorry i am confused how does largefont go with anything

bleak egret
#

you said the font size was too small

#

so this increases the font size

digital rose
#

i don't understand how i put it into my code

bleak egret
#

look at the to

#

p

#

this is a small part of my code

#

your already using it though

#

font = LARGE_FONT

#

there

#

in the lable

#

ping me if you need more help

digital rose
#

i been looking everywhere and i don't get were you call the variable large_font to have it connect with the label

#

@bleak egret ,sorry for needing help so fast lol

bleak egret
#

its fine

#

i have it on the 5th line

#
import tkinter as tk
from cash import *
from tkinter import *

LARGE_FONT= ("Verdana", 12)

digital rose
#

i mean when you add it to your label

bleak egret
#

you call it in the labvel

#

here see

#

in the label start page!

digital rose
#

at workeddd thanks]

bleak egret
#

font = LARGE_FONT

digital rose
#

it

bleak egret
#

np

digital rose
#

life saver

blazing temple
digital rose
#

i made blackjack from tkinter

#

do tell me if i can improve

digital rose
#

Great

eager beacon
#

can it show more than 4 cards?

viscid sluice
#

i wanted to ask about tkinter why "def call_me():"when i creat thos line and conected it "form1 = Button (windows, text="test", command=call_me())" the def line show frist whitout even touching the button line

plain elk
#

When you add () after a function, you call the function and assign what it returns, not the function itself

viscid sluice
#

can i show you my work its relly simple mybe you can reveiw it

#

oh ok iam understand thank you kindly stranger

past quarry
#

what's the diff between a GUI and and a UI

#

Is GUI a type of UI?

rocky dragon
#

Yes, you may also have a text user interface for example

alpine ember
#

Guys, I've created a PyQt5 GUI - I'm using a certain font that isn't being applied when running the GUI on windows? any idea how to fix this? The font is "Segoe UI" - it's preinstalled on windows

midnight zealot
#

Hellow. How can I bring the Menu written to the center? I am using tkinter.
Here's the code:

frame = LabelFrame(root,text=" Menu ",font=('Courier'),padx=100,pady=100)
frame.pack(padx=20,pady=20)
alpine ember
#

@midnight zealot You could try:

frame = LabelFrame(root,text=" Menu ",font=('Courier'),padx=100,pady=100)
frame.pack(sticky='n', padx=20,pady=20)
midnight zealot
#

sticky='n' will do that thing?

alpine ember
#

Sticky represents the direction the widget gravitates toward. In this case, the text should gravitate toward the north of the gui

#

n represents north

midnight zealot
#

Aight

alpine ember
#

This should help

midnight zealot
#

_tkinter.TclError: bad option "-sticky": must be -after, -anchor, -before, -expand, -fill, -in, -ipadx, -ipady, -padx, -pady, or -side

#

:(

languid sorrel
midnight zealot
#

Oh

#

Then how to do that?

languid sorrel
#

try anchor=tk.N

#

I haven't used LabelFrames so I'm not sure what exactly would work.

#

if that doesn't do it, try anchor=tk.CENTER or anchor=tk.CENTRE

midnight zealot
#

Actually I am new to Tkinter

languid sorrel
#

Does that work, though?

midnight zealot
#

Can you send the code

#
root = Tk()
root.title(" Menu")
root.iconbitmap(".\\ico\\Database.ico")
root.geometry("800x600")
root.resizable(0,0)

frame = LabelFrame(root,text=" Menu ",font=('Courier'),padx=100,pady=100)
frame.pack(padx=20,pady=20)

Here's the one I wrote

languid sorrel
#
import tkinter as tk

root = Tk()
root.title(" Menu")
root.iconbitmap(".\\ico\\Database.ico")
root.geometry("800x600")
root.resizable(0,0)

frame = LabelFrame(root,text=" Menu ",font=('Courier'))
frame.pack(padx=100,pady=100, anchor=tk.N)
#

try it. Play with values and anchor directions a bit.

midnight zealot
#

Didn't work

unique forge
midnight zealot
#

Same output

#

It's just changed the position of the frame when I use NE, S and all

alpine ember
#

I get this on Mac

languid sorrel
#

try looking up on tkdocs.com or python documentation for tkinter. If nothing works raise a question on StackOverflow. Make sure using two tags python and tkinter. Me or probably Bryan, cool cloud or acw will answer that.

alpine ember
#

The sizes and fonts are set to be the same... but they're not?

#

How can I get the program to behave the same across different os

languid sorrel
alpine ember
#

I removed the menu bar

#

I just need it to display the same across different operating systems

languid sorrel
#

that was just an example for difference of UI elements.

alpine ember
#

For a "cross-platform" gui library, tis a bit false in its claims

languid sorrel
#

But you can't overcome OS limitations, right? Python is said to be cross-platform but there are so many things which change across platforms.

What widget is that anyways?

#

although It should not happen in this scenario.

alpine ember
languid sorrel
#

I was asking about the ProgressBar only.

#

and do you wish use the windows view or the view on the mac?

midnight zealot
#

Thanks

alpine ember
#

but am using mac

digital rose
#

Im using pygame to create a gui but the display isnt working, what can I do to fix it

junior quiver
#

or if it would even be possibly at all?

lost dragon
clear rose
#

is this good place to ask about speech recongnition

sharp jackal
#

i dont think so

#

i am not trying to moderate, but since you asked, i think a better place wold be #python-discussion or a help channel

digital rose
#

i need tkinter help

signal wave
#

is there any way to make the background of a tk canvas transparent? i want to print text on it so i can see it on top of other application windows

unique forge
#

@digital rose ask!

digital rose
#

@unique forge , I have it so my tkinter gui button opens another tkinter gui but when i destroy the first one it doesn't work it just stays there and crashes if you press it

upbeat nacelle
#

How are you exiting your tkiner window? It might be executing the whole GUI class in the terminal and not a singular window

digital rose
#

It opens two different terminals, but i use example.destroy(), @upbeat nacelle

upbeat nacelle
#

I have a feeling that when you use destroy, it stops the tkinter.init() and doesn't let you keep going.

digital rose
#

everywhere i look on how to close it says destroy

#

i can't find a diferent way anywhere

rough tusk
#

Hi everyone! I'm not sure if this is the place to ask a question like this since it doesn't pertain to making a user interface.

#

I'm looking for tools to read a user interface.

true wolf
teal hearth
#

I have two PySide 2 UI's Ive created and I have two buttons in a script which launches each of them. I want the second one's features to be disabled if the first one is active. anyone know how I can achieve this ?

little kite
amber kite
#

is it possible to make a python file executable but not readable

unique forge
#

what do you mean?

#

a EXE

amber kite
#

no, like run a py file with python, but not read/open/edit the file

plain elk
#

No

prisma meadow
#

Hey! I want to start working with python UIโ€™s but all Iโ€™m wondering is where do I actually see the output?

#

Is there a window I havenโ€™t found yet?

tight sail
#

What do you guys think of Qt?

#

AKA PyQt5

#

I've just started getting into it

unique forge
#

@tight sail its greqt

#

*great

#

I used QT Designer to make an app and it worked great

tight sail
#

Nice

#

Thanks

unique forge
#

You should use QT Designer too

tight sail
#

i just started using it

#

its really cool

unique forge
#

Heres the app

#

QT Designer made it a lot easier

tight sail
#

what does it do?

#

i downloaded it

#

yoooo

#

@unique forge That actually a fucking awesome app

unique forge
#

Thank you soooo much

#

Ive had a lot of people say that

scenic bronze
#

Has anyone here had experience with kivy? Ive started learning it but the float layout confuses me

#

also. have you made an android app with it?

rotund vault
#

Hey all so I'm using a slightly modified version of a custom pyqt5 widget I found for a custom EV dash display: https://github.com/StefanHol/AnalogGaugeWidgetPyQt

I just profiled my code, and although I have several dozen other labels, buttons, sliders, and progressbars, this one widget is responsible for 95.5% of the cpu time for the entire GUI, because when updating the value of the analog needle it calls self.update() which redraws the entire widget including static elements like the radial scale, scale text, scale markers, etc... the only dynamic element, the needle, requires just 2% as much time to draw as all these elements...

I realize I could get around this by just duplicating the widget to create a 'static' one with hidden needle and another 'active' one with only the needle visible. But there must be a better way to update just part of this widget? I've read repaint() should not be used directly.

rotund vault
#

Hmm even with those elements disabled, they are still being updated with self.update, so I'm not actually working around the issue. Seems I would have to fork it into two widgets, a static and dynamic widget to optimize speed while using the otherwise optimized builtin .update() method.

past locust
#

@amber kite thats a corrupted file ๐Ÿ˜† u cant program it. U just corrupt a file, and lo its not readable to a great extent

amber kite
#

but can you run a corrupted file?

past locust
#

Not really

#

As i said , u can't program it, so theres no question of running it.

covert iron
#

im getting this error whenever i try to convert an ui file

#

to a py file

#

pls help me with this

#

im just a beginner

#

anyone?

alpine ember
alpine ember
#
pyuic5 -x <ui file goes here> -o <name of your new py file here>
#

maybe try: pip install pyuic5

austere iron
#

I'm not new to Python, but I'm 100% in terms of building GUIs with Python. What is the best GUI framework out there?

unique forge
unique forge
# covert iron

try searching for pyuic5.exe, and run the command from there

rotund vault
#

I also like pyqt5/Qt Designer

#

Very easy to redesign/style up GUI's.

alpine ember
#

Sorry: pip install pyuic5-tools

#

How do I design a professional looking gui

unique forge
#

@alpine ember I wouldnt recommend python for that

#

Python isnt best for GUIs

lone python
eager beacon
#

@unique forge What are you talking about?

#

Pyside2/PyQt looks exactly the same as the C++ counterpart

#

that's because its just a python wrapper for qt

last dagger
#

i don't know if this applies here, but the python innteractive shell is also an user interface ...

#

can i somehow change autocompletition in the python shell, so that it completes also strings to filenames?

#

do i have to modify the rlcompleter for it?

eager beacon
#

just use IPython

#

it has lots of nice features, including auto completion.

last dagger
#

i know ipython, but i wan to know if i can write some autocompletition for special purposes myself ...

eager beacon
#

oh, you only asked about auto complete in strings which IPython does. I'm not sure how to go about customizing autocompletion.

last dagger
#

hmm maybe my question wasn't clear. I found something called fancycompleter and i look now how its done there

sweet kindle
#
import tkinter as tk
 
window = tk.Tk()
 
window.title("GUI")

l1 = tk.Label (window, text="eureka!"))
 
window.geometry('350x200')
 
l1.grid (column=0, row=0)

bt = tk.Button (window, text="Enter")
 
bt.grid (column=1, row=0)

window.mainloop()
#

whenever i try running this python freezes and says application stopped working

#

oh wait nvm now it works

#

as soon as i ask for help here it works

half yacht
#

Does anybody know how to make writing effect in Urwid?

eager beacon
#

@sweet kindle you have an extra closing parenthesis on l1

sweet kindle
eager beacon
#

@half yacht What do you mean by writing effect?

cunning shoal
#

Which library is best for creating modern looking interfaces?

#

I don't like the ways tkinter looks

whole dagger
#

Pyqt5

eager beacon
#

pyside2/pyqt

shadow oasis
# cunning shoal I don't like the ways tkinter looks

There's ttk, a more advanced (and poorly documented) version of Tkinter which uses native OS elements and a theming system to make GUIs. But there are better options, like PyQT, which comes with PyQT designer which is a drag and drop window creation tool, it will write the code for the window for you, you just have to write the backend stuff

unique forge
#

but PyQT is definitely the best one for Python

eager beacon
#

define better

unique forge
#

I guess more advanced

#

isn't Windows OS made with C#

eager beacon
#

than qt?

#

no

unique forge
#

QT is advanced

#

don't QT have something for C# too?

eager beacon
#

probably

unique forge
#

LG WebOS was Made with QT

#

and Mercedes Entertainment system

#

but I dont think that was Python/PyQT

#

or C++

eager beacon
#

it was c++

#

at least for mercedes

unique forge
#

ok

#

Can you help me with normal Python?

eager beacon
#

open a help channel so we don't spam this channel with off-topic chat

unique forge
#

can I do it in DMs?

dapper frost
#

Hey everyone

dapper frost
#

how do i take combo box as input ? in PySimpleGUI

robust oak
#

Using Tkinter hwinfo_height and hwinfo_width both return 1 and so does hwinfo_reqheight and hwinfo_reqwidth. Both self.update() and self.update_idletasks() have no effect when executed before the hwinfo methods.

#

I think it's because it hasn't maximised the window yet

clever light
#

Henlo c:
How i can clear all widgets in Tkinter?

elder hill
#

hello guys I need help with a simple task

#

How do I put an image as background in a tkinter window

eager beacon
#

@worn viper what is it about kivy that you prefer?

digital rose
#

File "C:\Users\linkm\Desktop\classpro\Reports.py", line 13, in quary
for record in base[0:]:
TypeError: 'sqlite3.Connection' object is not subscriptable

#

def quary():
base = sqlite3.connect('NewSales.db')

print_records = ""
for record in base[0:]:
    print_records += str(base) + "\n"
#

I am trying to have a button print the database on the gui

unique forge
#

@digital rose what GUI library are you using?

digital rose
#

tkitner

#

tkitner

#

tkinter

unique forge
#

ok

digital rose
#

@unique forge

#

oh

#

i can send all my code if you want'

unique forge
#

yes please

#

make sure to use code snippets though

#

!code

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.

uncut garnet
#

Anyone know any good alternatives to PyQtWebEngine

digital rose
#
import tkinter.font as tkFont
import sqlite3
Reports = Tk()
def Exit():
     Reports.quit()

#loop thru results
def quary():
    base = sqlite3.connect('NewSales.db')

    print_records = ""
    for record in base[0:]:
        print_records += str(base) + "\n"
    print(print_records)


title = LARGE_FONT = ("Verdana", 15)
ec = medium_font = ("Verdana", 12)
Reports.geometry("420x232")

title = Label(Reports ,text="Reports",height=4, width=60, bg="#333333", font=LARGE_FONT,foreground="white")
title.pack()

cl = Button(Reports, text='Customer list',height = 2, width = 60,bg="grey",font=medium_font,foreground="white").pack()
ps = Button(Reports, text='Sales',height = 2, width = 60,bg="grey",font=medium_font,foreground="white",command=quary).pack()
exit = Button(Reports, text='Exit',height = 1, width = 60,bg="grey",foreground="white",command=Exit).pack()

Reports.mainloop()```
#

@unique forge

unique forge
#

so what do you want to do

digital rose
#

I want the data base to be printed under the button when the button is pressed

#

so like if u press the customer button it will print all the customer names under the button

#

do you want me to @unique forge when i answer?

unique forge
#

no

#

why dont you use a label?

digital rose
#

I guess i should lol that would make sense, do you mean instead of the print command i put label?

#

how would i go about printing the data base that way tho?

maiden nymph
#

hi guys, i am trying to get my tkinter label text font size be somewhere around 20 but i can't seem to find a way to do it

real sand
#

oh my god

#

i finally got opencv to properly display a black and white image on pyqt

#

the slider controls the max threshold for the grayscaling

eager beacon
#

Were you having trouble getting the image to display?

keen path
#

@maiden nymph

label.config(font=("Courier", 20))
#

well the font doesnt rlly matter just choose any

real sand
#

idk how it would sigsegv with the choice of, say argb32_Premultiplied as opposed to just argb32

#

im still sort of novice with python ๐Ÿ˜…

snow saffron
#

hi guys how would i make my search bar look up items in my catalogue

#

butt = Button(fram, text='Search')
butt.pack(side=RIGHT)
fram.pack(side=TOP)

maiden nymph
#

label is not defined

#

i used this ```Label.config(font=("Courier", 20))

#

then i put Label.config(self, font=("Courier", 20)) and it says NameError: name 'self' is not defined

#

@keen path

swift tide
#

I tried selecting a value in Combobox, but it doesn't work. It just stays blank.
Code (using tkinter):

n = StringVar()
methodEntry = ttk.Combobox(Frame, textvariable=n, state="readonly") #create Combobox
methodEntry["values"] = ( #fill combobox with values
    "GET",
    "POST",
    "PUT",
    "GET",
    "PATCH",
    "DELETE",
)
for x in range(len(methodEntry["values"])): #iterate over fields of combobox
    if methodEntry["values"][x] == 'GET': #find entry that has content 'GET'
        methodEntry.current(x) # Select the entry 
        break #stop iterating
methodEntry.grid(row=0, column=0) #place combobox in frame

Screenshot:

snow saffron
#

guys how do i allow the user to enter a search keyword and display all products that match the keyword?

swift tide
#

@snow saffron write a function to search for keywords, pass the input to the function when pressing 'Search' button

snow saffron
#

can u gimme an example please @swift tide

maiden nymph
#

oh, now i got my font thing to work

coral hazel
#

Hey guys. Im looking for a light weight gui library that integrates well with matplotlib. Something that is quick to implement. Any suggestions?

#

Please @ me if you respond. Thank you.

alpine ember
#

What's a professional colour scheme / theme for ui?

real sand
#

get a color palette from any website

#

or

#

use an ide or desktop theme that already exists and build from that

#

if you're using qt then it will automatically use the system themes from whatever system it's running in, esp. KDE or gnome (really any system that supports gtk themes)

#

personally I use a modified version of Ayu Dark from teabyii, which is a sublime text and vscode ide

north ore
#

hey anyone using the kivy framework to make user interfaces?

#

any idea whats the reccomended framework to make mobole apps

coral hazel
#

Not sure what the use case for python on a mobile apl would be. Why not Java if its Android?

north ore
#

Wanna make cross platoform, i would have to learn both

digital rose
#

Hello I want a scraper from txt file my scraper read only one lines but one data required other I want read both of them but I dont know how I can make this ? (Data can change anytime)

glass dagger
#

Anyone with PyQT5/Pyside2 experience? I'm having trouble fixing something:

On software, for example, discord, when you maximize the window, if you go to the title bar with your cursor and try to move the window, the window would unmaximize and you would be able to move it as it was before with the cursor locked onto the same place it gripped on in the first place.

I have done this with my program, however, when you try to move the maximized window, it unmaximizes like how it was before. The grip is still there so you can still move the window but the cursor is not gripped onto the window as it is moving.

How would I solve this problem?

I'm happy to screenshare to show the problem ๐Ÿ™‚

elder hill
#

hello guys can someone help me please?

glass dagger
#

Sure

elder hill
#

um so I have a code and I kinda got lost doing it I'm a beginner

#

I'm trying to make a login system using tkinter for GUI

glass dagger
#

Ok

#

What you need help with?

elder hill
#

um I just generally got lost writing the code and I was wondering if you wouldn't mind checking it please?

#

if that's possible?

glass dagger
#

Sure

#

Sorry for late reply

eager beacon
#

@glass dagger do you have a video of what you're talking about?

jagged karma
#

from PyQt5.QtWidgets import QApplication, QLabel
app = QApplication([])
label = QLabel('Hi Everyone!')
label.show()
app.exec_()

glass dagger
#

You can mute mic

eager beacon
#

oh, I don't have a mic hooked up anyway

#

I didn't realize you hade created a custom title bar.

#

I can help with the stackoverflow question though

#

Can you post your code for the title bar?

#

@glass dagger

glass dagger
#

Its a .ui file into a .py

#

With pyside2

#

I can screen share and show you the the problem

maiden nymph
#

hi guys, quick question. so i am using tkinter to display some labels and i have these 2 DateTime_label.grid(padx=300, pady=450) weather_label.grid(padx=450, pady=300) when i run the program only the first one "DateTime_label" is displayed. why is that?

keen path
#

show me your code @maiden nymph

#

cuz i suspect that label to have nothing inside

eager beacon
#

!e print(450+10+450+300)

proven basinBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

eager beacon
#

hmm

#

okay so 1210 pixels before the second widget is allowed on the screen assuming a height of 10 pixels for the widget

#

do you have a 1080p monitor?

eager beacon
#

Is there a point this video?

#

<@&267629731250176001> this video is being spammed in different channels

sour girder
#

!pban 778272866663530496 Video spam.

proven basinBOT
#

:incoming_envelope: :ok_hand: applied ban to @valid plank permanently.

digital rose
#

Hi, I have a lot of problems with installing kivy, I solved some of them but now I don't know what to do, does anyone know what's going on and how to fix it?
There is link to pastebin with error content https://pastebin.com/UhXy3XKt. This error occurred while installing the kivy with command
python -m pip install kivy == 1.11.1

tribal path
#

pip install kivy[base] --pre you shouldnt be using 1.11.1 with py3.8

digital rose
#

ok thanks it works

digital rose
#

hi, i'm try to make os with python and my gui is bad or good ? (send a advice pls)

#

making os using python?

#

yep

#

i trying

#

but its so hard

#

:c

maiden nymph
# keen path show me your code <@!698327537884987532>
from tkinter import *
import requests
from datetime import datetime
import sys

api_address = "http://api.openweathermap.org/data/2.5/weather?q=Tucson&appid={My API Key}"

root = Tk()
root.geometry("{0}x{1}+0+0".format(root.winfo_screenwidth(), root.winfo_screenheight()))


json_data = requests.get(api_address).json()
formated_weather_data = "Main: " + json_data["weather"][0]["main"] + "\n" + "Description: " + json_data["weather"][0]["description"]
weather = json_data["main"]["temp"]
weather_in_farenhite = round((weather * 9/5) - 459.67)
formated_temp_data = "Temp: " + str(weather_in_farenhite) + "ยฐF"
formated_pressure_data = "Pressure: " + str(json_data["main"]["pressure"]) + "inHg"
formated_humidity_data  = "Humidity: " + str(json_data["main"]["humidity"])
formated_windSpeed_data = "Wind Speed: " + str(json_data["wind"]["speed"])
formated_Sunrise_data = "Sunrise: " + str(datetime.fromtimestamp(json_data["sys"]["sunrise"]))
formated_Sunset_data = "Sunset: " + str(datetime.fromtimestamp(json_data["sys"]["sunset"]))
DateTime = str(datetime.now())[:19]

weather_label = Label(root, text=formated_weather_data, font="times 24 italic")
Temp_label = Label(root, text=formated_temp_data, font="times 24 italic")
pressure_label = Label(root, text=formated_pressure_data, font="times 24 italic")
humidity_label = Label(root, text=formated_humidity_data, font="times 24 italic")
windSpeed_label = Label(root, text=formated_windSpeed_data, font="times 24 italic")
Sunrise_label = Label(root, text=formated_Sunrise_data, font="times 24 italic")
Sunset_label = Label(root, text=formated_Sunset_data, font="times 24 italic")
DateTime_label = Label(root, text=DateTime, font="times 24 italic")

DateTime_label.grid(ipadx=500, ipady=350)
weather_label.grid(ipadx=450, ipady=300)

root.mainloop()```
#

i am trying to make some sort of window to collect weather data and then put it on the screen.

#

oh, got it to work

#

looks like it was a weird coordinates thing. also, how can i find the coordinates of the place i want to put the label? i know i worded my sentence wrong

keen path
#

i dont understand @maiden nymph

maiden nymph
#

understand what

#

oh

#

this also, how can i find the coordinates of the place i want to put the label?

#

so, i want to place these labels in different coordinates on the window but, i do not know where each coordinate is. is there an easy way to know where each coordinate is?

shadow oasis
#

@maiden nymph you should write code like this:
```python
<Your code here>
```

maiden nymph
#

oh

#

ok

#

edited it

shadow oasis
#

It enables syntax highlighting, so it's a bit more readable

maiden nymph
#

got it

fiery river
#

Hello how can i build a gui application on python

vague gale
#

Use Pyqt5 @fiery river

#

There are also other libraries such as Kivy and Tkinter

#

But pyqt is the best imo

eager beacon
#

PySide2 == PyQt5, so go with either of those

#

If you do choose PySide2 and you don't know how to do something, you can always use PyQt5 in your google search and most code you copy will work without modifying anything but the import statements

molten basalt
#

hi, im trying to make a part of my program throw an error message when anything other than lower case letters are entered into a text box but im having difficulties, any ideas?


        try:
            # get the selected button. Use  getSelectedButton()["value"]
            sel= self.group.getSelectedButton()["value"]
            # get the data entered in textField. Use getText () method
            MSG = self.textField.getText()
            # if selection is "encode" = use encode_text () method, otherwise
            if(sel == "Encode"):
                newtext = (encode_text(MSG))
            # "decode_text () to obtain encrypted or decrypted text
            else:
                newtext = (decode_text(MSG))
            # display the text in output field using setText() method
            self.output.setText(newtext)
            self.Invalid.delete(0,END)

        except:
            self.Invalid = self.addTextField("Invalid Text", row=1, column = 2)
            if(MSG.isupper() != MSG):
                messagebox.showerror('Error','Error: Text must be lower case') 
            elif(MSG.isspace() != MSG):
                messagebox.showerror('Error','Error: text must not contain spaces')
            elif (MSG.isdigit() != MSG):
                messagebox.showerror('Error','Error: text cannot contain numbers')
eager beacon
#

Do you really need to have an error for this?

#

@molten basalt

#

I think forcing the text to lower case would be easier and less problematic

molten basalt
#

yes i need to throw an error

#

@eager beacon

eager beacon
#

hmm, okay

#

Why?

molten basalt
#

because its part of the project parameters

eager beacon
#

Okay, then just use if/else

#

there isn't an exception that covers a text case

#

and it appears you just need to show the message box, is that right?

#

not actually raise a python error or catch something in try/except?

compact dagger
#

so im building a UI and integrating another loop that updates the UI. Im working with tkinter on this one
my problem is integrating the 2 loops together. I understand threading and things like that, is there any
resource i can use to understand how to thread in tkinter

eager beacon
#

Usually the rule with threads inside a GUI is to use them however you normally would but don't update any elements in the GUI from the threads.

digital rose
#

WHY IS THERE NO GOD

#

I need help

eager beacon
#

with what

#

please don't say tk

digital rose
#

Sorry it just really felt like it when he gave me a brain that can't function properly

#

I don't know how to put rows and columns on buttons in tkinter

#

And when he gave both my grandfathers cancer but that is for another time

eager beacon
#

what do you mean you don't know what to do with the rows and columns?

#

What have you tried and what happened ?

#

row 0 col 0 would be the top left of your window/container I'd imagine

digital rose
eager beacon
#

you don't need pack

digital rose
#

Ohhh i didn't see that there

#

Lol

#

Thanks

amber roost
# compact dagger so im building a UI and integrating another loop that updates the UI. Im working...

I wrote this up once, the general idea is having a self-calling .after routine which repeatedly checks a queue the thread writes into: https://gist.github.com/Square789/46b0fdf0905c229567798ff9f3ebc275
The queue contains tuples where the first element is an enum-ish signal constant and the next elements can be pretty much whatever information you want to pass between thread and UI.
It gets more complex though if you want to i. e. stop a running thread or ensure a safe and quick shutdown of your app with running threads, just ping me if you have more questions regarding that

compact dagger
#

that makes perfect sense thanks @amber roost

molten basalt
#

my except: always launches for some reason at the start of my code, how do i prevent this?

try:
            # get the selected button. Use  getSelectedButton()["value"]
            sel= self.group.getSelectedButton()["value"]
            # get the data entered in textField. Use getText () method
            MSG = self.textField.getText()
            # if selection is "encode" = use encode_text () method, otherwise
            if(sel == "Encode"):
                newtext = (encode_text(MSG))
            # "decode_text () to obtain encrypted or decrypted text
            else:
                newtext = (decode_text(MSG))
            # display the text in output field using setText() method
            self.output.setText(newtext)
            self.Invalid.delete(0,END)

        except:
            self.Invalid = self.addTextField("Invalid Text", row=1, column = 2)
            if(MSG.isupper() != MSG):
                messagebox.showerror('Error','Error: Text must be lower case') 
#

sorry chris for not coming back earlier, my dad needed my help before you responded so I had to go AFK

#

@eager beacon

eager beacon
#

I don't know

#

are you trying to encode a non existant MSG, or is it that delete?

#

If you just need to show a message box I don't see a reason for using try/except since you there are no exceptions for when the case doesn't match what you say it should be.

#

you'd have to define you're own exception for that

flat herald
#

@keen path is it okay to tag you? are you good with syntax highlighting

keen path
#

yeah tag me

#

if itโ€s needed

keen path
#

are u making a text editor

flat herald
#

ok, so i know pygments and i know yaml

#

thing is

keen path
#

oh i thought u were talking about tkinter

flat herald
#

i dont know how to properly use pygments, i tried to read the docs, i understand it, but cant really apply it on syntax highlighting

#

and how would i do that with yaml?

#

so i want some help

keen path
#

@peak turret

peak turret
#

yep

keen path
#

shi

#

i deleted that code

#

well i made a program in tkinter that

#

it's basically a drawer

#

like MS Paint

peak turret
#

ye

keen path
#

i only have the exe

#

how foolish i am

peak turret
keen path
#

k

peak turret
#

@keen path outline =1

keen path
#

?

#

@peak turret

peak turret
#

nothing

#

how long you plan?

#

@keen path

keen path
#

? @peak turret

keen path
#

@wet aurora

#

show your code

wet aurora
#

for

#

@keen path

keen path
wet aurora
#

lol my file has 300+ lines of code

keen path
#

oh ok

snow saffron
#

How do I add an image inside a class for a gui

maiden dragon
#

can someone give me some help with pyinstaller. I want to package a folder with my GUI and id rather not specify each subfolder and file inside it in my .spec file

#

is there a way i can write a single like of code to the .spec file so that it bundles the folder and all of its contents

#

a.datas += Tree('./dir_to_include', prefix='dir_to_include') something like this maybe found on stack exchange but not available to test it right now

finite ruin
#

Should I use Tkinter or Guizero for making UI's in Python?

wet aurora
#
r = PhotoImage(file = 'images/register_btn.png')
Button(root1, image = r, command = register_user, borderwidth = 0, highlightthickness=0, bg = '#f59042', activebackground = '#f59042').pack()
```Why does this not show the button? No errors
median vector
#

oh

#

man

#

has

#

anyone

#

some

#

tutorial

#

for

#

the

#

user

#

interface

#

but

#

in

#

a

#

website

#

?

unique forge
#

@median vector why are you writing on diferent lines

#

that kind of is spamming

median vector
#

oh

unique forge
#

what do you want to use to create a UI @median vector

#

which module

median vector
#

i want to create a login

unique forge
#

yes

#

but which module

#

do you want to create a app, or a website

median vector
#

website

deep lintel
#

I use pygame for the user interface

unique forge
#

ok

deep lintel
#

For a app

unique forge
#

it's meant for games

deep lintel
#

What?

#

Yes

unique forge
#

for a website

deep lintel
#

It s for games

unique forge
unique forge
deep lintel
#

Ok

median vector
#

oky thank u

unique forge
#

and you might want to know HTML

median vector
unique forge
#

what about wordpress

#

or squarespace

unique forge
median vector
#

because its free and its unproffesionell

unique forge
#

then use wordpress

unique forge
median vector
#

yea, but i need it for my project

unique forge
#

ok, does it have to be programmed?

median vector
#

nope, i only need the login form

deep lintel
#

Qui est fr

#

who is french

median vector
#

nope

unique forge
#

but does it have to be functional

median vector
#

oky thx

unique forge
#

does it have to work

#

or just looks

#

@median vector

median vector
#

both

unique forge
#

pip install django

median vector
#

okay, what is the next step?

unique forge
#

find a tutorial

#

and learn it

median vector
#

okay

unique forge
median vector
#

i hope xD

unique forge
#

do you know normal python?

median vector
#

yes xD

unique forge
#

ok

#

Django is different

#

as it uses HTML

#

but it also uses Python as a backend

median vector
#

ah okay

unique forge
#

Frontend is HTML, CSS, JavaScript

#

Backend is Python

#

im sure you can google up a login template with HTML

lone zodiac
#

I'm trying to make a simple 2048 game. What's the best way to do this with a ui? It would be cool to have animations similar to the original and be able to put it in a website(though I have no idea how that works)

maiden dragon
wet aurora
#
ok_btn = PhotoImage(file = 'images/ok_btn.png')
Button(root4, image = ok_btn, command = delete4).pack()
```help what is wrong with this?
modern marsh
#

separately

#

like a = Button()

#

and a.pack()

wet aurora
modern marsh
#

hmm

#

what is the error btw

#

@wet aurora

wet aurora
#
exit_btn = PhotoImage(file = 'images/exit_btn.png')
Button(command = exit_main, image = exit_btn, borderwidth = 0, highlightthickness=0, bg = '#f59042', activebackground = '#f59042').pack()
```This works
wet aurora
#

just the button doesn't show

modern marsh
#

oh ok

wet aurora
#

@modern marsh root4 = Toplevel(root)

modern marsh
#

uhh

wet aurora
#

but that should not make any diff

modern marsh
#

why do you do import * lol, it confuses me

wet aurora
#

the button images work on root

#

but not on any other roots

modern marsh
#

hmm

#

there might be a deeper reason for this

#

idk why its happening

wet aurora
modern marsh
#

this might not be a good idea

#

but how about you make a new frame

#

and put the button there

wet aurora
#

I will have to do too much work

modern marsh
#

Frames are easy

#

i do tkinter stuff all the time

wet aurora
#

so I make new frame and then place the button there?

modern marsh
#

ye

narrow swift
#

hey can someone help me adding scroll bar

#

lol

#

here is my code

wet aurora
#

@modern marsh frame also didn't work

narrow swift
#

@wet aurora can you help me fix mycode ?

#

hey

#

you here

lament nimbus
#

yes

#

hi

#

do you want to join a discord call

#

?

narrow swift
#

what langauge you speak

lament nimbus
#

english you?

narrow swift
#

mhmmm i cant tho lol

lament nimbus
#

ok

narrow swift
#

but i can explain here

#

all i want to add scroll bar on my Listbox

lament nimbus
#

ok

narrow swift
#

this one actully working

#

but the possition is wrong

lament nimbus
#

so you've already implemented the scroll bar function you just don't have it in the right position?

narrow swift
#

yeah is it working for you ?

lament nimbus
#

it allows me to scroll

narrow swift
#

can you show me UI as screenshot

lament nimbus
#

but there isn't a visible scroll bar

narrow swift
#

top middle but its working

#

lol

lament nimbus
#

oh i see

narrow swift
#

all i want to come on its place

#

lol

lament nimbus
#

is that where its supposed to be?

narrow swift
#

that was my old code when i used to add that code in frameR class

lament nimbus
#

oh ok

narrow swift
#

check my new code

lament nimbus
#

can u send ur new code?

narrow swift
#

repl is nice i like it

#

๐Ÿ˜„

#

but i never realised that it even have a UI window ๐Ÿ˜ฎ

lament nimbus
#

lol

wet aurora
narrow swift
#

nice rectangle

lament nimbus
#

cant you just manually set the pos for the scroll bar

wet aurora
#

images on button won't work

narrow swift
#

is that a button ?

#

wow pretty