#user-interfaces

1 messages · Page 87 of 1

ancient mural
#

😅

quaint hearth
#

or use Mad_lbl = Label(root, text='Mad').grid(row=0, column=0)
its better

ancient mural
#

not that

quaint hearth
#

okay

quaint hearth
ancient mural
#

umm sorry but not really what i was looking for

quaint hearth
ancient mural
#

i want to know where i should put it not how i should put it

quaint hearth
ancient mural
#

i cant decide

quaint hearth
#

lmao

#

i suggest to put it Bottom

ancient mural
#

but then the other corners look empty

quaint hearth
ancient mural
#

hmm

#

yea

#

what should i put in the middel

quaint hearth
#

is it a AI application?

ancient mural
#

yes

quaint hearth
#

oh

ancient mural
#

ai assistant to be exact

quaint hearth
#

save some space for the AI ig

quaint hearth
lime monolith
#

In MainModule when using add, the classes are not being called and when you do call them they should probably be passed in a parent window. For example General should probably be General(self). The ttk.Frame's need changing to except the parent and pass it to super.

class MainModule(ttk.Notebook):
    def __init__(self):
        super().__init__()
 
        self.add(General,text="General")
        self.add(SCF,text="SCF")
        self.add(Optimization,text="Optimization")
        self.add(Thermochemistry,text="Termochemistry")

Edit: self.notebook = main_module.MainModule() MainModule also does not have a parent set

#

As stated above your __init__'s need to take in a parent and that parent need passing to super

#

example

class General(ttk.Frame):
    def __init__(self, parent):
        super().__init__(parent)
#

like here self.runtype_label = ttk.Label(self,text="Runtype:") there is a Label, self is it parent

#

yep I said that back there too 😉

proud walrus
#

I heard the docs for GTK on Python suck, is that true?

lime monolith
#

The link says

Give all rows and columns the same non-zero weight.

ancient mural
#

has anyone here worked with figma?

wary grotto
#

i actually prefer using place

#

xyz.place(x=0, y=0)

deep berry
#

what package can i use for ui

regal glen
#

Okayy

night niche
#

the only user interface library I use is msvcrt (MicroSoft Visual C RunTime), and I use two methods from it, getch and kbhit

#

XD

digital rose
#

any libraries that have some good looking UI styles

night niche
#

specifically gui, or any user interface?

#

maybe try kivy

digital rose
sinful fox
#

Looking for help with PyQt5. I need to update an svg image in realtime by changing colors of some of its elements, but I can't find any examples. Can someone give me a hint?
Apparently I could read the initial XML, store it somewhere, then change and rerender it, but I wasn't able to figure out how exactly

ocean pasture
#

how do i make an if statement over a button click in tkinter
like print "hi" when i click a button named CLICK ME!

sinful pendant
#
Button(root, text="abc", command= your_function)
#

Make sure that u dont put () after ur function in above statement

livid dune
#

Does anyone know how to find out the x coordinates of the center to place buttons there

#

i have my geometry of the application set to "400x450", but place(x = 200, y = 225) doesnt placce the button in the center

knotty coyote
#

Is there a way to use a python dataclass (python 3.8) with tkinter to share data across different classes?

I was thinking I could create a dataclass and inherit that class in my different views to get the data. But that seems to be a horrible way to do it.. since it's not working.

Honestly I'm still grappling with how to best design this app in the first place. Trying to avoid dropping global vars everywhere and was hoping I could just create a couple different dataclasses to inherit from.

https://github.com/MikeCase/mkvhost

Is the repository with the code I'm currently working with. In the GUI directory I have main_screen.py and containers/main_screen_containers.py which are my classes with the different Frames for my main screen.

My dataclass is currently in containers/main_screen_containers.py called ScreenData.

Maybe I'm just using dataclasses entirely wrong but thought I'd drop a question and see if anyone could point me in the right direction.

GitHub

a python app to aid in creating and configuring a virtual host using Cloudflare DNS. This app will create the dns record on Cloudflare for you. As well as setup apache/nginx/caddy configs to enable...

sinful pendant
ancient mural
#

please rate

digital rose
amber acorn
#

what's the best way on structuring A basic Python application using tkinter

livid dune
#

does anyone know how i can make a label display a variable

wary grotto
wary grotto
#

np

ancient mural
#

whats redundant in this
and how can i make it better?

mighty rock
#

I think Mood: Happy is all I need a label for

#

Add a weather icon to the weather thing so I don't think it's the temperature of my machine

#

Possibly changing with the type of weather

ancient mural
#

i think i dont even need the date and time there tho

ancient mural
#

please help

#

where should i place the "mood" and the "weather"?

proven basinBOT
#

@digital rose Please don't try to ping @everyone or @here. Your message has been removed. If you believe this was a mistake, please let staff know!

karmic junco
#

I need to generate a4 size paper having 16 somekind of lines of info well formatted.. which will be having values from db..

I don't have any idea how can I do it

Sorry if it's wrong channel

green stump
#

Is there a way to get a callback whenever something is edited on a lable with editable interaction?

        label = qtw.QLabel(parent)
        label.setText(process.title)
label.setTextInteractionFlags(qtg.Qt.TextEditorInteraction)```
young sedge
#

second option could be tricky in available style formatting
while first option is certainly rich in all kind of formatting and often a lot of people know how to format in HTML/CSS, but learning curve can be tricker to people aren't familiar with it

lofty rain
#

Why does DearPyGui fail when ever i put add_text in my loop function

green stump
#

Does anyone know how to download pyside2-rcc it didn't come with my installation?

sick carbon
sinful pendant
# ancient mural

I should say just make riungh ui and work on backend properly then making the ui beautiful

wheat harness
#

how to change color of horizontal line in pyqt (not background color, just color of the line)

lofty rain
#

how would I get the string of what is in an input text dpg.add_input_text(label="Text Input 1", tag="string_value"), how would i know what has been typed in?

stray jackal
#

is there a gentle , beginners tutorial on QT

#

i appreciate the guidance

#

simple examples are best

final breach
#
C:\Users\minua\Downloads>ui.py
Traceback (most recent call last):
  File "C:\Users\minua\Downloads\ui.py", line 192, in <module>
    import imgs_rc
ModuleNotFoundError: No module named 'imgs_rc'```
Why does it not work?
#

when qt designer generates this code

#

what other python interface libraries also have something like qt designer?

high sapphire
viscid dune
#

Need help with tkinter. I've put up my query in the help mango channel

#

If someone can take a look

sharp reef
#

if i wanna make my own tui library, any reference that could be useful if i want to get started?

deft knoll
#

how to turn on/off tkinter checkbutton with toggle key?

cunning quest
#

can uyou help my

#

@slow hedge

#

@glacial star

#

@lofty rain

#

@deft knoll

#

@stray jackal

#

@wheat harness

dusk mango
#

@cunning quest Please don't ping people for help. Ask your question, and someone will help if they can.

wet cave
#

I’m guess there is a away but i can’t find out, in pyqt5 is there a way “refresh” the window if a button is added?

pure palm
#

I want to build a desktop app that reacts to speech recognition and renders stuff according to what is said. What modules can I use to create a pretty GUI?

#

The only one I messed with a little was Qt qml which was interesting because I could use my web experience.

ancient mural
#

any suggestions on how i can make this better?

digital rose
past pier
#

I'm using Tkinter and when i click the button after entering text in malice_input, i see no results displayed in bob_input. Help!


malice_input = tk.Text(root)
ft = tkFont.Font(family='Times', size=12)
malice_input["font"] = ft
malice_input["fg"] = "#333333"
malice_input.place(x=310, y=290, width=198, height=111)

# bob_input declaration is same as malice_input


def malice_send_bob():
    bob_input.insert(tk.END, malice_input.get("1.0", 'end-1c'))


malice_send_bob = tk.Button(root)
malice_send_bob["bg"] = "#efefef"
ft = tkFont.Font(family='Times', size=12)
malice_send_bob["font"] = ft
malice_send_bob["fg"] = "#000000"
malice_send_bob["justify"] = "center"
malice_send_bob["text"] = "SEND TO BOB"
malice_send_bob["command"] = malice_send_bob
malice_send_bob.place(x=440, y=420, width=130, height=25)


digital rose
#

oh, i didn't red the comment

#

btw, How to you import tkFont 😅

past pier
#

nvm... i got it. damn i thought def name can be the same as variable name :((((( silly me

wet cave
#

I’m guess there is a away but i can’t find out, in pyqt5 is there a way “refresh” the window if a button is added?

wary grotto
#

you guys know the on and off value thing for checkboxes in tkinter right? so is there a similar thing for buttons as well?

late wolf
#

hello guys , using tkinter to create a management system for keeping records and viewing , but came across an issue when creating a frame for the button sector, for some the attribute been declared and used but the first frame is not been detected in the second frame, pls I need help

proven basinBOT
#

Hey @late wolf!

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

late wolf
#

!code-blocks

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.

dense rock
#

Hi, what is the most reliable and best compiler ?? (pythong to executable . . . like cx-freeze) I use cx-freeze but am not happy with it

dense rock
#

modern ones . . .

wet cave
#

is there a way pyqt5 to refressh the page if you add a new element like a button?

This is the code I have so far

def showButton(self):
        self.hey = QtWidgets.QPushButton(self.tab1)
        self.hey.setObjectName(f"hey")

        self.hey.setGeometry(QtCore.QRect(20, 100, 208, 21))
        self.hey.setText(f"Hey")

That is the code that I have so far, and yes it is connected to this

self.OpenFile.clicked.connect(self.showButton)

Thats line for what it to do when its clicked

marble hollow
#

anyone here familiar with psaw and pushshift for reddit api

strange ingot
#

Is there when a button is pressed we use the after method and then delete a label that uses the place method?

sleek hollow
#

Does anyone know an elegant solution for hiding the typing cursor in a QLineEdit (PyQt5)?

#

I'm trying to make a "wordle" clone as practice

#

maybe LineEdit isn't the best solution for the character boxes?

rocky dragon
#

Is it editable directly by the user?

sleek hollow
#

My current idea is to set them all to read-only mode, and use a custom key event for filling in the text

#

but that seems excessive

#

but then again, that's pyqt for ya

rocky dragon
#

Could just use a label that gets set on a key event with mouse focus then

#

or whenever you need it to accept input

sleek hollow
#

Yeah I guess at that point it doesn't even need to be a LineEdit

ancient mural
wary grotto
#

guys, i have a small doubt:
how can we make it so that on clicking a button once, a frame is opened, and on clicking it again, the frame is destroyed?

#

def settings():

setbar=Frame(app, height=650, width=250, bg="light grey")
setbar.place(x=0, y=25)

settingsbutton=Button(app, text="⚙️", command=settings)
settingsbutton.place(x=0, y=0)

#

this is all i could do till now...

#

and this is in tkinter, btw

soft quartz
quaint hearth
#

hey people,

small question,

so i have a software / app and there is a Child Window and a Parent window
while a new Child window is being opened the Parent window hides by using this code ```python
def hide_main_window():
root.withdraw() # Hides the Parent / Main window
question() # opens child windows


now when the `Child` window closes ( the user presses the `X` button and closes the window ) the `Parent` Window ( which was previously `Hidden` ) should My Shown again?? ( instead of running in the Background / Tray  )???
#

pls help

#

btw i use Tkinter

quaint hearth
#

nvm

proven basinBOT
#

:incoming_envelope: :ok_hand: applied mute to @wary grotto until <t:1641910429:f> (9 minutes and 59 seconds) (reason: mentions rule: sent 6 mentions in 10s).

thorny star
#
        self.widget = QLineEdit()
        self.widget.setAutoFillBackground(True)
        self.widget.palette = self.palette()
        self.widget.palette.setColor(QPalette.Window, QColor('lime'))
        self.widget.palette.setColor(QPalette.Highlight, QColor('lime'))
        self.widget.setPalette(self.widget.palette)```


self here is an instance of a subclass of a QMainWindow object. From what I nerstand, `QPalette.Window` defines the general bg color . However, when the program is run , the background isnt green? It's jsut the usual white?
#

Code I included is kept short (because I felt the rest of the program wasnt relevant; wanted to keep the message succinct)

halcyon topaz
#

You guys have any list of fonts?

sharp reef
#

What would be the best way to implement text input in curses? I'm aiming for a scrollable single line text input, similar to vim's command entry area?

rocky dragon
#

I think you'll also need to construct a new palette and then give it to the widget instead of trying to change the widget's palette directly; it'll properly inherit for the unset colors

thorny star
#

I went thru the docs and form what little I understood, they had stated Pallete.Window is like a bg color?

rocky dragon
#

Window is the window's background, Base is for some other backgrounds

#

Used mostly as the background color for text entry widgets, but can also be used for other painting - such as the background of combobox drop down lists and toolbar handles. It is usually white or another light color.

#

so you want a bit of a contrast between window and base to show that it's interactable

thorny star
rocky dragon
#

Yes

#

if it had some space that wasn't used to enter things then that'd use the window color

thorny star
#

I see

#

Thank you!

#

I got it now!

eager beacon
rocky dragon
#

in your case the window color should control what you see around the widget, if you set the palette on an object that'd change it

thorny star
rocky dragon
#

Yeah, or the app directly

thorny star
#

So if I wanted to make a theme for the widgets in my app WITHOUT using style sheets, I have to edit the pallete for each and every object I plan to include?

thorny star
# eager beacon

Also if you dont mind me asking how did you draw those gray lines that border the yellow window on the bottom right?

rocky dragon
#

Well they use the same color roles, you just need to set appropriate colors for all of them

thorny star
eager beacon
rocky dragon
rocky dragon
#

you can see that I do app.set_palette under the linked code

eager beacon
#

Thats just widgets inside a QToolBox

#

The colors roles are from QPalette.Light and QPalette.Mid

thorny star
thorny star
#

or are they widgets themselebs

#

Also what exactly is a color role? Is it an alternative term for an enum?

eager beacon
#

Those lines are separating a TextWidget, TextEdit and Text Browser

#

They come from placing the items in a QToolBox.

eager beacon
thorny star
eager beacon
#

You choose the colors to set on a colorRole, its how you would use a palette.

eager beacon
#

I don't think I've ever used a QToolBox before

thorny star
#

are they like some attribute?

#

or one of those enum things?

hushed zephyr
#

I am not a very good programmer and this is my first time using tkinter. I need to create a booking system and i need to let people create an account and login through tkinter using databases. Is there any videos where they do this? I can do it to a read/write file. Thanks.

eager beacon
rocky dragon
#

The color talk reminded me of an issue I've been trying to solve a couple days back but didn't reach any solution for.
I have a widget that blends text into the background on both of its ends through a gradient, but I don't know how to use proper blending on the transparent parts instead of blending it into a solid color, as the text has to be painted first using the widget's painter. Painting using an image or a QGraphicsOpacityEffect achieve the intended effect, but completely mess up how the text looks.
A partial solution would be some way to figure out the color of the background behind the widget, but would still not be ideal if the background is not uniform

#

In its current form where I use the window color it mostly works, but is out of place if placed on widgets that don't use a palette color directly

thorny star
#

not sure if its any good

#

perhaps you overlay a plane that is transparent in the center but slighty opaque at the edges OVER the text?

#

keep the plane/image color same as the bg

rocky dragon
#

Well that's mostly what I'm doing now with a gradient that goes from the window color to transparency and is overlaid over the text, but not all widgets will use the window background color, or it may be placed over something that's not uniform (e.g. some other widget with a gradient)

#

and so far everything I've looked at that would fix this, would require using something that messes up with how the text is drawn

thorny star
#

I have a terribly hacky way

thorny star
#

jhow about hacking the text rendering s code such that you get to change the color of the text rendered per character?

#

Characetrs at the edges get a transparent color, stuff in the middle get opaque colors

#

but yes like you mentioned, its super hacky

#

hmmm

#

I do have another idea

#

How about using something like PIL to take bitmap images of letters, color them into the colors you want on the fly and stick them one by one as images in ur widget?

#

although the performance implications for that...

rocky dragon
#

Well the characters could be prerendered I guess, but that would still not use the native text rendered that the user is used to and is used everywhere else in the app

#

windows has to expose something for it that I probably could use to draw into an image but I'm really not going to dive into that

thorny star
#

wait ummm

#

how about this

#

have the text the users type be rendered onto an image with a transparent bg. Multiply that image with a gradient and paste that back in as an image?

#

I think PIL let you type text onto images?

#

although idk if you can choose any fonts you want]

rocky dragon
#

The font is not really the issue, but using the proper subpixel rendering method that the user chose when configuring their ClearType

#

Using normal b/w antialiasing makes the text appear less sharp, and even if PIL has direct tools for it, I'd need to hook into the win api to figure out the settings

#

and well any rotation would completely mess that its looks when not using the native font engine

eager beacon
rocky dragon
#

No, some just don't use a color directly but a darker/lighter variant from one of the colors that are set

#

then if I place my widget over that, it'll blend into the window color which is different

sturdy wren
#

I don't know if this is the right channel to ask this question but as a former heavy Excel user learning python with the primary goal of pandas expertise, has anyone played around with Mito?

hollow wadi
sturdy wren
#

Its cool, it is a great learning tool for newbies like me but no regression analysis function

#

I asked about it on their discord

#

but I suppose pandas doesnt have an "in package" regression tool, that could be the reason, but numpy and scipy does

#

even simple linear

#

I heard about it today on "talk python to me"

#

I was talking about Pandas when I said : "but I suppose pandas doesnt have an "in package" regression tool, "

mellow shore
#

This probably doesnt belong in this channel but its the only channel I can think with this question:

How do I access a GUI in a system that doesn't support GUIs? For example if I am SSHing into an ubuntu server that has a fresh nodejs server running with nothing installed, but I would normally be able to just type in localhost:3000 into a browser

hollow wadi
sturdy wren
#

😛 apparently I suscribed to the same podcast twice

#

Wonder why they are shown as 2 seperate casts

hollow wadi
# sturdy wren Wonder why they are shown as 2 seperate casts

Talk Python has ways to access 'no-add' version called pro-edition. This is provided as a private rss-feeds to only who have purchased everything bundle from the training site in talk python. Maybe Michael, the host of the podcast, have done sth that could make duplicate instances of the feeds

sturdy wren
#

ahhhh. gotcha. I am using podcast addict and that might not show everything the same as itunes or w/w

#

w/e*

young sedge
# mellow shore This probably doesnt belong in this channel but its the only channel I can think...

if you are in windows, then Putty program allows to connect via ssh
while in settings turning on port forwarding feature in Connection -> SSH -> Tunnelling?, that will transfer server requested things at certain ports to your localhost, when SSH connection is established.

It is possible to install putty at linux too.

Btw, it is possible to access even VSCode gui at the server, VSCode allows ssh remote connections

sturdy wren
#

Also! Trying to get JupyterLab Desktop working (same ep)

hollow wadi
sturdy wren
#

Im a newb and cant seem to get it working

mellow shore
young sedge
#

and from Putty to make ssh connection with tunnelling turned on

mellow shore
#

Hmm I see

#

How would seeing localhost work through putty? Normally I’d open a web browser and type in localhost

#

But wouldn’t I have to type in the SSH’d instance’s IP? Wouldn’t the instance need to be able to serve from non local host?

young sedge
#

U can make port forwarding

#

you write at which localhost:PORT you wish to access the thing through the server, which would connect to DOMAIN:PORT at your behalf, when you access your localhost:PORT

mellow shore
#

Ahh.. this is totally unknown waters, so I appreciate your patience with me. I’ll give this a try

young sedge
#

Obviously when you establish connection to your server, you need to point its domain or ip, and port for ssh

#

basically only those two tabs are required

#

Session and Tunnels

mellow shore
#

So port forwarding here allows me to basically tell putty “ localhost at this port maps to my client’s address here”

young sedge
#

but you are basically needing to point localhost, to connect to server localhost on his behalf

#

localhost:YOUR_PORT => localhost:SERVER_PORT

mellow shore
#

Sweet! Thanks so much, I’ll give it a try. I didn’t think it would be this easy; a quick google talked about reverse proxies and stuff

young sedge
#

just a tip, for debugging purposes you can always verify that your server has the thing running where you wish with curl installed to linux server

#

if it shows something in the console not of the connection refused type , then your thing is working at the server
I mention it because sometimes additional troubles can be in the way, it helps to verify things in addition.

#

obviously port forwarding is working, only while SSH connection is established / putty is opened 😉 Once you close it, forwarding is canceled.

mellow shore
#

Turns out I got way ahead of myself, I don't know how to install jenkins from docker yet so I can't test the above yet, oops.

mellow shore
# young sedge

Forgive my ignorance. In this screen I put source port as 8089 (I'm sure it can be anything that's not used right?)
And I put destination as <IP-of-host>:8080 (trying to access jenkins auth page from client)

My question is, shouldn't I be entering through localhost:8089 to access localhost:8080 of the host then? Since the mapping says L8089 => <IP-of-host>:8080?

young sedge
#

at least linux is not allowing binding to ports 80/443 unless root

mellow shore
#

http://localhost:8089/

Returns a refused connection, and I presume that is because my client doesn't have anything listening on that port

But putty is connected and the above settings applied

topaz depot
wet cave
#

In pyqt5 how do you get a item from a tree with a double click?

wet cave
#

the one with out the rainbow

topaz depot
rocky dragon
topaz depot
proven basinBOT
#

Hey @topaz depot!

It looks like you tried to attach file type(s) that we do not allow (.sxie). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

topaz depot
#

it is NOT an exe it is an sxie. a file image formater for sharex

tawdry mulch
topaz depot
tawdry mulch
topaz depot
#

if you want. just rename it to filename.json

#

and open it

abstract crown
#

does anyone know how to fix error ```_tkinter.TclError: invalid command name ".!treeview"

topaz jewel
#

I'm new to python and I don't understand why I am getting this error. Why does my main window not recognize that it has the Qcombobox named vehicle dropdown?

marsh talon
#

Can any front end developer please quickly look at the UI of my website on both Mobile and Pc and give me some suggestions on how to improve the UI? Link: https://codewani.pythonanywhere.com/

viscid dune
feral phoenix
#

QT QProcess question in #help-pie if anyone is willing 🙂 Thanks in advance!

tawdry mulch
topaz depot
tawdry mulch
topaz depot
#

dont rename it

tawdry mulch
#

why don't you share the file directly?

topaz depot
#

unless u have sharex

#

u can download it from microsoft store

tawdry mulch
topaz depot
#

it is from @oblique isle

#

he is my friend

tawdry mulch
topaz depot
#

so yea

#

that is the source code

tawdry mulch
#

Mmmmm

topaz depot
#

just download it and rename it to .json or .txt

#

it is more like a plugin for sharex

tawdry mulch
topaz depot
#

that rainbow part is NOT the gui

tawdry mulch
topaz depot
tawdry mulch
#

Thanks anyway

topaz depot
tawdry mulch
topaz depot
tawdry mulch
topaz depot
tawdry mulch
patent flame
#

how do you make a ui w/ python?

#

is there like a module or api?

patent flame
#

alr

vague quiver
#

Random question, in tkinter, can a place items on top of a grid overlapping? I am wanting to place some items in the corners of a screen and have a grid acting as a split bar graph behind it on the top row

real delta
#

How To Use eel package, it's used for building UIs with frontend technologies with HTML and CSS Except JS

#

Indirectly It's A Web Browser

#

That Runs HTML

digital rose
#

I use PyCharm from the Snap Store and every damn update I've gotten for months seems to have made it worse and worse. Is it just me or is the software nearly unusable now? It doesnt parse the code properly and it takes forever to analyze changes as I make them.... usually requires a restart

dim schooner
#

what is the easiest way to display a whole pandas dataframe in tkinter?

digital rose
#

If anyone keyword searches this and has slow code inspection, updating, analyzing in PyCharm: make sure you right click and exclude the project files you don't need to be inspecting from the project structure. I do my work in one file of a large directory and it turned out python was inspecting all the project files/sub-directories. It took forever for PyCharm to catch errors in my code (if it ever did!) and a very long time to update after each change I made. It was like I was writing in notepad for the past year.

covert badger
#

hey how u move a button in tkinter? to left

#

button.pack(place=LEFT) ?

#

side=left?

molten lava
#

hello, can I draw something on the screen with pyqt5? It will be manually like in paint.

upper sluice
#

i tried


window = tk.Tk()
tk.Label(text="Hello, world").pack
window.mainloop```
but it doesnt make any windows
#

how can i fix this problem

#

im big dumb

wet cave
#

How do you make a pyqt application that has multiple pages?

#

@upper sluice

import tkinter as tk

window = tk.Tk()
label = tk.Label(text="Hello, world")
label.pack()
window.mainloop()

That should fix it

upper sluice
red sand
#

how can i get the value of a text field with kivymd?

#

i checked the docs but couldnt find anything

tribal path
#

.text ?

ancient mural
wet cave
#

I'm trying to make a muilt page application in pyqt5 and this is the code that I have currently. MainWindow is the window I want to first show up. Then I want Screen to show up when pushbutton is clicked.

The code is below
https://paste.pythondiscord.com/zecejiloyi.rb

steady dragon
#

i forgot the command for tkinter that has i think message box in it or something like that? its a import command could i have some help

#

also for some reason when i do import tkinter* it comes up as syntax error which didnt happen at my school computers

maiden perch
#

how to run Tkinter code in visual studio code???

neon fiber
maiden perch
#

no no

#

thanks but i got it anyways

#

thanks for ur help

neon fiber
digital rose
#

Is there anyone who is doing ui ux design or learning??

nimble wasp
#

Um can someone that has worked with Tkinter DM me?
I need help and I tried posting in the help channels so many times but I got no response...

stray jackal
mortal marten
#

setBackground(self, Union[QBrush, QColor, Qt.GlobalColor, int, QGradient]): argument 1 has unexpected type 'QColor'

#

am i missing somethin or .......................

#

TypeError: setBackground(self, Union[QBrush, QColor, Qt.GlobalColor, int, QGradient]): argument 1 has unexpected type 'QBrush'

#

ummmmm

#

it literally says it expects Union[QBrush, QColor, Qt.GlobalColor, int, QGradient] but its not accepting themmmm

#

i wanna set background of QTableWidgetItem but it only worked with Qt.GlobalColor or by int (which idk how its calculated)

molten lava
#

Hello, I want to draw a picture on the label with pyqt5, how do I do that?

#

I also want to use what I drew

mortal marten
#

use qpixmaps

#

scale it to the size of your label and use Qt.SmoothTransformation so that it looks nice when scaled

#

and then just label.setPixmap(pixmap)

molten lava
#

how to draw with pen or brush

lucid totem
#

how to make a custom button widget in pyqt? (plz ping when reply)

rocky dragon
#

what custom behaviour do you need from it?

wet cave
#

Is there a way to change the column background color?

hasty sable
lucid totem
#

how to make a custom button widget in pyqt tat changes color when clicked n hv a "clicked" signal?

small kindle
hasty sable
#

But now I have started learning qt

small kindle
#

that's nice, how far are you in qt now?

digital rose
#

Hey! Any UI ux designer? Or who is learning it?
Would love to chat up.
Just have few doubt.

clear crown
#

hey a small question

#

so i wanna make it so the resolution is what i have told it to be on a window it opens

#

whats the function again?

#

i forgot

mortal marten
#

it doesn't have to be custom button to be able to do it

digital rose
#

Is this Channel for ui/ ux design??
Or am I in wrong Channel?

proven basinBOT
fresh gulch
#

which is UI

#

So

digital rose
fresh gulch
#

Are you wanting to design websites

digital rose
fresh gulch
#

Then learn HTML and CSSS

#

CSS*

#

That is the core of all websites

digital rose
#

And for app??

fresh gulch
#

Still need it

#

unless you are creating a C# app with XAML

hasty sable
#

Ig they are the one who use figma xd sketch....

fresh gulch
#

yea you can do those too for when you want to simulate a design

#

But you will prolly eventually have to code it

hasty sable
#

But that's not what a ui ux designer do 👀

digital rose
digital rose
digital rose
hasty sable
hasty sable
hasty sable
digital rose
hasty sable
#

my way of doing practice was simple try to replicate the designs from dribbble

digital rose
#

Is there a way that the sizes of the buttons, labels etc. automatically change by the size of the window in tkinter

digital rose
#

why not tkinter

tough marsh
#

Hi

#

I have a quick question

#

is kivy (the python module) still used for app development?

#

Thanks!

nova berry
#

I'm trying to make a super simple GUI for a program i have, so far, it needs a button and float input (so super basic) but wish to expand upon it to add pictures or even better, transparent to overlay on another window. what lib would be best for me? I've been using some pyqt5 but it feels like it was lazy hacked together and doesn't feel pythonic with the limited time with it. I could just power my way through pyqt5 but i want to hear if there are better options for me.

pine island
#

Hi Guys

#

This is My GUI app Which i have made

flat ermine
#

use TKINTER
i hate kivy and pyqt5 cause no MAC M1 versionnn
???

digital rose
#

Hey! Any UI ux designer here?
If yes,can you lay down what are basics one need to master for ui?

fresh gulch
digital rose
#

Like typography , color fonts n all?

fresh gulch
#

don’t over complicate colors

#

you already have black and white

digital rose
#

Do you know any specific video which can clear out the basics?

fresh gulch
#

you just need one more after that

cursive basin
#

ah does anyone remember the qt class which asks input in a different small window

cursive basin
bright dragon
#

HI, I'm using py QT Designer, is it possible that the tool box has all the tabs closed by default?

midnight kestrel
icy flower
#

Python glut libary is really use in production ?if yess please tell some name of company?

proven hatch
#

Im trying to build a math helper for a certain subject of mine here in college wherein I'll just put numbers for this equation and it gets solved. The functionalities are done. Only left is to put it in a UI.

Thinking of Kivy or PyQt but I have little idea about these two. Can anyone suggest which one to pick?

boreal pier
#

Kivy, it takes time to get used to kivy Lang but it feels much more refined UI building-wise

chrome blaze
cursive basin
barren forge
#

im trying to learn pyqt and i wanna a add scrollarea but i can't add labels to it what should i do inorder to add a labels inside of scroll area ?

sick carbon
tribal path
#

personally I'd go kivy, but if completely new to gui libs, just choose one and you'll be fine

digital rose
#

Hi guys, i made a small software whit gui to find some files in a directory.

Runnung the gui on windows it look very nice but running it on android look like this:

#

im using ttk as library

#

in windows rhe treeview is 50% the space avaiable

#

But on android it look like this

#

Specially vertical mode

#

And also all labels are super tight

#

What property sould i change to fix it?

surreal pond
#

hello community, anyone expert in wxpython? I need help with an issue.

lime monolith
surreal pond
#

I made a tool using wxpython, consisting of registering people in a database (sqlite), so far, well, when I query the data, I get them in sqlite3, store the data in a variable and play the data in a wx.listctrl(). When I do this the first time, everything works fine, the second time onwards it's the problem, the new data is replaced by the old ones when I try to select one of them, as if the first data I consulted is not erased, overwriting the data of the next queries . how do i solve this?

lime monolith
tall peak
#

So I have a small question I can't figure out. Basically I have a QStackedWidget in a window in PyQt and I want to have a few pages which is all fine up until the point I want to have each page for the stacked widget separate. I thought creating a new file in qt designer with the QWidget template would be enough but that is by default a form and cant be added to the stacked widget after the fact. What am I missing here, how would I separate the files in a good manner to use?

#

Basically I want to have each page of a QStackedWidget in separate files.

stark inlet
#

I never touched any GUI on Python before
Wich would be a good lib to start

tall peak
#

I have some experience with PyQt and Id say its quite good for simple stuff especially with the qt designer it allows you to design apps in UI and not hardcode them from the getgo but I dunno about the other ones

surreal pond
# lime monolith Can you post the smallest possible sample code that shows the issue you are havi...

def buscar(self,event):
self.dados_consulta_individual_states.clear()
self.Refresh()
print(self.dados_consulta_individual_states)

    # create the list control
    self.lc = wx.ListCtrl(self, wx.ID_ANY,
                          style=wx.LC_REPORT, pos=(120, 160), size=(400, 350))

   
    self.lc.RefreshItems(0,1000)

    
    connection = sqlite3.connect("membs.s3db")
    cur = connection.cursor()
    Onome = self.onome.GetValue()

    #procurar pelo primeiro nome
    sql="SELECT nome,situacao,cidade FROM membrosIgreja WHERE nome LIKE '" + Onome +"%' ORDER BY nome"

    cur.execute (sql)

    result = cur.fetchall()

    cur.close()
    connection.close()

#---------------------result-----------------

    #states = list(result)

    self.dados_consulta_individual_states = list(result)
    #print self.states

    print(self.dados_consulta_individual_states)


    # select an item (left mouse click on it) and bind to a method
    self.lc.Bind(wx.EVT_LIST_ITEM_SELECTED,self.onSelect)

    # create and load the columns with header titles, set width
    self.lc.InsertColumn(0,"Nome")
    self.lc.SetColumnWidth(0, 140)
    self.lc.InsertColumn(1,"Situação")
    self.lc.SetColumnWidth(1, 120)
    self.lc.InsertColumn(2,"Cidade")
    self.lc.SetColumnWidth(2, 130)



    # load the rest of the list with data
    self.loadList()

    self.lc.update()
#

I already tried to clear the variable that stores the data, I tried to clear the wxlistctrl and nothing came of it.

digital rose
#

I've installed UniCurses in my venv and I'm getting this error when trying to initialise it (i.e. stdscr = unicurses.initscr()):

Expecting pdcurses at: C:\path\to\my\project\venv\Lib\site-packages\unicurses/64 bit binaries/pdcdllu/pdcurses.dll

The file it's referring to is there so I don't understand what's wrong.

surreal pond
digital rose
#

It's a module providing Curses functionality on Windows. I'll try reinstalling but it's a fresh install so I don't think it's corrupted.

#

Yeah getting the same error

digital rose
#

Has anyone of you have taken ui ux bootcamp? If yes,can you share your experience?

#

hoii does anyone know how to use the blessed library i need a little help

wide = int(term.width / 2 - 11)
high = int(term.height / 2 - 6)
with term.location(wide, high):
    print(term.sienna + logo + term.normal)

it SHOULD appear in the middle of the terminal, but it isn't appearing in the middle of the terminal :|

clear crown
#

hey uh i would like to get some help in pysimpleGUI

#

i wanna get a value out of a text input box and i cant do it

#

its meant to be number tho

#

idk what is the number one

loud beacon
#

Hi, can someone help me... I'm having trouble installing PySimpleGUI

rose peak
#

any recommendation on laying out nice terminal interfaces? I want to display some json output in a nicer fashion in the terminal than what jq outputs

rain radish
#

question about sizes when i program my first app. every doc and tutorial i can find shows me fixed sizes for width and heights for any widget. but with all the screen sizes today like hd, 4k , 8k, isnt it better not using fixed sizes?

rocky dragon
#

Yes, usually you use relative positions, anchors etc.

#

but a good framework can take care of dpi awareness for you

rain radish
#

does someone using kivy ? for the background_color it uses rgba.. atleast the docs says that. but it uses only numbers between 0.0 and 1.0 ... so im confused now

#

cant find the real codes

marble tapir
#

Hello, I'm trying to figure out patterns with pysimplegui and why my text object won't refresh. I'm on help-pancakes

wind falcon
#

I'm using pyqt5 to make some changes to an existing ui. I am using a Combo Box and I want to expose the index of the combo box to be used in the method of another class(different from the one where I am defining the features of the Combo Box. Is there any built in function besides currentIndex()[since it cannot be used outside the class] which can allow me to do so?

thorny star
#

Can someone explain to me how exactly masking with QRegion() works in PyQT5?

class RoundedLineEdit(QLineEdit):
    def paintEvent(self, event):
        super().paintEvent(event)
        roundCorner = QRegion(100,120,90,30).intersected(QRegion(120,140,100,50))
        painter = QPainter(self)
        painter.setClipRegion(roundCorner)
        painter.begin(self)
        painter.end()```

This is what I have on hand. Intention is to create a rounded rectangle and intersect that with whatever rectangle `lineEdit` draws on, so that I can draw `lineEdits` with rounded borders. I am not exactly sure how to get my own custom QPainter implementation working though

The rest of the handling of paintEvent should mimic that of `QLineEdit`, I just want the QRegion to be a rounded rectangle. How do I get it right?

Note: I know roundCorner isnt really a rounded rectangle, I just wanted to test out QRegion masking for the time being
#

For the time being, this error is spat out evertime : QPainter::begin: Painter already active

#

No idea why it occurs

marble hollow
#

is anyone familiar with tweepy and the extended_tweet field

naive monolith
#

hi guys

#

umm I was trying to install pyqt5-tools but it kept giving me this error

#

there's more to this its huge so i just sent some of it

#

the ending especiaaly

#

anyways the tutorial i was using was going over the drag and drop method as well what do yall use the drag and drop or just code it?

plush stream
#

Yeah it happens on mac too

#

Idk why

naive monolith
#

I'm using windows 11

#

Is there a way to fix it?

plush stream
#

Not currently

#

I think it's a problem on their end

naive monolith
#

is qt-creator the same?

#

ok i somehow installed it

naive monolith
near pulsar
#

why does pynput break pysimplegui

heady brook
#

Any clue on how to make a better-looking progress bar using Tkinter.
something like this.

#

rather than

surreal pond
#

hello guys, I'm having problems installing packages in python, I always get an error, I can't install wxpython, kivy, kivymd and others, I've already tried to install from the terminal inside the python packages folder, through pycharm, and nothing worked, always gives error

full marlin
silver nymph
#

I want to develop an interactive dashboard using bokeh and flask.
Here is what the interface would somewhat look like:

#

I wanted to do the following with this interface:

  1. I have received a data from the user, from the previous page. The data will be processed on server side based on an algorithm, and plots are going to be generated.
  2. I have that algorithm loop running on server side, and the plot corresponding to say iteration 1 is shown
    first on this interface. The loop should pause and proceed for iteration 2 only when I click next.
  3. Also, say I keep clicking next and I reach iteration 5, I now want to go back to iteration 3, I must be able to do so using the back button
    shown above.
    (Note: At each iteration, new plots will be shown based on calculation done on server side)

My question is how do I go about developing this sort of an interactive interface?.
I am a beginner in flask/bokeh. On top of it I have no knowledge of web technologies like JS, AJAX etc.
Are there some good learning resources like courses/books so that I learn about how to construct these
kind of interactive interfaces? Coz I am unable to find a solution for this currently.

edgy tartan
#

does anyone know how to bind the scroll wheel to scroll up or down on the scroll bar in tkinter?

edgy tartan
#

mhm

small vault
#

?

edgy tartan
#

the mouse wheel, yes

small vault
#

either way you can use something like widget_name.bind_all(“<MouseWheel>”, function)

edgy tartan
#

i tried that and it just says "expected integer but got "1.0"

#

and when i make it an integer it does nothing

small vault
edgy tartan
#

thats the example i followed, and for some reason it doesn't work

small vault
#

I might need to see your code

edgy tartan
#
    def __init__(self, FRAME):
        super().__init__(FRAME)
        
        CANVAS = tk.Canvas(self, width=1550, height=600)
        
        self.children["!canvas"].bind_all("<MouseWheel>", self.scroll)

        SCROLL_BAR = tk.Scrollbar(self, command=CANVAS.yview)
        
        self.SCROLLINGFRAME = ttk.Frame(CANVAS)

        self.SCROLLINGFRAME.bind("<Configure>", lambda x: CANVAS.configure(scrollregion=CANVAS.bbox("all")))

        CANVAS.create_window((0, 0), window=self.SCROLLINGFRAME, anchor="nw")
        
        CANVAS.configure(yscrollcommand=SCROLL_BAR.set)

        CANVAS.grid(row=0, column=0)

        SCROLL_BAR.grid(row=0, column=15, rowspan=15, sticky="ns")
    def scroll(self, event):
        self.children["!canvas"].yview_scroll(-1*(event.delta/120), "units")
#

i do self.children["!canvas"] because self.CANVAS didn't work

subtle wing
small vault
#

the tkinter window resolution?

mortal marten
#

so i have 3 table widgets and i want to change the color of them once they lose focus, like when you click on one other two will change color of the selected row to indicate that they aren't focused rn, also if you click on a completely different widget all 3 table widgets will change color, but will change it again when they are clicked on to indicate that they are in focus. is there any way to achieve this which is fast so there's not a delay between click and color change... i tried doing it with signals and mousePressEvents but it still has some hick-ups, for example it changes the stylesheets regardless if the widget already has focus (every time it's pressed)... i tried implementing focusInEvent and focusOutEvent but it doesn't seem to work properly...

small vault
#

@subtle wing you can use root.tk.call('tk', 'scaling', 2.0) as well

small vault
small vault
#

ok

shy torrent
#

In PySide6, if I want to have an QComboBox with the possibility to also search via text completions,
What do I have to do to have the selected Item text actually show up in the box ?

Also: The completer activated signal does not seem to send out any useful data, it is always empty text and when querying the completer for the current index it is the default negative index.

Code:

class AntistasiFunctionSelectComboBox(QComboBox):

    def __init__(self, parent = None) -> None:
        super().__init__(parent)

        self.setEditable(True)
        self.setFocusPolicy(Qt.ClickFocus)
        self.setInsertPolicy(QComboBox.NoInsert)
        self.pFilterModel = QSortFilterProxyModel(self)
        self.pFilterModel.setFilterCaseSensitivity(Qt.CaseInsensitive)
        self.pFilterModel.setSourceModel(self.model())
        self._completer = QCompleter(self.pFilterModel, self)

        self._completer.setCompletionMode(QCompleter.UnfilteredPopupCompletion)
        self.setCompleter(self._completer)
        self.lineEdit().textEdited.connect(self.pFilterModel.setFilterFixedString)
        self.currentIndexChanged.connect(self.on_index_change)

    def on_index_change(self, *args):
        self.setEditText(self.itemData(self.currentIndex(), Qt.DisplayRole))

    def setModel(self, model):
        super().setModel(model)
        self.pFilterModel.setSourceModel(model)
        self._completer.setModel(self.pFilterModel)

    def setModelColumn(self, column):
        self._completer.setCompletionColumn(column)
        self.pFilterModel.setFilterKeyColumn(column)
        super().setModelColumn(column)

In the on_index_changed, I tried self.setCurrentText, self.lineEdit().setText(), only thing that somehow works is self.lineEdit().setPlaceholderText(), this tells me the lineedit immediately looks for new input. How can I change it so that the lineedit only kicks in when the widget is actually selected?

please reply with ping

#

Extra: I also tried doing nothing with signals and letting the internal Qcombox handle the completer, nothing really changed(not sure), which gives m the fear something internal could be overwriting my attempts, but I cant seem to find out from the Docs.

Also: If I start writing text and then select an completion, even the text I have already written gets cleared.

Python: 3.10.1
Pyside6: 6.2.2.1

shy torrent
#

images of the problem.

Last image is the wanted behavior

||Sorry for multiple messages, had to split because of char limit and also wanted to provide more info with pics!||

finite ruin
#

is there any way i can make tkinter less "windows 95" like? btw pyqt5 isn't an option because i want to make my app windows compatible

rocky dragon
#

Yes, you can style tkinter apps, though I don't see how using Qt would make your app incompatible with windows

small vault
median ridge
cobalt quail
#

Anyone here familiar with the Blessed or Blessings module?

static wraith
#

It's cross platform

drifting palm
lone olive
#

I am making a currency converter using tkinter, and I want to place those labels("from:" and "to:") next to the dropdown menus. All widgets are placed using pack(). Rest of the design needs to remain the same, only the labels need to move. Any idea on how to do that?

wraith plover
#

You can use .place(y=,x= )

#

And just set the coordinates

deft knoll
#

how to change tkinter entry state after clicking checkbox?

lone olive
lone olive
# tawdry mulch use grid

Frame was placed using place(), so using grid throws an error, is there a way to work around it?

tawdry mulch
tawdry mulch
drifting palm
#

This is my code
and the problem is
whenever i click the tkinter button
it stops responding

small vault
small vault
astral skiff
#

Hello, I'm a newbie here, what is the simplest framework to build an interface would you recommend me to study?

small vault
astral skiff
#

its only code? or have some place to draw the interface?

small vault
#

It's only code, but if you're looking into drag and drop than you can look into PyQt, but that's a bit more complex

astral skiff
#

I see, it is a standard python library

small vault
#

Yeah

astral skiff
#

Im gonna have a look, thanks

small vault
#

np

astral skiff
#

its not free?

small vault
#

it is

#

lol

astral skiff
#

ow

#

I see

#

Still getting used to discord also

#

hahaha

small vault
#

I see 😛

astral skiff
#

np means, no problem?

small vault
#

yeah

astral skiff
#

aaaaaaa

#

ok

#

thanks

#

hahaha

small vault
#

lol

#

np

astral skiff
#

thanks mate, leaving now, see you

frosty drift
#

I wanna make a radius X around a point A ( point location will be given) and another circle on point B and find the unison between them. and shade the in-between.
What would be my best bet?

mortal marten
#

so i'm using pyqt and i have 3 table widgets and i want to change the color of them once they lose focus, like when you click on one, the other two will change color of the selected row to indicate that they aren't focused rn, also if you click on a completely different widget all 3 table widgets will change color, but will change it again when they are clicked on to indicate that they are in focus. is there any way to achieve this which is fast so there's not a delay between click and color change... i tried doing it with signals and mousePressEvents but it still has some hick ups, for example it changes the stylesheets regardless if the widget already has focus (every time it's pressed)... i tried implementing focusInEvent and focusOutEvent but it doesn't seem to work properly... does anyone have any idea how to make it instantaneous?

mortal marten
#

the lag between click and stylesheet change is especially visible when tables have a lot of items (around 300) and when those items are custom (custom labels)

#

i'd really appreciate some help

rain radish
#

can u tell me why self.texture_size on a MDLabel :

MDLabel:
  text: "Wertgutschein"
  size_hint_y: None
  size: self.texture_size

leads to the following spamming Warnings?:

[CRITICAL] [Clock       ] Warning, too much iteration done before the next frame. Check your code, or increase the Clock.max_iteration attribute
[CRITICAL] [Clock       ] Warning, too much iteration done before the next frame. Check your code, or increase the Clock.max_iteration attribute
[CRITICAL] [Clock       ] Warning, too much iteration done before the next frame. Check your code, or increase the Clock.max_iteration attribute
[CRITICAL] [Clock       ] Warning, too much iteration done before the next frame. Check your code, or increase the Clock.max_iteration attribute
[CRITICAL] [Clock       ] Warning, too much iteration done before the next frame. Check your code, or increase the Clock.max_iteration attribute
[CRITICAL] [Clock       ] Warning, too much iteration done before the next frame. Check your code, or increase the Clock.max_iteration attribute
[CRITICAL] [Clock       ] Warning, too much iteration done before the next frame. Check your code, or increase the Clock.max_iteration attribute
cobalt quail
#

I posted this in the general channel , but figured it might apply here also:

I posted in #help-kiwi about a weird problem I'm having when using the blessings TUI module - I am super new to python so it might be a simple issue - but I am perplexed and about ready to give up! Hoping someone who is familiar with it can have a look and at least point me in the right direction...

wraith plover
#

Why do i get errors when trying to install PyQt5

#

?

mortal marten
#

so i am getting elements from pyqt table widget, and its expected to be widget, but i made a subclass of a widget which has custom methods, but pycharm thinks its an error beacuse it thinks it got a QWidget and not my subclass

#

self.table_widget.cellWidget(i, 1).set_transparent()

#

where set_transparent() is custom method

#

and pycharm underlines it

#

is there any way to type hint that so that it doesn't think its an error or should i just ignore it

rocky dragon
#

you can cast the call to your class

#

!d typing.cast

proven basinBOT
#

typing.cast(typ, val)```
Cast a value to a type.

This returns the value unchanged. To the type checker this signals that the return value has the designated type, but at runtime we intentionally don’t check anything (we want this to be as fast as possible).
mortal marten
#

thanks! it worked perfectly :D

opaque edge
#

Or was?

digital rose
#

do you guys have any "about us" design for my software ? its dark grey and purple, thank you < 3

strong valve
#

Hey can someone help me rq I just need to know how to change input text color in terminal

for example

jaja = input("Name: ")

when i input my name i want it to be yellow (only the text i type to be yellow)

digital rose
#

hey im new to python and i was wondering if there was a built in gui like how java has joptionpane

small vault
digital rose
ancient mural
#

hows the colors

mighty rock
#

I like them.
Looks like its freezing cold at your place.

thorny star
#

What is the general consensus on the declaration of widgets within classes in PyQT? Is it better to declare them within the init() function as instance variables, or to declare them in init() as method variables?

#

as in

#

class Window:
  def __init__(self):
    self.widget1 = QWidget()
    self.widget2 = QSlider()
    layout.addWidget(self.widget1)
    layout.addWidget(self.widget2)```

as opposed to 

```py
class Window:
  def __init__(self):
    widget1 =  QWidget()
    widget2 = QSlider()
    layout.addWidget(widget1)
    layout.addWidget(widget2)```
#

just pretend layout was defined there 😅

golden breach
#

😳

barren tide
#

Hi! I'm trying to get into Qt licences.. There is a paid commercial licence, and there is also a LGPL for PySide. Is it true that I can use PYSide6 for a commercial desktop app for free without opening source files?
If so, It says there is almost no difference. So why anyone may want to use PyQt?

rocky dragon
#

it's older, and I think the development was more stagnant for a while

still kelp
#

guys how would i make a tkinter button add 1 to some var?

rocky dragon
#

you can use pyside in proprietary apps, but the users of the app should be change the lgpl'd dlls your app is using with their own

barren tide
rocky dragon
#

Yes, so if you import pyside, they should be able to change that pyside for their own version (and same for the Qt dlls)

#

you either distirbute it under lgpl as OSS, or

Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.

barren tide
rocky dragon
#

don't distribute everything packed into a single file the user can't unpack themselves, but for example do a zip where they can change out the dlls and the (compiled) python code

#

or I guess you could provide some way to build the app against a different pyside, but I assume you'd want to do that without distributing your source too

barren tide
#

Pretty weird license.. But I guess there is no choise.. I've tried to use tkinter, but it's functionality is pretty basic.

thorny star
#

Im not sure if the practices im using are making my code messy

eager beacon
#

You mostly go with the first version

#

The only time you shouldn't is when the widgets/layouts are inserted into a layout that is the layout for self.someWidget

#

You'd have a hard time using signals/slots and accessing the widgets created in the second version. So unless they are static, go with version 1

thorny star
#

i suppose we oculd assume it inherits QMainWindow

thorny star
#

so if i have a layout, widgets that I plan to add to tht layout shouldnt be attributes of Window?

eager beacon
#

Yeah sorry, that wasn't super clear.

#

If you have a container widget that is self.container, and in the container you have 2 static widgets(that you don't need to access for any reason) then its okay if you choose not to create them using self.

#

just ask yourself if you will ever need to access the widget after its created for any reason. If the answer is yes, use self. If you wont, then either way is fine.

#

There are some cases where this isn't possible though. Like if you are creating 10 widgets in a for loop that you need to be able to access.

#

If you run into that situation, store them in some instance level container and access them from there.

thorny star
#

thank you, i got it now!

vocal bone
#

Hi, I am working on a CLI application which takes some commands as input. Is there any way I can scroll through those commands using the Arrow Up and Arrow Down Key?

tribal path
#

depending on the terminal/framework if any there may be a history you can scroll through, if not you'd need to maintain one yourself

vocal bone
#

Yes, I am maintaining one myself. But how to scroll?

tribal path
#

could store in a deque and rotate?

#

!d collections.deque

proven basinBOT
#

class collections.deque([iterable[, maxlen]])```
Returns a new deque object initialized left-to-right (using [`append()`](https://docs.python.org/3/library/collections.html#collections.deque.append "collections.deque.append")) with data from *iterable*. If *iterable* is not specified, the new deque is empty.

Deques are a generalization of stacks and queues (the name is pronounced “deck” and is short for “double-ended queue”). Deques support thread-safe, memory efficient appends and pops from either side of the deque with approximately the same O(1) performance in either direction.

Though [`list`](https://docs.python.org/3/library/stdtypes.html#list "list") objects support similar operations, they are optimized for fast fixed-length operations and incur O(n) memory movement costs for `pop(0)` and `insert(0, v)` operations which change both the size and position of the underlying data representation.
wild wolf
jovial meadow
#

Hello there my apologies for disturbing, i wanted to know if anyone was familliar with the cmd2 library i am in need of advice i thank you very much ^^

gilded sable
#

As far as I know that's not a UI library

jovial meadow
#

It is. it isn't a GUI but it is a UI used in shell to create menu similar to terminals

ripe cosmos
#

hey guys can i ask a question relating to kivyMD?

lucid totem
#

how to make a qpushbutton as below in pyqt?

small vault
lucid totem
ripe shuttle
ripe cosmos
#

bascially I'm new to kivyMD

#

so i have this table details which I'm importing from mysql my question is how do i import this values in .kv file

#

self.data_tables = MDDataTable(
use_pagination=True,
check = True,
rows_num = 8,
column_data=[
(" Sr.no ",dp(50)),
(" Weight ", dp(50)),
(" Price(in rupees) ", dp(50)),
],
row_data=billings_detail,
elevation=2,

#

code in .py format

ember tulip
#

Does anyone love "curses" here :D

ember tulip
#

Yeah, me .. LOL

naive monolith
#

hi so I was building a qt application using qtdesigner so I got the designs ready for different pages eg: login, dashboard etc. so when I click on a button I want to switch the page how do I do that?

ember tulip
#

Maybe , there is an event attribute or function u can use in qt

marsh talon
naive monolith
ember tulip
ember tulip
naive monolith
ember tulip
#

😘

#

🥱

remote dagger
#

Hi everyone, I am currently making a python project with tkinter, and I was wondering if I can link a Scrollbar to a frame widget (I looked on internet there was no mention of this...). I expect it to look like this:

import tkinter as tk
fen = tk.Tk()

f = tk.Frame(fen)
f.pack(side = "left")

s = tk.Scrollbar(fen)
s.pack(side = "right")

for i in range(1, 100):
  #create a line with a label and eventually several buttons 
  #in the the frame I named f

#and here is my question, what do I need to do to 
#link the scroll bar to my frame with all the buttons

fen.mainloop()
naive monolith
#

nope

unique forge
naive monolith
#

ok so that is the best way?

unique forge
#

yes

naive monolith
#

i have this at the top

#

how can I get rid of this

unique forge
#

yeah that disappears once you finish designing

#

it only shows in QtDesigner so you can switch pages easily

naive monolith
#

ahh i see makes sense

unique forge
#

once it is a python file it will not be there

naive monolith
#

ok

#

one more question

#

once i convert it to code it isnt in a format where i can run it directly right?

#

do I have to add something?

#

cause when i ran it nothing happend

#
def window():
    app = QApplication( sys.argv )
    win = myWindow()
    win.show()
    sys.exit( app.exec_() )

window()

they did this in a tutorial i was watching but qt comes without this

#

so ig i have to modify the code slightly?

unique forge
#

That is incorrect

naive monolith
#

oh

#

its a mix and match of video and docs

#

tech with tim

unique forge
#

it's better to use if name == 'main'

#

instead of having a separate function

naive monolith
#

ok

unique forge
#

let me send the correct code

#

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

#

@naive monolith I'm on a phone right now so this is formatted incorrectly but that's the code

naive monolith
#

ahh np

unique forge
#

make sure to change the variables to fit your code

naive monolith
#

thanks for the help man

ripe cosmos
ripe shuttle
ripe shuttle
#

I had to make a class object called scrollable frame and only then could I bind a scrollbar to the frame

#

I'll send you the code for the class if you want.

ripe cosmos
ripe shuttle
#

Okay!

lucid totem
remote dagger
hot yoke
#

<@&831776746206265384>

#

👍

tiny marten
hot yoke
tired sierra
#

hi

prisma citrus
#

In ttk.CheckButton, if I use the state() function on it, it will gimme the onset/offset values I have set, right?

storm flare
#

.

spiral sierra
#

Does 'Adobe Xd' help with PC applications' UI ? and i mean i am pretty sure i am very very wrong but my other solution without that would be changing pictures of buttons on hover, clicking and other actions... which is again wrong imo, is it not ?

#

i am just starting with UIs so i am a little lost or you could say very very lost

#

@storm flare

storm flare
#

i dont work with UI

spiral sierra
#

ok

bitter echo
#

is it me or creating GUI for python is quite a pain in the arse?

warm shore
#

I just can figure it out

bitter echo
#

sorry man I just got into gui and i'll probably quit in 5 minutes

spiral sierra
bitter echo
#

i'm looking tkinter and pysimplegui

#

but you know I come from graphic design, where everything is basically drag and drop LMAO 😄

thick roost
#

Any lib suggestions for UI better than tkinter?

mortal marten
#

pyqt

spark tinsel
#

Hello, which version of pyqt should I use? 5 or 6 or it doesn't matter?

copper mirage
#

anyone know if its possible to have a holographic looking display with tkinter

ripe shuttle
ripe shuttle
copper mirage
#

Something like this where the light of each item can reflect onto each other

prisma citrus
copper mirage
#

is tkinter the best for just a more basic UI then?

ripe shuttle
#

But you can do more complicated stuff as well

#

If you are willing to make custom widgets then you might be able to achieve the holographic look you want

prisma citrus
ripe shuttle
#

It depends on what you want to achieve. You might also be able to make do with using the command option

prisma citrus
ripe shuttle
#

Also if you scroll down then you can see this for state:
In ttk, there is no option with this name. The state mechanism has been generalized; see Section 50.2, “ttk style maps: dynamic appearance changes”.

prisma citrus
#

Okay... I was just using ttk since I can use the same style in every component (sorry, it's been an year since I have used tkinter)

ripe shuttle
prisma citrus
#

Well I set the on and off value to True and False respectively

mortal marten
rocky dragon
#

There aren't that many differences that examples wouldn't work between the two most of the time, and while I'm not sure if module parity is there yet, most modules are usable now

#

For something new I don't see that much of a reason to not use Qt6, you'll need to move to it in a bit anyway

bitter echo
#

is there any "wysiwyg" way to create gui for python app?

unkempt jewel
#
import tkinter as tk

class DatabaseApp(tk.Tk):
    def __init__(self, *args, **kwargs):
        tk.Tk.__init__(self, *args, **kwargs)

class DatabaseApp(tk.Tk):
    def __init__(self):
        super().__init__()```
What is the difference between these 2 ways to create an app class and which is the good one ?
spark tinsel
dusky socket
unkempt jewel
#

@dusky socket okay thanks !

deft knoll
#

How can i use while loop in tkinter?

thorny star
#

Ive gone through the docs multiple times along with many SE threads. Having some trouble with shortcuts in pyqt5.

Are shortcut events essentially keyPressEvents?
Ive set te shortcut context to allow for the shortcut work application wide, except nothing really comes of it.... I figured it might be due to the widget I have fo\cused handling the event on its own. Do widgets implement a special handler for shortcut events or are they handled inside keypressEvent?

tacit ravine
#

How do I implement subclasses using wxPython's form designer?
I've been looking through docs for a while now

proven basinBOT
#

Hey @slow thunder!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

slow thunder
#

need help for interface car control

ripe shuttle
lofty jasper
#

can someone help me with pysimplegui?

#
def show_image(name):
    file_name = f"./images/{name}.png"
    graph = sg.Graph(canvas_size=(1280,720), 
        graph_bottom_left=(0, 720), 
        graph_top_right=(1280, 0), 
        key='-GRAPH-', 
        enable_events=True)
    img_layout = [
        [graph]
        # [sg.Image(key="-IMAGE-", enable_events=True)],
    ]
    img_window = sg.Window(name, img_layout)
    while True:
        event, values = img_window.read(timeout=50)
        if event == "Exit" or event == sg.WIN_CLOSED:
            break
        try:
            im = Image.open(file_name)
            with io.BytesIO() as output:
                im.save(output, format="PNG")
                data = output.getvalue()
            graph.draw_image(data=data, location=(0,720))
        except Exception as e:
            print(e)
        print(event, values)

    img_window.close()
#

this should create a graph on my window and draw an image over it, but it doesn't

#

it just is a blank screen with the graph on it

#

and there aren't any errors that would indicate im doing something wrong

lucid totem
#

Note: the icon alignment is different from the text alignment

prisma citrus
#

Okay so I think I need some help with tkinter

#

Or logic help?

#
    name_var = name.get()
    age_var = int(age.get())
    number_var = number.get()
    address_var = address.get()
    amount_var = int(amount.get())
    time_var = int(time.get())
    tos_accepted = tos.instate(['selected'])
    print(tos_accepted)
    client_id = "".join(choices(ALL_LETTERS, k=20))
    if (
        not name_var
        and not age_var
        and not number_var
        and not address_var
        and not amount_var
        and not time_var
        and not tos_accepted
    ):
        return
#

For some reason the if statement isn't working

#

I am missing something here ig

ripe shuttle
ripe shuttle
prisma citrus
# ripe shuttle What are trying to do here?

So I got a few entry components (those all are, except the tos one, which is a check button), and I am just trying it to return (not process) further if any of those is empty or smth

#

But if I skip any one of those, it still processes

#

Okay ik something here is wrong with my logic

#

Wait

#

Its working now

#

Black messed up big time rip

#

It added the not inside the bracket, it should have been outside it

lucid totem
unkempt jewel
#
import tkinter as tk
class A (tk.Frame):
     def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
     self.subject_id = tk.Entry(self)

    def get_subject_id(self):
        subject_id = self.subject_id 
        return subject_id

class B (tk.Frame):
     def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
     self.subject_id = A.get_subject_id() 

how can i get the subject_id of class A please ? this is not working

prisma citrus
unkempt jewel
#

okay thanks

unkempt jewel
#

I have encountered a problem, I can't figure out how to add another option with a button.
I'd like to create as many disease as the USER want. This is what the interface look like. Any help is appreciated. This is python, tkinter. My add disease button is not working (I can add only one disease + I can't 'remember' my output disease)

class InsertSubjectDiseasePage(tk.Frame):
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        
        self.disease_label = ttk.Label(self, text='Disease', font=NORM_FONT) 
        self.output_disease = ttk.Label(self, text='', font=NORM_FONT)
        self.disease_var = tk.StringVar()
        self.disease_var.set('')

        self.disease_label.grid(row=7, column=0, pady=10, padx=10, sticky='e')
        self.output_disease.grid(row=7, column=5, pady=10, padx=10, sticky='e')

        #show entry
        self.disease_drop = ttk.OptionMenu(self, self.disease_var, *DISEASE, command=self.option_disease)
        self.disease_drop.grid(row=7, column=1, columnspan=2, pady=10, padx=10, ipadx=50

        self.more_disease = ttk.Button(self, text='Add disease', command=self.add_disease)
        self.more_disease.grid(row=20, column=0, padx=20, pady=20, sticky='sw')

    def option_disease(self, *args):
        self.output_disease['text'] = f'You selected: {self.disease_var.get()}'

    def add_disease(self):
        self.disease_label = ttk.Label(self, text='Disease', font=NORM_FONT)
        self.output_disease = ttk.Label(self, text='', font=NORM_FONT)
        self.disease_var = tk.StringVar()
        self.disease_var.set('')
        self.disease_drop = ttk.OptionMenu(self, self.disease_var, *DISEASE, command=self.option_disease)

        self.disease_label.grid(row=9, column=0, pady=10, padx=10, sticky='e')
        self.output_disease.grid(row=9, column=5, pady=10, padx=10, sticky='e')
        self.disease_drop.grid(row=9, column=1, columnspan=2, pady=10, padx=10, ipadx=50)
gilded sable
#

@unkempt jewel aren't you overwriting the disease each time?

#

Unless there is a new instance of that class for each entry

#

I need a hand too.
I want to use non modifier hotkeys for my tkinter program, but I want to disable them whenever a text entry is active.
However, it seems that when I bind them to my program, the text entry is the thing firing the event anyway

unkempt jewel
#

@gilded sable indeed they are in the same class

#

I should create a nested add_disease function ? like add_disease1, add_disease2 etc... so it doesn't overwrite ?

gilded sable
#

Yes

#

You need something to hold the instances.

silver nymph
#

I am trying to create a user interface(UI) using bokeh and flask such that the UI front-end has plots that will be rendered dynamically and data will also be shown dynamically, based on the start/stop/back button provided in the UI (basically, its an optimization algorithm that I want to pause and play during its each iteration run, and the intermediate plots and solutions are to be rendered on the web). Is there a way to achieve this using flask and bokeh? Also, since I want a back and forth type of interactivity, what sort of database would be suitable for storing user data such that when the back button is clicked by the user, previous plot and data should be rendered.

latent hatch
#

Hey guys! Where can i learn the pktinker module in python??

#

I need to make gui for my project

unique forge
#

PyQt is better

#

and easier

latent hatch
#

I know python basics only

#

I have a project in which i have to make a basic GUI

#

Would you still recommend PyQt? If yes where can i learn? Thanks

unique forge
#

If you only know basic python why is your project to make a UI

latent hatch
#

Can’t argue with school 😂😭😭

unique forge
#

Has your teacher forced you to use Pktinker?

latent hatch
#

No

#

We can do anything as long as i can answer qs based on it

unique forge
#

with PyQt you can use Qt Designer

#

which is a drag and drop ui creation software

latent hatch
#

Wow!! That would be easier ig

unique forge
#

yep

latent hatch
#

Where can I learn this tho?

#

The whole module and stuff

unique forge
#

search for tutorials

latent hatch
#

Youtube?

unique forge
#

Sure

latent hatch
#

Thanks a lot!!

unique forge
latent hatch
#

Yes

unique forge
latent hatch
#

You are a blessing 😭🙏🏻🙏🏻

fervent iris
#

I am a PyQT newbie and trying to make a GUI that runs some pre-existing scripts I have.
Setup: scripts in conda env A and PyQt in conda env B.

Right now I am doing something like:

self.p = QProcess()
...
self.p.start("python", 
    ['../dir/script.py', 'arg1', 'arg2'])

That snippet gets executed in env B, where PyQT is, but apparently it is missing some libraries of env A, when executed. Is there a way to activate env A, inside the QProcess, or what are the alternatives?

digital rose
#
#   Imports Start

import discord, rich, os, fade, random

from discord.ext import commands
from rich.console import Console
from win10toast import ToastNotifier

if os.name == 'ns':
    toast_noti = ToastNotifier()

def clear():
    os.system('cls' if os.name == 'nt' else 'clear')

nl = "\n"
    
def banner():
    colors = [fade.blackwhite, fade.greenblue, fade.purpleblue, fade.fire, fade.purplepink, fade.fire, fade.water, fade.pinkred]
    banner = random.choice(colors)("""
    
    ▓█████▄  ▄▄▄     ▓██   ██▓  ██████ 
    ▒██▀ ██▌▒████▄    ▒██  ██▒▒██    ▒ 
    ░██   █▌▒██  ▀█▄   ▒██ ██░░ ▓██▄   
    ░▓█▄   ▌░██▄▄▄▄██  ░ ▐██▓░  ▒   ██▒
    ░▒████▓  ▓█   ▓██▒ ░ ██▒▓░▒██████▒▒
    ▒▒▓  ▒  ▒▒   ▓▒█░  ██▒▒▒ ▒ ▒▓▒ ▒ ░
    ░ ▒  ▒   ▒   ▒▒ ░▓██ ░▒░ ░ ░▒  ░ ░
    ░ ░  ░   ░   ▒   ▒ ▒ ░░  ░  ░  ░  
       ░          ░  ░░ ░           ░  
     ░                ░ ░              

    """)
    Console.print(banner, justif="center", end="")
#   Imports End
#

doesn't gets printed out

digital rose
#

@unique forge

#

@heavy talon

unique forge
digital rose
#

help me

#

buddy

unique forge
#

I cannot

#

I don't know how to

#

also that has nothing to do with User Interfaces

digital rose
#

can someone help me up

gilded sable
#

@digital rose you missing an import also this is not UIs

glad leaf
#

I am going through a code and there is a code line which I haven't understood:

Entire code:

from tkinter import *
window = Tk() # Initialising the window

def setWindow(): # Fixing the window size to full screen

    width= window.winfo_screenwidth()
    height = window.winfo_screenheight()
    window.geometry("%dx%d" % (width, height))
    window.minsize(width, height)
    window.maxsize(width, height)

setWindow()    
window.mainloop()

Code line I didn't understand:

window.geometry("%dx%d" % (width, height))

If someone could help, that would be great

tribal path
#

!e print("%dx%d" % (200,1000))

proven basinBOT
#

@tribal path :white_check_mark: Your eval job has completed with return code 0.

200x1000
tribal path
#

It's old(est) style formatting

glad leaf
#

oh okay thanks

wary grotto
#

its an amazing youtube channel

#

all you ever need to know bout python, for free

#

(not self promotion btw...i just recommend it)

gilded sable
#

I'm generating a dynamic grid of buttons in tkinter. It's based on subdirectories in a directory, each subdirectory gets a button.
Since there can be quite a large number, I've got a pretty fingerpaint-tier way of just putting them into columns with tk grid. But I'm wondering if there's a better way to dynamically arrange a grid of buttons.

#

Especially since the window can be resized and I want it to nicely fit in there.

gilded sable
#

I guess I want vertical wrap. thomp

ripe shuttle
#

You could always put the buttons in a separate frame and pack the buttons into it. That is what I prefer doing 😂

gilded sable
#

@ripe shuttle will that give me columns when nessecary?

gilded sable
#

It does not thomp

naive monolith
unique forge
#

I forgot

modern tiger
#

I'm trying to create a simple UI with 5 boxes (each box has can get a character by left clicking the box and entering a character), and boxes should be right clickable to cycle through three colors. There should also be a submit button at the bottom of the form. What should I use for this?

#

5 boxes are lined up left to right at the top of the screen, and submit button is under boxes

gilded sable
#

@modern tiger do a web front end and save yourself the trouble

small vault
opal crane
lone jackal
#

Where can I find good documentation for pyqt ui and networking

shy torrent
# digital rose ```py # Imports Start import discord, rich, os, fade, random from discord.ex...

Instantiate the console first,

also it is justify not justif
||second to last line and last line changed||

#   Imports Start

import discord, rich, os, fade, random

from discord.ext import commands
from rich.console import Console
from win10toast import ToastNotifier

if os.name == 'ns':
    toast_noti = ToastNotifier()

def clear():
    os.system('cls' if os.name == 'nt' else 'clear')

nl = "\n"
    
def banner():
    colors = [fade.blackwhite, fade.greenblue, fade.purpleblue, fade.fire, fade.purplepink, fade.fire, fade.water, fade.pinkred]
    banner = random.choice(colors)("""
    
    ▓█████▄  ▄▄▄     ▓██   ██▓  ██████ 
    ▒██▀ ██▌▒████▄    ▒██  ██▒▒██    ▒ 
    ░██   █▌▒██  ▀█▄   ▒██ ██░░ ▓██▄   
    ░▓█▄   ▌░██▄▄▄▄██  ░ ▐██▓░  ▒   ██▒
    ░▒████▓  ▓█   ▓██▒ ░ ██▒▓░▒██████▒▒
    ▒▒▓  ▒  ▒▒   ▓▒█░  ██▒▒▒ ▒ ▒▓▒ ▒ ░
    ░ ▒  ▒   ▒   ▒▒ ░▓██ ░▒░ ░ ░▒  ░ ░
    ░ ░  ░   ░   ▒   ▒ ▒ ░░  ░  ░  ░  
       ░          ░  ░░ ░           ░  
     ░                ░ ░              

    """)
    console = Console()
    console.print(banner, justify="center", end="")
thorny star
#

Is it normal for QMenuBars to draw over other widgetsin PyQT5 like this?. The vertical widget to which the power button belongs to is a vertically oriented toolbar. The rectangular widget is a QTextEdit

kindred mist
#

I read a lot on Google etc. But I don't understand it right. If I plan to sell my application made with pyqt I have to buy a license from qt for 180 per month and a commercial license from pyqt for 550? That's around 2700 in the first year. Is that correct. Pls prove me wrong

unique forge
#

that's for Qt Commerical

#

PyQt is completely free to use and to publish and sell

#

is allowed

#

@kindred mist

rocky dragon
#

It'll have to be OSS through GPL though

kindred mist
#

Why have pyqt then a commercial licence?

rocky dragon
#

For proprietary software

#

you can sell what you made with gpl as the open source software, but anyone who buys it can redistribute it however they want as long as the license is followed

#

pyside is under lgpl for a more permissive license

kindred mist
#

So if I sell my software I have to deliver the whole source code with it, then I can use it for free

#

And if I sell my software without source code I need both commercials?

rocky dragon
#

you would need it with pyqt

#

if you used pyside you'd only need the commercial license under certain circumstances, otherwise if you follow what the license says you can incorporate it in proprietary software

unique forge
#

Yeah you probably were looking at Qt for C++ or PySide licenses

kindred mist
#

Hmm, OK, I think they should clarify this more on his pages. On pyqt page say u need a qt licence and a pyqt licence to comercial use (no gpl)

#

But it's no problem to use it under gpl so, it's OK

unique forge
#

make sure it's the riverbank computers website

viscid drift
#

i am using tkinter and I want the user to be be able to selecft the folder that they want to save something in, how should i use tkinter to do this?

viscid drift
#

ty

kindred mist
#

@unique forge yes its on the riverbank side

#

@unique forge PyQt does not include Qt itself. You must also obtain an appropriately licensed copy (either the commercial version from The Qt Company or the LGPL version from the Qt Project). (FROM PYQT WEBSITE)

viscid drift
#

if i am creating a basic app with tkinter how should i organise and position widgets

viscid drift
#

as in with what system co-ords packing or grid or something like that

ripe shuttle
weary stirrup
#

Hello all, looking for recommendations on simple graphical packages to plot network devices and their physical connections on

#

I've written a script that can log into any number of devices and pull their CDP/connection data. This tells me a few key pieces of info: remote/local port, remote/local hostname, model, etc. I am currently saving all of this data into a nice dictionary/yaml format and would like to know what my options are to graph this automatically

weary stirrup
glossy whale
#

can anybody help me

mighty rock
wary grotto
#

wow ur making an actual game!

glossy whale
glossy whale
tranquil oyster
#

Hello, anyone here?

mighty rock
fading basin
#

is it possible to change the color of the tittle bar if so then how exactly also i have a simple script here if u want that : ```py
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtCore import *

class Window(QMainWindow):
def init(self):
super().init()
self.setWindowTitle("Burner")
self.setWindowOpacity(0.9)
self.setGeometry(60, 60, 600, 400)
self.setStyleSheet("background-color: #19202a;")
self.show()

MyApp = QApplication(sys.argv)
window = Window()
MyApp.exec_()```

broken shard
#

My problem is that the lineedit runs my command(): 2 times and I don't know why

class MainWindow(QWidget):
    def __init__(self):
        super().__init__()
        self.setupUi()

    def setupUi(self):
       self.lineEdit = QLineEdit(self.groupBox)
        self.lineEdit.setGeometry(QtCore.QRect(150, 0, 848, 86))
        self.lineEdit.editingFinished.connect(self.command)
 self.lineEdit.setFont(font2)
        self.lineEdit.setLayoutDirection(Qt.LeftToRight)
        self.lineEdit.setStyleSheet(".....")
        self.lineEdit.setFrame(False)
        self.lineEdit.setMaxLength(10000)
        self.lineEdit.setEchoMode(QLineEdit.Normal)
        self.lineEdit.setCursorPosition(0)
        self.lineEdit.setReadOnly(False)
        self.lineEdit.setClearButtonEnabled(True)
 def command(self):
        global html4
        text = self.lineEdit.text()
        self.lineEdit.clear()
        search = re.search("^echo", text)
        if search:
            text_list = re.split("\s", text, 1)
            print(text_list)
            if len(text_list) > 0:
                for i in text_list:
                    if os.path.exists(os.path.dirname(i)):
                        print(text_list[1])
                        head, tail = os.path.split(text_list[1])
                        name, extension = os.path.splitext(str(tail))
                        if str(extension) == ".txt":
                            with open(text_list[1], "r") as f:
                                file_context = f.read()
                            html4 = file_context
                            f.close()
            elif search and len(text_list) > 0:
                text_list = re.split("\s", text, 1)
                html4 = text_list[1]
            else:
                html4 = text
#
html1 = '''<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p style="color:'''
        html2 = '''red'''
        html3 = ''';"> '''
        html5 = '''</p>
</body>
</html>'''
        html_end = html1 + html2 + html3 + html4 + html5
        self.lineEdit.clear()
        self.textEdit.setHtml(html_end)

So if I type "echo E:\Documents\python\PyCharm\venv\CLI\ascii-art.txt" in my lineedit and press Enter, then it prints 2 times the context of "ascii-art.txt"

broken shard
# fading basin is it possible to change the color of the tittle bar if so then how exactly also...

https://youtu.be/22IMWSUlrZg
There are a lot other tutorials of custom Title bar.

This is a tutorial series where we will be building a full Desktop App one component at a time. Subscribe so that you won't miss out when I upload other episodes.

In this part[3] we are going to build our main app window with a custom navigation bar in python using Qt Designer, Pyqt5, and Pyside2.

Download source code and source files from:htt...

▶ Play video
digital rose
#

Anybody here familiar with PyQt.QMediaPlayer?

#

I want to display a label on top of a video but the label have a background color and i am unable to remove that

#

using stylesheet

#

i want to remove the grey background-color it have

digital rose
#
        self.setAttribute(QtCore.Qt.WA_TranslucentBackground)```
#

And then can create a custom Title bar with your own styling and Minimize, Maximize, Close buttons

ripe cosmos
#

does anybody know how to go back to main screen after opening a table in kivyMD?

fading basin
#

Thank you @digital rose and @broken shard sorry for replying late since timezones

dense rock
#

Which do you think is the best python module for making GUIs cause I used PyQt its good but has its license stuff so planning to move to different one . . . for paid GUI apps can you help me here thanks

digital rose
# dense rock Which do you think is the best python module for making GUIs cause I used PyQt i...

(PS: it mostly depends on if you're trying to build a web-based interface, or just a desktop application, and i'll be writing about options for the latter.)

if i talk of some appropriately documented lib, you'd be down to Tkinter, PyQt, and Kivy. out of these, Kivy has a huge hassle (plus, it does not seem to offer anything special, and doesn't seem to be great from an aesthetic point of view), you don't wish to use PyQt, and tkinter is actually decent (if you want to avoid the extremely vintage look, you can have a look at some custom tkinter themes available online, or write one yourself).

also, these libs do seem to have quite a decent community each, so it's highly likely that you'll find answers to common problems on online forums, like stackoverflow.

if you are not satisfied with any of these, then there's not much that python has to offer (as far as i know, or even if it does, it's most likely a third party project, and might not be well documented). so the best option would be to use some other language that might offer decent choices - for instance, if you're more into microsoft styled UI, you might want to use C#. other than that, JavaScript does seem to offer decent UI options too.

if you're still not satisfied, you might want to write a tiny project to draw widgets off of a graphics lib, like pygame, which would normally sound ridiculous, but it's not that hard / not that big of a hassle if you want a tiny project, where you would write code only for the GUI you want to exist in the app.

dense rock
#

👀

#

thank you

sick carbon
ripe cosmos
#

can somebody help me with this problem ^

#

the question was too big too post here

tribal path
#

app.validate_user(Username.text, Password.text) what error are you getting specifically?

rain jetty
#

and the pyqt license only affects you if you decide to go commerce with a pyqt app

dense rock
#

ok

#

thanks

fathom epoch
#

Also (LINE 12) was showing invalid syntax for inconbitmap

ripe shuttle
fathom epoch
#

ok thanks. I will check after changing

ripe shuttle
#

Correct me if I am wrong guys

uneven summit
#

It's been two days I am trying to install kivy on windows 11. Tried Python 3.10 and Python 3.9
I used pip install kivy command

Anyone knows what I am doing wrong?

fathom epoch
#

can you send error?

proud walrus
#

Can I get some inspiration from some nice UIs you people made?

fading basin
fading basin
lapis garden
#

Hey guys, I have a project idea in mind, wherein I want to create a GUI application using python to analyse stock market data, so it involves a lot of plotting graphs n all. But I am confused whether to start learning Tkinter and PyQt. From what I have searched it seems that Tkinter is easy to learn but is hard to debug and is not scalable and PyQt has a lot more functionality but has a steeper learning curve. Can somebody suggest me what I should start learning. Thanks in advance 🙂

sick carbon
untold spear
#

hello. I'm having troubles recently with python 3.10 and wxpython 4.0.7.2-3. It seems to happens only in application with menues. Can you help me? Look at the images.

digital rose
#

guys anyone here knows pyqt5 ?

thick dust
#

Yes

digital rose
proud walrus
#

Cool! Man, PyQt if powerful. I used Tkinter, and at it's default, it's ugly. Tkinter needs some tweaking to look nice

untold spear
digital rose
#

Hello can anybody help me in php for quering data of one row from a mysql database?

modern pike
#

Hello everyone ( i am new to this server sorry if i texted in a wrong channel)
I have a query regarding tkinter frames and winfo_children() function.
So for my Final year of high school project our group and i have decide to put together a banking system with Mysql connector and python (we have to use these two compulsorily so there is no alternative here) Now i am doing teh UI for my tkinter application and i seem to have encountered a little bit of an issue with how frames work.

def ClearPrevFrame(rootFrame):
  Widgetlist = rootFrame.winfo_children()
  rootFrame.pack_forget()
  for i in Widgetlist:
    i.destroy()
  
def RegisterPage(): 
 # has relavant code for register page
  ClearPrevFrame(menuFrame)
def Loginpage():
  #has relavant cide for login pge
  ClearPrevFrame(menuFrame)
#Root buttons
RegisterPage = Button(menuFrame, text = 'Register', command  = RegisterPage).place(relheight=0.06,relwidth=0.2,relx = 0.56,rely = 0.1)
Loginpage = Button(menuFrame,text = 'Login', command = Loginpage ).place(relheight=0.06,relwidth=0.2,relx= 0.75,rely=0.1)
root.mainloop()

now the menuFrame is inside a Cavnas(named Kanvas) and what i want to able to do is clear the canvas or the frame everytime i press the buuttons

#

i tried using the winfo_children() function to get the data of all the widgets and then delete them induvidualy

#

but for some reason that dosent work as i have 0 widgets everytime i do it but i am able to clearly see the widgets on my tkinter screen

#

which causes this error

#

i am in urgent need of help to resolve this issue

digital rose
foggy inlet
#

how can I restrict the Entry input to only numbers and float are allow for tkinter?

digital rose
# foggy inlet how can I restrict the Entry input to only numbers and float are allow for tkint...

you'd need events. just bind keys to the entry widget, and on each keypress, check if the entered character is an integer, string, etc.

def on_key(event,):
  # key = event.keysym # the name of the key you pressed
  char = event.char  # the character you tried to input
  
  if char in "0123456789.":
    pass; # do something
  
  else:
    # this statement disables the regular functionality of a key (temporarily)
    return "break"

widget.bind("<Key>", on_key)
mighty rock
#

You can use not in here

#

Instead of the useless if

modern pike