#user-interfaces
1 messages · Page 15 of 1
You're using the default font. Would need to locate a suitable font and use that.
(Kivy does have some font fallback via pango, but won't have a more generic fallback until version 3)
:incoming_envelope: :ok_hand: applied timeout to @hushed crest until <t:1709561451:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
need help with a timer that dosent seem to work with tkinter
when the button is pressed it seems to freezes and skip the first configured text then just shows the last text
You can't use time.sleep in a ui. tkinter's mainloop is basically a fancy while loop, so using time.sleep essentially pauses the application. If you want some sort of timer, you need to use the .after method
i dont really care for the font, i want to use default font but what should i use so i can get these cool unicodes
:incoming_envelope: :ok_hand: applied timeout to @grand quest until <t:1709582785:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
https://fonts.google.com/ as said find a font that has the unicode characters you want to use. (Or create your own)
typically for weird symbols you want a Nerd Font
though, no, ☺ isn't there. i do have it, but from some other font. hmm.
emojis? eh i dont really mind no emojis
to get the unicode funcy symbols, sometimes u need a nerd font
gucharmap is a good program for viewing this stuff
hi, i'm using the lib wxpython
how would you catch all event type to display the name of each as they happens ?
I was wondering if anyone has had any thoughts, experiences, or opinions on Toga: https://beeware.org/project/projects/libraries/toga/
@rose depot Not entirely sure if this helps out, but there does seem to be an EventWatcher that'll let you watch and catch any events that happen on a given widget https://docs.wxpython.org/wx.lib.eventwatcher.EventWatcher.html#wx.lib.eventwatcher.EventWatcher
oh thanks I missed that one
- Does building (using buildozer) kivy app takes a lot of time? Mine is 2hrs already and its still going on.
- Building same project after a change will also take longer?
- Will it be same experience when building other kivy projects?
hey, has anyone here ever tried to install python bpy module?
First build will take a while, that sounds excessive though. How are running the build; with which OS?
Subsequent builds will be much quicker.
i5 procssor, win 10 wsl 🥲
well never tried it but i have heared that they have vscode extension to help you with imports
I am trying to install it but it is erroring out although I have the correct python env they require for that specific version
thought to ask since blender api scripting is popular
there is also bpy package in pypi
Any chance you are building from /mnt/c ?
that is what i am refering to
100%
If you move your build env/folder into the wsl filesystem it'll build much faster
well i will remember that for next build.
😦 well it finally threw error
BUILD FAILURE: No main.py(c) found in your app directory.
well if i remember correctly there is a discord server with name bpy you probably get help from there
I am in the official blender server
there is a bpy one?
just bpy?
lemme search
yep there is
should i dm you the invite?
^^^
Hi
may someone here be both experienced in wxpython and willing to do a small code review ?
https://randombrainwhispers.blogspot.com/2024/01/five-ui-interface-ideas-for-various.html
Few ideas for UI interface
If anybody want any idea or inspiration they can
Five UI interface ideas for various projects: 1. Minimalist Dashboard: - Description: Create a clean and minimalistic dashboard ...
Suggest me what else I should add
@wicked helm hey are you online? what was that for loop you gave me a few days ago
i have list and needed to change everything in th elist's state to disabled
:incoming_envelope: :ok_hand: applied timeout to @glossy shuttle until <t:1709798781:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
you should look up for loops on your own
its very simple
So, I created some GUIs using FIGMA and converted them to Python using "Tkinter Designer" but I can't find a way to connect the GUIs between them so when I'm pressing a button it switches to the other GUI. I need to mention that I'm new to UI and I'm struggling to find a solution. Thanks in advance !
Here are some photos and the code of 2 of them :
yeh figured it out ty
.
what do you guys think abt the future of flet? I'm new to creating interfaces on python and it seems other packages are more polished, but it seems learning it could be a good bet instead of the ones we know?
idk tkinter and customtkinter are probably the most eisiest to understand
Hi i dont know where to upload this question however i need help with align text in python. It in another language however i want the number beside the country to move to the right and they should be aligned.
it shoule look like this.
I'm trying to set up a progress bar for a Downloader on custom tkinter.
I have a download function that's called when the download button is clicked, that removes its frame from the grid and updates progress on every iteration of the download.
What I expect to happen is that the the frame with the button would be removed from the grid immediately, and then the progress bar would be updated as normal. Instead, it stalls and doesn't go to the next screen until progress is completed
Going to post code in a sec
class SelectDirectoryFrame(customtkinter.CTkFrame):
def __init__(self, master):
super().__init__(master)
self.grid_columnconfigure(0, weight=1)
self.grid_rowconfigure(0, weight=1)
self.grid_rowconfigure(1, weight=25)
self.grid_rowconfigure(2, weight=2)
self.title_label = customtkinter.CTkLabel(self, text='Ikemen-GO Build Downloader')
self.title_label.grid(row=0, column = 0, sticky='enw', padx=1)
self.directory_frame = DirectoryFrame(self)
self.directory_frame.grid(row=1, column = 0, sticky='nwe')
self.next_button = customtkinter.CTkButton(self, text='Download', command = master.init_download, width=50)
self.next_button.grid(row=2,column=0, sticky='se', pady=7, padx=7)
class UtilFrame(customtkinter.CTkFrame):
def __init__(self, master):
super().__init__(master)
self.grid_columnconfigure(0, weight=1)
self.grid_rowconfigure(0, weight=1)
self.select_directory_frame = SelectDirectoryFrame(self)
self.select_directory_frame.grid(row=0, column=0, sticky='news')
self.progress_bar_frame = None
def init_download(self):
self.select_directory_frame.grid_remove()
self.progress_bar_frame = ProgressFrame(self)
self.progress_bar_frame.grid(row=0, column=0, sticky='news')
download_release(Progress(self.progress_bar_frame))
class ProgressFrame(customtkinter.CTkFrame):
def __init__(self, master):
super().__init__(master)
self.grid_columnconfigure(0, weight=1)
self.grid_rowconfigure(0, weight=1)
self.progress_bar = customtkinter.CTkProgressBar(master=master)
self.progress_bar.grid(row=0, column=0)
self.progress_bar.set(0)
def step_download(self, current):
self.progress_bar.set(current)
def download_release(progress):
latest_request_url ="https://api.github.com/repos/ikemen-engine/Ikemen-GO/releases/latest"
response = requests.get(latest_request_url)
json = response.json()
name = json["name"]
assets = json["assets"]
for asset in assets:
if CURRENT_OS not in asset["name"]:
continue
with requests.get(asset["url"],stream=True, allow_redirects=True, headers={'Accept':"application/octet-stream"}) as r:
total = int(r.headers.get('content-length', 0))
count = 0
with open(asset["name"], 'wb') as file:
for data in r.iter_content(chunk_size=65536):
size = file.write(data)
count += size
progress.update(count/total)
Anyone know what could be wrong?
I don't see any threading here - if this isn't done in a worker thread, then the GUI won't update (and in fact, should freeze entirely) until the download finishes.
Makes sense but I've seen many code examples of this progress bar and not once was threading used, they all used callbacks like this
Ok, just as I typed that I found a single example with threads
Any suggestions for how I could make this UI look better?
:incoming_envelope: :ok_hand: applied timeout to @calm coral until <t:1709947006:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Fixed it up a bit
i imagine you fixed this by running tk.update() alongside the progress bar? if you want to see another example, i recently wrote a tkinter GUI where downloading was done via an asyncio event loop running in a second thread:
https://github.com/thegamecracks/parallel-downloader/blob/v1.0.7/pdl.py
it's still updated via callbacks and is overall kind of overkill, but since the main thread isn't doing any waiting for I/O, it should be able to respond to user input without network latency causing the interface to hitch
Can anyone tell me how do I get my tkinter apps to look good colorful and modern. My apps now look very basic and default
the two options i know of are:
- ttkbootstrap (builds on top of tkinter's themed widgets and has several light/dark themes, plus a few new widgets)
- customtkinter (remade widgets with light/dark themes)
if you haven't used thetkinter.ttkmodule, you might also want to start with that since themed widgets will give you native-feeling widgets by default, and it's already part of tkinter
also if you aren't already familiar with the basics like the grid geometry manager, tkdocs has been a massively useful resource to me (and equally IDE autocompletion/type-checking as well)
https://tkdocs.com/tutorial/grid.html
def UI_Exception(self, s):
dlg = QMessageBox(self)
dlg.setText(s)
dlg.setIcon(QMessageBox.critical)
dlg.show()
def file_open(self):
path, _ = QFileDialog.getOpenFileName(self, "Open file", "", "Text documents (*.txt);All files (*.*)")
if path:
try:
with open(path, "r") as f:
text = f.read()
except Exception as e:
self.UI_Exception(str(e))
else:
self.path = path
self.editeur.setPlainText(text)
self.modifierTitre()
def sauverFichier(self):
if self.path is None:
return self.sauverFichier_comme()
self.sauverChemain(self.path)
def sauverFichier_comme(self):
path, _ = QFileDialog.getSaveFileName(self, "Save file", "", "Text documents (*.txt)")
if not path:
return
self.sauverChemain(path)
def sauverChemain(self, path):
text = self.editeur.toPlainText()
try:
with open(path, "w") as f:
f.write(text)
except Exception as e:
self.UI_Exception(str(e))
else:
self.path = path
self.modifierTitre()
```
Why put "_" in path, _ = ...
@hexed girder maybe the underlying c++ api expects it in that way, that's why
Oh okay
That's because the function returns 2 elements
The second you don't use, hence its a convention to name it _
which one we don't use ?
You can use path, *_ = ... for example if you just need the first returned thing from 2 or more things
The second one (named as _) since its after path
srry i don't understand?
What do you not understand?
" since its after path "
def fn():
return 2, 3
a, b = fn()
do you understand this code?
yes
So a is 2 and b is 3
yes
So here the getOpenFileName is returning a path and something else
You only need the path in your code
And _ is like a convention for unused variables
Thanks, I will give tkinter.ttk a try before considering the other modules so I can know which one satisfies my needs
@digital rose Look in here
th happened in here
Hello everyone !
I want to create a login window, with a wallpaper, and in this window I want to put a frame (which has two boxes one to write one for username and another for password and a button) I want the frame to be transparent which reflects the image of the window like this example https://imgur.com/kNgoH0N
hello guys I have a question, I made an application using tkinter and I would like to know if there’s a way I can use the application I built on my android phone. The application is a .py that I converted into a .exe but I can’t run the .exe on android so I should convert it into .apk but I don’t know if it will work to run the application on android
@worthy sequoia You can use the py via pydroid3 (other apps may work too).
Compiling your own app/apk would be more involved, and not sure where could direct you to
I'm looking for some light UI development solutions, UI is not my strong point. I have some fairly system intensive analysis scripts that i would like to run on my workstation, but from anywhere on my local network. Right now I'm actually sshing in and running it. I'd much prefer access it view a browser (but not via notebook).
Other than using the httpd and building out a ui with that, are their any frameworks that might be applicable here? Security is less a concern, its a locked down local network.
@stiff ore https://discord.com/channels/267624335836053506/1217159250158162041
oh and in case you haven't already seen this, tkdocs was a very useful resource to me for understanding the fundamentals of tkinter
https://tkdocs.com/tutorial/concepts.html#geometry
https://tkdocs.com/tutorial/grid.html#nestedlayout
I wanna like, in tkinter...
To have video player, already done actually, basic, update image, add frame count.
I want add under it like scroll bar, that shows where at video i am, but, i want also display there, on that bar, frame colors palette , for each frame.
I can probably make up some way to generate that image, [x: time; y: palette]
But it sure will be longer than i can display, and i want to make it background or smth for the video scroll bar...
So i wanna make that scroll bar same length in pixels as frames in video, and make scrollbar itself scrollable....
Atleast help me understand what i want, ty.
i really am sorry for what happened i got hacked and i am currently looking for a way of fixing the problem before it worsens if anyone has a suggestion to help fix it fast i would be grateful
Change password?
Or your mail got hacked.. there is same thing, changing pass should work
ok great i solved the problem and thx for the help btw what actually fixed the problem was enabling 2fa
is there a way to lock my tkinter app's aspect ratio? (it should still be resizable)
I usually just drop all styles and make all scripts from zero.. but it can be slower that way..
ok and what is your question ?
Form editor! You can make forms, export them as .json files and import the json files to see its content! I also need to know a better name for it...
Hello, I have gained quite a bit of experience with Tkinter in the past few months and I am ready to take my GUI learning to the next level. What would anyone recommend to get into next now that I have almost mastered Tkinter?
There's not much in Python GUI land apart from Tkinter and PyQt / PySide. Others are very new and lack too many useful stuffs or are so old and have so badly designed APIs you won't learn anything meaningful out of it.
I would say that look for some open source projects. Understand and contribute.
Just search for github topics on tkinter.
Hello, I'm trying to render a 2d animated textures with GLFW and OpenGL but on screen, some part of the animation look quite strange and I have no idea where it's coming from. (I'm new to OpenGL and the way I did it may not be the usual method. I'm all ears for better implementations)
Here's the output (the attached gif) : some pixels on the first frame are shifted
Here's my code :
opengl_test.py
https://paste.pythondiscord.com/ZQQQ
shader.vert
#version 330 core
layout (location=0) in vec2 vertexPos;
layout (location=1) in vec2 vertexTexCoord;
uniform vec2 tilePos;
uniform vec2 cameraPos;
uniform mat2 cameraSize;
uniform vec2 texPos;
uniform mat2 texSize;
out vec2 fragmentTexCoord;
void main() {
gl_Position = vec4(cameraSize * (tilePos - cameraPos + vertexPos), 0, 1);
fragmentTexCoord = texSize * vertexTexCoord + texPos;
}
shader.frag
#version 330 core
in vec2 fragmentTexCoord;
out vec4 color;
uniform sampler2D imageTexture;
void main() {
color = texture(imageTexture, fragmentTexCoord);
}
test3.png
Even if you dont know how to fix it but just why it behaves like that I'm interested (ping me)
@somber hemlock @sinful pendant Thank you. That is slightly surprising. I suppose this is because Tkinter does a good enough job at handling most application needs as far as Python is concerned? It seems I have more research to do on the topic. Thanks for the responses.
tkinter is extremely limiting compared to pyside/pyqt
if you just need a basic window with some buttons then sure, tkinter is "good enough"
Tbf nobody really does guis in python. There's not much attention towards this in general. Python is seen as an AI-enabler backend language.
I work with python GUIs daily...
Cool. Don't you look out for alternatives?
Why do I need to?
I'm lightning fast with python gui. If we have a problem that needs solving, I can whip up a gui and have it out quickly
You use Qt Widgets iirc
yeah
I'm not building huge enterprise software with python. I'm building in-house tools to solve specific problems
Just in case anyone that helped earlier was wondering, the specific issue related to Tkinter not displaying proportional ASCII images is mostly related to not using monospace fonts. Using unicode spaces like em spaces was redundant. Simply specifying the strings as raw and using monospace fonts makes the art render exactly as it looks in other programs like notepad.
And I think in kivy
Hello I joined the discord to ask if there is anyway to embed lightweight_charts / Chart object/window to a frame. It opens in a seperate window I guess a TopLevel but I am not sure. Did anyone worked with it before ? (I am not pro level in python so sorry for if th equestion is silly.)
I made a console application for a task manager project (as a beginner project).
What is a good beginner friendly library for making it into a GUI based application? Is there any crash course for the basics that isn't 3 hours+? I don't mind rewriting my code.
Nvm, I think I will make it with Tkinter. Found a 50 minute crash course
I don't suppose its possible for you to show a small demo type thing - I've tried making (g)interfaces in python before with little success so I just switched to electron
I'm writing a rather simple Python application in which I would like to have a multiline textfield, textbox or textarea to which I can add received responses over time. Been searching for days now on the internet, DearPyGui documentation and forum and on this Pyhton discord server. Unfortunately I have not found anything which will provide the possibility to build up a text or list like this. I did manage to update a piece of text but this way only the last received response is shown.
Is it possible in DearPyGui to build up and display a list of text like this? If so how would one do that? I can't imagine such a rather simple functionality is impossible to accomplish in a DearPyGui interface.
Can you send an image of what you want?
This is the code I use to send commands to GRBL and receive responses from GRBL.
def send_command(command):
global ser
if ser and ser.is_open:
ser.write((command + '\n').encode())
time.sleep(0.1) # Wait for GRBL to process command
dpg.set_value("##GCODE_INPUT", "")
else:
dpg.add_text("Serial port is not open")
def receive_response():
global ser
response = ser.readline().decode().strip()
return response
def listen_to_GRBL():
global ser
status = True
# Define a function to continuously read responses
while status:
response = receive_response()
if response:
print(response)
if "ok" in response or "error" in response:
status = False
What I would like is a text area, multiline testfield or something in which I can add the responses and build uit a list of responces received during a session. Preferably with a scrollbar.
Example of output I would like in the list or textbox
Response:
Response ok
Response ok
$0=10
$1=25
$2=0
$3=0
$4=0
$5=0
$6=0
$10=1
$11=0.010
$12=0.002
$13=0
Demo of code or just an image of the UI?
Image of code I suppose - And a couple months ago you said you just hardcode it (instead of using any designer that generates ui files), surely this takes ages to develop because you have to reload the ui everytime you make a change
Also do the uis scale
The code is hundreds of lines long and uses imports of other widget classes/utility functions I've created so it's a bit hard to share
and yeah, reloading the ui takes like half a second. If you use designer, you'd also have to reload the UI to see your changes so I don't know what the difference there is?
Depends on the UI. Some of them I used fixed sizes, but some expand if there's content in it the user might want to have more space for
If my UI uses a large data set and would make it slow to develop, I would usually use a smaller sample while I build the UI, and then afterwards I'd swap it to using the larger data set
@sleek hollow did you finally use the QAbstractItemModel yet?
Yeah I've used it. Not too often though
Its so poorly implemented in python
how so?
The internal pointer thing really disappears
I guess I don't know what I'm missing out on since I don't use c++
Completely ignoring python's memory management
Like in C++ you can have a nullptr, but in Python you can't, but thanks to Qt, you actually can
Have you finally jumped ship over to QML or still on Qt widgets?
nah haven't touched qml yet
I don't really have a reason to jump over. I have a fairly big library of custom widgets I'd rather not have to recreate
What custom widgets have you created?
not so much in the styling, but in the functionality
with functionality that fetch specific data that I can reuse in my UI
What base class are you using for them
Usually QWidget
Means are they like infinite scroller type thingies?
That's pretty common i guess
nah nothing like. These are all UI I use for Autodesk Maya
so it's specific functionality to my pipeline there
fetching scene assets, configuring scene data into objects and displaying them in lists, etc
Gtk has arguably gotten a better list / tree model / view impl
Maya is built on Qt so it has seamless pyside integration
You should look at it once just for like inspiration
That's cool
hard to decide if this should go into here or web.. here because its a desktop interface. but web because.. well its web 🤷 lol
anyway, ive been working on a little project. think of it as "kind of" electron for python, though also really not..
long story short its a template for designing desktop apps using python and astro (https://astro.build) to create nice interfaces using web technologies
astro has the benefit also of using the concept of islands and allowing one to use any framework they like, vua,react,lit,svelte whatever suits you, though my framework provides for plain astro components or vue by default.
Designer you can drag/drop/manipulate visually
Okay
Is building uis a main aspect of your job?
I'd say about half. I usually have a task and decide I'll build a tool to solve it
Sure I guess, but then you still need to export and launch the UI to confirm and test
I can visualize my UI as I build it with code
I guess if you're very experienced with creating uis you can just do it your way as you know how everything will turn out anyway
Cool stuff
What kind of task?
I work with 3d artwork and deal with character setup, as well as writing tools to support the animators
So recently I wrote a script that took a 2d sprite sheet and created a custom texture so we could display and animate it as the face of a 3d character
Then created a supporting tool for animators to actually interact with that setup
There's no way I could have built that UI in designer since it's almost entirely dynamic. It detects any character in the scene with that setup in my animation file, and dynamically creates a tab for that character populated with buttons for that character's face
:incoming_envelope: :ok_hand: applied timeout to @viral thorn until <t:1710816182:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @digital rose until <t:1710816348:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
I changed tools, I use PyQt5 now
what ?
I don't use Tkinter because it is limited, I use PyQt5 at the moment
I mean, good for you ?
I have no idea why you're saying that to me
ah it's from 4 days ago
Because I just saw your message for me, and I replied to you 
Hi Does anyone need blockchain & web developer?
progress is progress.
very cool
also make in tkinter
and pr is NOT print, it's actually port 1 "Hello World" so it sends to data to port 1
it's assembly language
(This is a close to final product)
Can you help me? I’m trying to create a PyQt5 GUI for real time audio pitch processing, are there any things I should add to my code? Or anything needs fixing?
Sorry, the code is generated by ChatGPT
What is the best python-based GUI to learn? I have some experience with tkinter and pyqt, they seem intuitive and relatively simple with their own strengths, so is there some others I should try out or should I depart from python and begin learning something else if my current interest is in GUI's?
There's pretty much nothing you can't do with pyqt
should change that to world instead of UK eh?
there isn't much evolution in python gui. you can pick up a frontend js lib like react, to see how uis are getting built nowadays. there's also react wrappers like reflex which try to have a similar notion of state driven UIs
Hey guys! I am new in this community. I have some problems with my code i cant seem to resolve.
If anyone can help me it would be great.
Please feel ffree to PM me or instruct me where I can share code.
Thankyou.
You can talk about your problems here itself #❓|how-to-get-help
hi, i need help with a basic window (on W11). (first time I code with python)
I want to highlight an area on the screen based on a region (x, y, width, height).
To do this, I'm creating a window with 50% opacity to easily visualize the area.
I want to set a red background color, but my "highlight" area is still white.
How can I get opacity + background color in my window?
This is my code:
import time
import win32api
import win32con
import win32gui
class Highlight():
def __init__(self, x: int, y: int, w: int, h: int):
self.registerWindowClass()
self.createWindow((x, y, w, h))
def registerWindowClass(self):
self.window = win32gui.WNDCLASS()
self.window.hInstance = win32api.GetModuleHandle(None)
self.window.lpszClassName = 'Highlight'
self.window.style = win32con.CS_HREDRAW | win32con.CS_VREDRAW
self.window.hCursor = win32gui.LoadCursor(0, win32con.IDC_ARROW)
self.window.hbrBackground = win32gui.CreateSolidBrush(
win32api.RGB(255, 0, 0))
win32gui.RegisterClass(self.window)
def createWindow(self, rect: tuple[int, int, int, int]):
self.hwnd = win32gui.CreateWindowEx(
win32con.WS_EX_LAYERED | win32con.WS_EX_TOPMOST | win32con.WS_EX_TOOLWINDOW,
self.window.lpszClassName, '', win32con.WS_POPUP,
*rect,
None, None, self.window.hInstance, None
)
win32gui.SetLayeredWindowAttributes(
self.hwnd, win32api.RGB(255, 0, 0), 128, win32con.LWA_ALPHA)
def show(self):
win32gui.ShowWindow(self.hwnd, win32con.SW_SHOWNORMAL)
time.sleep(5)
self.close()
def close(self):
if self.hwnd:
win32gui.DestroyWindow(self.hwnd)
win32gui.UnregisterClass(self.window.lpszClassName, None)
self.hwnd = None
okay, I finally made it work. Maybe I can do better/simplier ?
import time
import win32api
import win32con
import win32gui
class Highlight():
def __init__(self, x: int, y: int, w: int, h: int):
self.registerWindowClass()
self.createWindow((x, y, w, h))
def registerWindowClass(self):
self.window = win32gui.WNDCLASS()
self.window.hInstance = win32api.GetModuleHandle(None)
self.window.lpszClassName = 'Highlight'
self.window.style = win32con.CS_HREDRAW | win32con.CS_VREDRAW
self.window.hCursor = win32gui.LoadCursor(0, win32con.IDC_ARROW)
self.window.lpfnWndProc = self.wndProc
win32gui.RegisterClass(self.window)
def createWindow(self, rect: tuple[int, int, int, int]):
self.hwnd = win32gui.CreateWindowEx(
win32con.WS_EX_LAYERED | win32con.WS_EX_TOPMOST | win32con.WS_EX_TOOLWINDOW,
self.window.lpszClassName, '', win32con.WS_POPUP,
*rect,
None, None, self.window.hInstance, None
)
win32gui.SetLayeredWindowAttributes(
self.hwnd, 0, 64, win32con.LWA_ALPHA)
def show(self):
win32gui.ShowWindow(self.hwnd, win32con.SW_SHOWNORMAL)
win32gui.UpdateWindow(self.hwnd)
time.sleep(5)
self.close()
def close(self):
if self.hwnd:
win32gui.DestroyWindow(self.hwnd)
win32gui.UnregisterClass(self.window.lpszClassName, None)
self.hwnd = None
def wndProc(self, hWnd, message, wParam, lParam):
if message == win32con.WM_PAINT:
hdc, ps = win32gui.BeginPaint(hWnd)
brush = win32gui.CreateSolidBrush(0x0000FF)
client_rect = win32gui.GetClientRect(hWnd)
win32gui.FillRect(hdc, client_rect, brush)
win32gui.EndPaint(hWnd, ps)
return 0
else:
return win32gui.DefWindowProc(hWnd, message, wParam, lParam)
why are you even using win32 api for all this?
:incoming_envelope: :ok_hand: applied timeout to @floral flame until <t:1711257910:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
I will pay 15$ the person who succeeds changing my small custom tkinter code program background to a gif background
dm me for source code
!rule 9
any ideas how to make a button background to be transparent? I tried bg_color='transparent' but it didnt work, it just looks like this
@tribal path regarding the help post #1221439743741657229) I specified these 2 variables to .spec file and the error still persists ```
android.jdk = 17
(int) Minimum API your APK / AAB will support.
android.minapi = 24
Not aware of android.jdk being a thing; anyway it's sudo update-alternatives --config java that you should be running, and make sure to clean the old build away
ah that explains stuff, let's see what it does now 👍
Yes! It took a good 30 minutes to build and it was successful! Thanks a lot 😄
what if I do changes to code and need to rebuild? Do I need to delete existing folders that were made and re-do the 30 minutes build everytime?
Does anyone know a better guide for customtkinter than the documentation? It seems to be lacking quite a bit.
because i'm already using pywin32 to move/resize an app on win11. I will read some info with easyocr on a specific region. I want to show the scanned region on app with my previous code. The app only run on windows, don't need to be multi platforms.
:incoming_envelope: :ok_hand: applied timeout to @meager owl until <t:1711316352:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
i wonder if we will ever know why the spammers target this channel 😔
When it comes to user interface, does this come down to software/app development?
user interface is just a visual window that is displayed that you can interact with
but yes, just about every software uses some sort of UI
Where should I get started with software development?
Start with an idea 🙂
I have an idea I’d like to try
Just looking to see how I’d bring it to life
Pick a UI library and start learning it. How long have you been using python for?
I coded a discord bot with python back in 2020
That’s it
My GitHub is on my profile for reference
I forgot a lot from then
I'd refamiliarize yourself with the basics of python then before jumping into learning a UI library
Sounds good
I'm trying to build a mobile app with kivy, but scaling buttons and other stuff is a bit hard. They look completely different when ran from the py file than on .APK file, well the screen is very different so it makes sense.
Just thinking how to scale them properly or do I just need to do trial and error? The build takes ~30 minutes which sucks a bit
hello all
i am looking for the tutorial for eel package , an official one . to create a desktop application using python and html css . but i cannot find any official video for that .
can you help me with this?
!e
print("Hello World!")
@wicked helm :white_check_mark: Your 3.12 eval job has completed with return code 0.
Hello World!
:incoming_envelope: :ok_hand: applied timeout to @autumn gust until <t:1711565551:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @magic pine until <t:1711578660:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
async def updater(self, interval):
while not self.quit_app:
self.update()
await asyncio.sleep(interval)
await asyncio.gather(*asyncio.all_tasks())
This wouldn't work wouldn't it?
I wanted to make my tkinter app wait for any running task to properly close before closing the app
in general im strongly in favour of using asyncio.run() for handling cleanup because of how much needs to be done, but i cant think of a way to apply that here given that one of the tasks is updating the GUI...
my recent take on this was having a fairly simple EventThread class handle the lifetime of the event loop in a separate thread which allows tkinter and asyncio to wait on separate things at once, or in other words not block each other, but hooking it up to tkinter took a bit more effort, and of course it may not be an easy change to do for your existing code
here's the gist of that design: https://gist.github.com/thegamecracks/564bd55af973827f8a05b48f197d5c09
and my recent application of it: https://github.com/thegamecracks/dum-dum-irc/blob/main/src/dumdum/client/app.py
in short, coroutines get submitted to the event loop and callbacks are used to send information/events from those coroutines back to the tkinter GUI to be acted upon
how can i add a clickable hyperlink inside of my text box (ttk)?
https://paste.pythondiscord.com/CYGQ
so... I need the loading screen to display 'instantly' upon launch and I need the mainWindow to be reactive... but I keep getting errors because I'm trying to use differnet threads.
is there a work around?
Tkinter Designer
I'm not sure how to help 😅 but I was wondering if you could send a screenshot from figma to compare
Guys did every of you had problems with learning qt for python
?
I just cant learn it
I am stuck
I am the only one or someone else had troubles with it
I really struggled with it in the start too. There's a lot to take in
How long have you been learning python for?
Two years
are you comfortable with OOP?
I think I am
Now I am making sure I am making great understand of all builded in stuff in python
But yeah I can make ui in qt designer
I really recommend not touch designer if you want to properly learn
you'll be much better off
learn how to build a basic UI from scratch
So you think that coding everything by yourself is better to understand everything
I will
Thank you
Once I will learn django and sth like fast api I want to learn qt
you should be able to learn the basics of a UI in a few days for qt (pyside)
make ui, add a layout, add a button, connect button to function
that's majority of what you'll be doing early on
once you understand that basic structure, it's not too hard
I hope it will be like you are you saying
from PySide2 import QtWidgets
class Window(QtWidgets.QDialog):
def __init__(self):
super().__init__()
layout = QtWidgets.QVBoxLayout(self)
btn = QtWidgets.QPushButton("Push Me.")
btn.clicked.connect(self.on_btn_clicked)
layout.addWidget(btn)
def on_btn_clicked(self):
print("Hello World")
app = QtWidgets.QApplication([])
win = Window()
win.show()
app.exec_()
Here's a basic window with a button
study it, learn from it
then try adding things to it, try changing things
Learn by coding or at first trying to learn it by heart
learn by doing
get to a point where you can create this very simple UI without any issue
code this twice a day until you've internalized it
So I just have to write write and once again write
:incoming_envelope: :ok_hand: applied timeout to @digital rose until <t:1711798025:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @digital rose until <t:1711923012:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
oohhh that look very nice
i will try later
Thanks for this, @sleek hollow. Is there documentation where you can see how to develop GUIs using the QT framework?
pyside and pyqt both have docs
although the original c++ qt docs are wayy better
Hi! there is someone that know well kivy and kivymd ? 🙂
r
I want to make a small app is it better to start with the ui first or coding first, also what ui designer is the best right now? so far I've only used QtDesigner
Stay far far away from qt designer
💀 why
Because you won't actually learn anything about qt. Trust me, you'll be far better off if you learn to code UI from scratch
damn ok
but we're learning it in school so i guess i have no choice
what other ui designer should i use
that's unfortunate
None, just code it
because it's not practical
wait but how do i get the app to look good
by understanding design principles
python can design apps without ui designers?
I coded this from scratch. It's not pretty by any means, but it was just a quick example
you still use PyQt or PySide, just don't use Qt Designer
Ok, so you still code it with Qt but u dont design it on the QtDesigner app itself
correct
okok thanks
once you understand basic layouts, you can visualize it and just make it
or you can mock it up in a drawing program first like photoshop, or even good ol' pen and paper
Yeah that's what I did with a homework we had, because I found it much easier than the way we were taught to. Apparently when doing it on the Designer app you need to create a layout then export it and convert it to python code to use it
so anytime its modified you need to redo the whole process
Yeah I'll do it this way to start
exactly
you can also create reusable custom widgets if you code them from scratch
for example, it can be a few steps if you want to create a button with an icon displayed on it
Create button
Create QIcon
Set icon to button
It's even more of a pain if you want to resize that icon
ok yea
or instead, you could create your own custom class that accepts an image path as an argument and handles it all for you
class ImageButton(QtWidgets.QPushButton):
def __init__(self, img_path):
super(ImageButton, self).__init__()
self.img = QtGui.QPixmap(img_path)
icon = QtGui.QPixmap(img_path)
self.setIcon(QtGui.QIcon(icon))
self.setIconSize(icon.size())
it's not super exciting, but now I can just use ImageButton whenever I want a button with an image
I have a whole file full of custom classes like this which is a huge time saver
Ok yea it seems more practical sincce you can reuse it
smart
but even if I'm only doing most of the design in python itself, should I stick to QtDesigner or something else
stay away from designer, lol
Ok so you dont even have the app
Nope
I spent like a month with designer when I first started learning qt and if anything, it set me back
ok thanks for the advice
I don't know of anyone who uses it professionally. I think it's good for people who have no intention of actually learning Qt and just want a quick UI to plug things into
humm nobody know kivy or kivymd ?
Best just to pose your issue
@tribal path Ok, well i'm using a MDDAtatable widget in kivy with checkbox for each row and then i have a MDIconButton. I want to fetch checked row with the button. But for moment i cant even print something with the button and i dont see what i'm doing wrong :/
here a bit of my kivy main.py :```python
class StationListScreen(Screen):
def init(self, **kwargs):
super(StationListScreen, self).init(**kwargs)
self.tableau = self.ids.table_liste_stations
self.tableau = ""
def on_pre_enter(self, **kwargs):
bdd = DatabaseHelper()
stations = bdd.select_stations()
tab_box = self.ids.table_liste_stations
tab_box.clear_widgets()
data = StationInfo(stations).get_station_liste()
self.tableau = MDDataTable(
use_pagination=False,
check=True,
size_hint=(.1, .5) ,
pos_hint={"center_x": .5, "center_y": .5},
column_data=[
("Station", dp(40)),
("id", dp(30)),
],
row_data=data,
)
tab_box.add_widget(self.tableau)
pass
class MainApp(MDApp):
def build(self):
self.icon = "Icon/fuel.png"
screenmanager = MDScreenManager()
screenmanager.add_widget(MenuScreen(name="menu"))
screenmanager.add_widget(AjoutScreen(name="addnewstations"))
screenmanager.add_widget(StationListScreen(name="listestations"))
return screenmanager
def return_home(self):
self.root.current = "menu"
MainApp().run()
and my kv file : ```kv
<StationListScreen>
Screen:
name : "listestations"
MDFloatLayout:
size_hint: .3 , .005
orientation:"horizontal"
MDIconButton:
icon: 'delete'
pos_hint:{"center_x":.8,"center_y":self.height-2}
MDBoxLayout:
orientation:'horizontal'
MDIconButton:
id: btn_delete
icon: 'trash'
pos_hint:{"top":3}
on_press:root.manager.get_screen("listestations").get_station_to_delete()
MDBoxLayout:
size_hint: .2 , .005
MDBoxLayout
id :table_liste_stations
padding:[1,1,1,1]
size_hint:.4,.4
pos_hint:{"top":1}
MDBoxLayout:
size_hint: .3 , .005
MDBoxLayout:
MDTopAppBar:
title: "Home"
pos_hint:{"top":1}
left_action_items: [["menu", lambda x: nav_drawer.set_state('open')]]
right_action_items: [["home", lambda x: app.return_home()]]
MDNavigationDrawer:
id: nav_drawer
MDNavigationDrawerMenu:
MDNavigationDrawerItem:
icon: 'egg'
text: "Ajout nouvelle station"
on_press:
nav_drawer.set_state('close')
root.manager.current='addnewstations'
MDNavigationDrawerItem:
icon: 'egg'
text: "Liste des stations"
on_press:
nav_drawer.set_state('close')
root.manager.current='listestations'
You are nesting a Screen within a Screen there, not sure if that's causing any issues, is the issue with station_to_delete; what happens there?
May the quote in discord made this cause in my kv file i dont see 2 screen nesting 😦
StationListScreen is a Screen, into which you have added another as a child widget @hybrid flint
hey guys, Im a beginner py dev and wanted to create a music player in python, it's got a rather slick and modern look. I did design it in figma and would like to create a functioning replica in python
from the looks of it, i think it would be rather complicated to create it using an existing library like tkinter so should i go with using css and html, ie, as a flask project
this is the ui if you're wondering
You could create this with pyqt
nothing (visually) looks too complex here. It uses a custom font, and has some image buttons
well, Ill give it a go
though can I give the image assets for individual components like the slider?
you mean because in the i define it as : class StationListScreen(Screen) , in the kv file i dont need this:```kv
<StationListScreen>
Screen:
ok so i delete the "Screen:" , but my call to the button isnt working always 😦
there's nothing really special about that slider. White track, orange circle as handle
Ok i'm a noob .... look at well at my kv file code -_-
from PySide2 import QtWidgets, QtCore, QtGui
from PySide2.QtCore import Qt
class Window(QtWidgets.QDialog):
def __init__(self):
super().__init__()
self.setWindowFlags(self.windowFlags() ^ Qt.WindowContextHelpButtonHint)
layout = QtWidgets.QVBoxLayout(self)
pal = self.palette()
pal.setColor(QtGui.QPalette.Window, Qt.black)
self.setPalette(pal)
self.slider = QtWidgets.QSlider()
self.slider.setFixedHeight(100)
self.slider.setOrientation(Qt.Horizontal)
layout.addWidget(self.slider)
slider_stylesheet = """
QSlider::groove:horizontal {
background-color: #666666;
height: 2px;
}
QSlider::handle:horizontal {
background-color: #884400;
border: 2px solid #ccaa99;
width: 18px;
margin: -10px 0;
border-radius: 9px;
}
QSlider::add-page:horizontal {
background-color: white;
}
"""
self.slider.setStyleSheet(slider_stylesheet)
self.resize(300, 60)
app = QtWidgets.QApplication([])
win = Window()
win.show()
app.exec_()
If you want to play around with it
I'm unwise at making this decision.
In terms of designing the placements of widgets, which one fits for the program?
Cooridinates or row/col (pack and grid)?
there's no universal answer, it depends on what you're trying to make
dear people that get muted in this channel: before you do so, please tell me why all of you pick this channel
File "kivy\_event.pyx", line 731, in kivy._event.EventDispatcher.dispatch
File "E:\pycharm projects\python and langchain.venv\Lib\site-packages\kivy\uix\widget.py", line 589, in on_touch_down
if child.dispatch('on_touch_down', touch):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "kivy\_event.pyx", line 731, in kivy._event.EventDispatcher.dispatch
File "E:\pycharm projects\python and langchain.venv\Lib\site-packages\kivy\uix\behaviors\button.py", line 151, in on_touch_down
self.dispatch('on_press')
File "kivy\_event.pyx", line 727, in kivy._event.EventDispatcher.dispatch
File "kivy\_event.pyx", line 1307, in kivy._event.EventObservers.dispatch
File "kivy\_event.pyx", line 1231, in kivy._event.EventObservers._dispatch
File "E:\pycharm projects\python and langchain\kivy new.py", line 40, in start_listening
with sd.InputStream(callback=callback):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\pycharm projects\python and langchain.venv\Lib\site-packages\sounddevice.py", line 1421, in init
_StreamBase.init(self, kind='input', wrap_callback='array',
File "E:\pycharm projects\python and langchain.venv\Lib\site-packages\sounddevice.py", line 898, in init
_check(_lib.Pa_OpenStream(self._ptr, iparameters, oparameters,
File "E:\pycharm projects\python and langchain.venv\Lib\site-packages\sounddevice.py", line 2745, in _check
raise PortAudioError(errormsg, err, hosterror_info)
sounddevice.PortAudioError: Error opening InputStream: Unanticipated host error [PaErrorCode -9999]: 'Undefined external error.' [MME error 1]
cant solve this problem
Hi, i solve part of my problem on kivymd mddattable ^^ now i'm trying to have a way to fetch selected row in my table. in mddatatable there is :python def on_check_press(self, instance_table, current_row): '''Called when the check box in the table row is checked.''' print(instance_table, current_row) i use it to bind a click on checkbox : python class StationListScreen(Screen): def on_pre_enter(self, **kwargs): self.tableau = MDDataTable( use_pagination=False, check=True, size_hint=(.1, .8) , pos_hint={"center_x": .5, "center_y": .5}, column_data=[ ("Station", dp(40)), ("id", dp(30)), ], row_data=data, ) tab_box.add_widget(self.tableau) self.tableau.bind(on_check_press=self.on_check_press) def on_check_press(self,instance_table,current_row): print(instance_table, current_row) problem : it take each click on the checkbox but i dont know it the row is selected or unselected. so i try to deal with the function on_check_press like that :```python
def on_check_press(self,instance_table,current_row):
'''Called when the check box in the table row is checked.'''
click = 0
if click == 0:
current_row.append(True)
self.checked.append(current_row)
click += 1
else:
current_row.append(False)
self.checked.append(current_row)
click = 0
return self.checked
i found how to do it , thanks anyway for listening ^^
oh that works thanks
Hello guys, is anyone worked with CTk, CTkTable?
i used CTkTable for show data from database, but idk, how to add scroll with vertical orientation 😦
import CTkTable
table = CTkTable.CTkTable(master=frame, row=1, column=3, text_color="blue",
font=("Roboto", 16, "bold"), wraplength=300, header_color="white")
table.grid(row=2, column=0, columnspan=1, padx=[20,10], pady=[0, 50], sticky='nsew')
yscrollbar = customtkinter.CTkScrollbar(master=frame, orientation="vertical")
yscrollbar.grid(row=2, column=1, padx=[0, 25], pady=[0,50], sticky='nse')
As a result after filling table by data i have smt like that:
I'm tried to find resolution of that problem in stackoverflow, but find only smt like add that part in CTkScrollBar()
command=table.yview
and after that add configuration like
table.configure(yscrollcommand=yscrollbar.set)
But it don't work
Error log:
AttributeError: 'CTkTable' object has no attribute 'yview'
Maybe anyone have some idea, how to resolve that problem?
ScrollBar doesn't displayed because of error
Upd: CTkTable also don't have attribute "yscrollcommand"
Oh, i just placed CTkTable in CTkScrollableFrame
I don't know why nobody noticed but that font is used by nothing mobile company
:incoming_envelope: :ok_hand: applied timeout to @remote crown until <t:1712178053:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @spring briar until <t:1712179874:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
i suspect humans will solve quantum gravity before we solve the mystery of this channel 😔
This mystery keeps me up at night
yeah xd
Can someone please help with a canvas problem im having?
I'm trying to remove everything in a canvas to then re-put stuff in, but I get this error:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\billy\AppData\Local\Programs\Python\Python312\Lib\tkinter_init_.py", line 1967, in call
return self.func(*args)
^^^^^^^^^^^^^^^^
File "C:\Users\billy\OneDrive\Desktop\testing.py", line 452, in <lambda>
button_next = Button(root, text="Next Encounter", padx=30, pady=15, command=lambda: [label.destroy(), button_next.destroy(), reset_game(), encounter_start.grid(row=2, column=0)])
^^^^^^^^^^^^
File "C:\Users\billy\OneDrive\Desktop\testing.py", line 296, in reset_game
canvas, image, background = create_initial_elements()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\billy\OneDrive\Desktop\testing.py", line 324, in create_initial_elements
canvas.create_image(0, 0, image=background, anchor=tk.NW)
File "C:\Users\billy\AppData\Local\Programs\Python\Python312\Lib\tkinter_init_.py", line 2864, in create_image
return self.create('image', args, kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\billy\AppData\Local\Programs\Python\Python312\Lib\tkinter_init.py", line 2850, in _create
return self.tk.getint(self.tk.call(
^^^^^^^^^^^^^
_tkinter.TclError: invalid command name ".!canvas"
:incoming_envelope: :ok_hand: applied timeout to @restive cairn until <t:1712222611:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
use pyside6 not pyqt
https://doc.qt.io/qtforpython-6/
I mentioned pyqt without specifying a version, since 5 and 6 are both widely used (or the pyside equivalent)
is it possible to change the line edit frame shape with pyqt5
:ok_hand: applied timeout to @high cobalt until <t:1712247937:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Change it how?
like have a custom frame shape
like what kind of shape?
:incoming_envelope: :ok_hand: applied timeout to @random rivet until <t:1712271858:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
is there such thing as a code visualizer/map? i just want something where i can create a block called "clicked" and then make a line from that to "on clicked func" so that i can more easily understand my code by creating this code map (not something automatically created by inserting pre-existing code) please @ with responses so i see
File "E:\pycharm projects\python and langchain.venv\Lib\site-packages\sounddevice.py", line 1421, in init
_StreamBase.init(self, kind='input', wrap_callback='array',
File "E:\pycharm projects\python and langchain.venv\Lib\site-packages\sounddevice.py", line 898, in init
_check(_lib.Pa_OpenStream(self._ptr, iparameters, oparameters,
File "E:\pycharm projects\python and langchain.venv\Lib\site-packages\sounddevice.py", line 2745, in _check
raise PortAudioError(errormsg, err, hosterror_info)
sounddevice.PortAudioError: Error opening InputStream: Unanticipated host error [PaErrorCode -9999]: 'Undefined external error.' [MME error 1]
can anyone help me solve this problem in py charm
?
like this
Is it possible in CustomTkinter to make a button with the left side or the button the corners straight, and the right side rounded?
Yes, you could apply a custom stylesheet
yea i managed to make it work
Using the tkinter module for python, does anyone know how to make the entry box (right) be the same size as the tree view (left). Online answers just simply dont work idk why
:incoming_envelope: :ok_hand: applied timeout to @teal root until <t:1712358673:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
hello, I'm working an app with Pyqt6 designer and I had made this gui (attached the image), but I'm not sure how manage events when someone navigate for the tabs, If someone can help me, I preciated
The background isn't white ?
Is that what you mean?
Lemme check
Bruh it's white on my screen
Unless I'm color blind
Dm'ed you
You're using ttk.Label. You need to use a style to change something like a background color and font
Well it doesn't work that way so you probably missed the fact it's tk.Label, not ttk.Label
Or just use a style and do it the modern way
Well it's possible but what is this for
I mean like what does this macro do
Why do you want it to record mouse positions
!d mouse
Hold on
Well there's the mouse package which can record and replay mouse actions
I'd recommend running the recording and replaying in its own thread, separate to the one running the GUI
It records mouse actions
Not keyboard actions
And yes
I'm starting to work on mobile app with kivy/kivyMD, I have general picture of what I'd like it to look like / to have, but where can I learn how to design that with code? It's not something I have ever done, I have never worked with any GUI apps before and it's very confusing. Any recommended resources for that / how should I approach this with in the first place?
tab widget has a signal you can connect to for when the tab changes
I'm making a clicker game for the terminal and I need a website where I can find the pixels on my screen (I want to make a certain mouse coordinate area be "clickeable"). Does anyone know a site like this?
nvm, wikipedia clutch
hello , i have a problem when i try to detect a keypress using open cv
this works: ```while True:
screen, rect = capture_screen(window_title)
key = cv2.waitKey(1)
if key == ord('t'):
print("The 't' key is pressed")
elif key==ord('r'):
cv2.destroyAllWindows()
elif key == ord('q'):
break
diagonal_line_screen = draw_diagonal_line(screen)
cv2.imshow("Modified Screen", diagonal_line_screen)
cv2.destroyAllWindows()``` but this doesnt: ```while true:
key = cv2.waitKey(1)
if key == ord('t'):
print("The 't' key is pressed")
screen, rect = capture_screen(window_title)
diagonal_line_screen = draw_diagonal_line(screen)
cv2.imshow("Modified Screen", diagonal_line_screen)
elif key==ord('r'):
cv2.destroyAllWindows()
elif key == ord('q'):
break
cv2.destroyAllWindows()```
when i try to make it so the image would apear when i press "t" it just doesnt work
while True:
print(drawn)
key = cv2.waitKey(1)
if key == ord('t') and not drawn:
print("key t pressed")
screen, rect = capture_screen(window_title)
if screen is not None:
screen_with_diagonal = draw_diagonal_line(screen)
cv2.imshow("Modified Screen", screen_with_diagonal)
drawn = True
elif key == ord('r') and drawn:
cv2.destroyAllWindows()
drawn = False
elif key == ord('q'):
break
cv2.destroyAllWindows()```this one is also broken for some reason
it just doesnt detect the key presses
doesnt fingerprint in samsung s24 need sensor?
nvm fixed
@gilded basalt https://canary.discord.com/channels/267624335836053506/1226332240208986192
you probably want to disable your text widget so it cant be edited:
https://tkdocs.com/tutorial/text.html#basics
To prevent users from changing a text widget, set the
stateconfiguration option todisabled. Re-enable editing by setting this option back tonormal.
(although there seems to be a note mentioning that you have to re-enable it before you can make further changes to the text)
oh derp, i misread your question
I wanted to enable a specific line and have the rest disabled. But it's OK because I solved it. I just disabled the keyboard if it's on the wrong line
huh, im curious, how did you disable the keyboard?
whenever a key is pressed, its position gets checked. If it's position is wrong: return "break". This prevents the key from doing it's action
I can show you the code if that helps. I'm not usually good at explaining
like you have a tag covering the entirety of the text, and a binding to determine if the insert mark is in the right place?
how do I do the thing where I can put text into python so I can show you better
!code
current_row = math.floor(float(text_box.index("insert"))) # checks the position of the "insert" cursor (whatever the | line is called when you're typing) and only takes the integer part, which designates the row
def input_checker(event):
if math.floor(float(text_box.index("insert"))) == current_row:
# do normal text stuff
else:
return "break"
text_box.bind("<Key>", input_checker)
If you would like more understanding, I can send the entire function it is in
ah i get it now, TIL bind can interrupt built-in bindings
https://tcl.tk/man/tcl8.6/TkCmd/bind.htm#M55
well kind of, given the rules in the link im not too sure why the custom binding gets called before the built-in insert binding
All I know is that it works and I'm happy because I was working on this one problem for over 2 hours
oh wait, the built-in one is probably a class binding so it can be the same between text widgets
indeed
:incoming_envelope: :ok_hand: applied timeout to @spare perch until <t:1712696317:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
absolutely
is my code lookin good? https://paste.pythondiscord.com/UFBQ
Is there any framework for python where I can make a JS front-end for a desktop app?
And not a "fake a server" approach.
What is the best module for making UI's?
Looks pretty good
Depends on your goals and your current level of python
I'm an intermediate and I want to try something that can handle adding stuff onto the gui, something like a password saver but instead of passwords it saves discord friend ID's and they're profile information
Kinda like a backup discord tool
How comfortable are you with OOP?
Never heard of it
then I would say you are definitely not intermediate
ok
tkinter would be an ok place to start for GUI then, it's quite beginner friendly
.rp tkinter gui
Here are the top 5 results:
Check out that first link
!pip pywebview
self.rl = qtw.QPushButton("Rocket League", self.fenetrePrincipale)
self.rl.show()
self.rl.setFixedSize(220, 75)
self.rl.move(850, 304)
self.rl.setStyleSheet("""background-color:white;
border-radius: 7px;""")
``` how to make an animation when this button is hover ? i would like his size growth while 1 seconde
use pseudo selector (possibly :hover but check docs) with transition and scale properties in your css (the string passed to setStyleSheet).
hello
anybody have an idea on how to add a image as a background on the window itself?
- do I have to do something about its size ?
hey is there any way to integrate gemini and google lens?
Hi all! Any video/playlist tutorial recommendations for starting with modern tkinter? (preferably including practice exercises / problems)
Please ping me whe replying
i havent looked around that much for tkinter resources, but TkDocs + Tcl/Tk Reference + vscode autocompletion gave me a decent understanding of its fundamentals, though it doesn't cover much about code organization, like applying inheritance/composition
what is tkinter Text() default wrap?
The tkinter package is an interface for the Tcl/Tk GUI toolkit. So I think there is no default value defined in this python package.
The tkdocs say that "It defaults to char, meaning wrap lines at any character. "
https://tkdocs.com/tutorial/text.html
hello I am in the process of making a web app with streamlit and I have a problem with the kepler.gl library I cannot configure the zoom however I followed the official doc is there anyone who can help me?
Hi! I'm creating a desktop python app with using customtkinter a tkinter's wrapper. I've created a Card component which contains an image, a title, a subtitle and a button which I want that appears only when the mouse's cursor hovers the Card frame.
This is my code: https://paste.pythondiscord.com/3JIA
The problem now is that when I hover the frame the button is correctly shown but if I hover the button in itself it flashes. How can I solve it?
How can i load the home.kv file for HomeScreen with given code:
# home.py
class HomeScreen(Screen):
name = "home"
# main.py
class MainApp(MDApp):
def build(self):
self.theme_cls.primary_palette = "Teal"
sm = ScreenManager()
sm.add_widget(HomeScreen())
return sm
UPDATE:
i managed to load the home.kv file by adding builder.load_file("home.kv") below the line of declaration of sm.
I am using #:include home_topbar.kv in home.kv to include the child components.
But it don't seems to work properly. my file_path for include are correct as they did not threw any exceptions.
Hey guys, I've an issue with PyQt5.
I'm doing an interface to generate config files.
I have a QTextEdit where the user can change the value, but it seems that when the user change it and after that click on the generate button, the value is not update
I print the value of the QTextEdit when the user write into it, and it's fine, the value is correct.
It's just when the user click on the button that the value is not updated
code
hello guys. is it possible to only display the arrow icon of an OptionMenu/ComboBox with customtkinter/tkinter and still work as a dropdown?
imma change my interface with a lobotomy
Hello guys, when i put the following code into my program it stops working
hdc = win32gui.GetDC(0)
# Set text color and background color
text_color = win32api.RGB(255, 0, 0) # Text Color
bg_color = win32api.RGB(0, 0, 0) # Background Color
# Create font
lf = win32gui.LOGFONT() #Establish Font
lf.lfHeight = -20 #Font Size
lf.lfFaceName = "Arial" #Font Type
font = win32gui.CreateFontIndirect(lf) #Finalize Font
# Select font
old_font = win32gui.SelectObject(hdc, font)
# Set text color and background color
win32gui.SetTextColor(hdc, text_color) #Setting the text color
win32gui.SetBkColor(hdc, bg_color) # Setting the background color
# Draw text
win32gui.ExtTextOut(hdc, x, y, win32con.ETO_CLIPPED, None, text) #Display the Text
# Clean up
win32gui.SelectObject(hdc, old_font)
win32gui.DeleteObject(font)
win32gui.ReleaseDC(0, hdc)
# Define text content and position
text_content = "Hello, World!"
screen_width = win32api.GetSystemMetrics(win32con.SM_CXSCREEN)
text_width = len(text_content) * 10 # assuming each character width is approximately 10 pixels
text_x = screen_width - text_width - 10 # 10 pixels margin from the right
text_y = 10 # 10 pixels from the top
# Main loop to continuously display text
while True:
display_text(text_content, text_x, text_y)```
When i put this into my code it works and Hello, World! pops up in top right but the actual cmd doesnt load and just stays blannk and doesnt load the actual program if someone could help would mean a lot thanks ❤️
It sounds like the issue might be related to the fact that the script is continuously running the display_text() function in an infinite loop without allowing the main program to proceed. This could prevent the cmd window from properly displaying the rest of the program.
does this help ?
import threading
import win32gui
import win32con
import win32api
import time
def display_text(text, x, y):
hdc = win32gui.GetDC(0)
text_color = win32api.RGB(255, 0, 0)
bg_color = win32api.RGB(0, 0, 0)
lf = win32gui.LOGFONT()
lf.lfHeight = -20
lf.lfFaceName = "Arial"
font = win32gui.CreateFontIndirect(lf)
old_font = win32gui.SelectObject(hdc, font)
win32gui.SetTextColor(hdc, text_color)
win32gui.SetBkColor(hdc, bg_color)
win32gui.ExtTextOut(hdc, x, y, win32con.ETO_CLIPPED, None, text)
win32gui.SelectObject(hdc, old_font)
win32gui.DeleteObject(font)
win32gui.ReleaseDC(0, hdc)
def display_text_thread():
text_content = "Hello, World!"
screen_width = win32api.GetSystemMetrics(win32con.SM_CXSCREEN)
text_width = len(text_content) * 10
text_x = screen_width - text_width - 10
text_y = 10
while True:
display_text(text_content, text_x, text_y)
time.sleep(0.1) # Add a small delay to reduce CPU usage
# Start the display_text_thread in a separate thread
display_thread = threading.Thread(target=display_text_thread)
display_thread.start()
# Main program continues running here
# Add your main program logic below```
Are there still problems?
this code alone shouldn't work at all. where are you creating the window, setting the window proc?
:incoming_envelope: :ok_hand: applied timeout to @sturdy patio until <t:1713610195:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
For tkinter, does frame class have anything similar to update method so I can override in subclass?
If not how can I make something similar?
I'm in a very bad situation my problem is about 2 detection functions
One is ai object detection and second is voice detection or recognition
The problem here is we got the object detection running but the voice recognition isn't working
I tried using threads but didn't really work im in a very tight deadline if any help possible
And if this topic isn't for this channel please let me know
Hey yes I fixed it thanks tho
how can i change the values of a CTkComboBox (im usign the customtkinter module) ? i tried just doing combobox["values"]=['option1','option2'] but it just wouldn't work.
:incoming_envelope: :ok_hand: applied timeout to @drowsy ore until <t:1713641460:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @digital rose until <t:1713646762:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
hi
Just realized PyQtGraph 0.13.5, if you use PyQtGraph, and especially if you use PyQtGraph's QApplication instantiation method (pg.mkQApp()) and use light/dark mode, please upgrade quickly and let me know in the #pyqtgraph channel if it's working as expected still.
Not sure what the etiquette for posting links to our GitHub and I didn't want to spam multiple channels. I made a PerlTK script and have been using it for 12+ years almost daily. I learned Python this year and have been spending the last month or so translating the functions over to a Python TK script.
https://github.com/HuskyCougar/abc.tk.py
One thing I could do in Perl but have not been able to figure out in Python is scoping variables outside the current script. Perl's "our" scope allowed me to build my Tk window in my main script and then import domain-specific menus and functions that would add to the base functions.
One assumption is that i would need to convert my MainWindow over to a class and then import functions that would modify my original MainWindow.
Like I said though, I am still a Python n00b and only build Python scripts if someone specifically asks for a notebook or I expect someone else ((most likely younger than a certain age 🙂 )) to have to make modifications to them in the future.
Is there any way to make it so that the Qt window can resize itself, but the user can't resize the window or full screen it? Just leave all the resizing capability solely to the Window
hi
how do i get an underline for the text in my widget (button specifically) for my tkinter app?
put 'underline' in the font
@ebon mango
i'm using ttk so font isn't an option, how can i get around this?
dont use ttk
use button = Button()
@ebon mango
I think some underline is already a thing for button widgets, but anyway you can configure the font via the widget's style
:incoming_envelope: :ok_hand: applied timeout to @digital rose until <t:1713882107:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
i want to use ttk - i like the style better and as @mighty rock pointed out - ill just configure with the widget style. thanks yall
:incoming_envelope: :ok_hand: applied timeout to @twilit sequoia until <t:1713895922:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @digital rose until <t:1713957054:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
i'm having trouble with tkinter binds as i use a mvc model
:incoming_envelope: :ok_hand: applied timeout to @digital rose until <t:1713987670:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
tkinter isn't architectured in a way that is clean mvc. i don't recommend following any strict rigid pattern with it.
anyone got other libraries that look better than tkinter
Yes. tkinter.ttk
custom tkinter
It’s just ‘import customtkinter’ ?
but you hav3e to install it
py -m pip install customtkinter
Alright thanks
there's also ttkbootstrap if you still want to stay around tkinter
https://ttkbootstrap.readthedocs.io/
why this channel is one of the most unactive of this 400k server
I dont truthly understand
Maybe making user interface in python is easy
And people just dont need help with it
Like I was learning PyQt6 for like two weeks and now I feel like fish in water
And a lot of people say that PyQt is hard but its not true at all
You just have to write code
And just enjoy it
Thats all
True, you can see everything you've done on your UI, it's easier to code and debug completely visualized objects
At least I think so
I feel the same way as you
Hi
Hello
HELLO
:incoming_envelope: :ok_hand: applied timeout to @undone goblet until <t:1714254117:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
ew cringe anime pfp
I'd like to ask what GUI framework can handle my python scripts, the first one uses mediapipe, opencv and keras. The second one uses panda3d engine to display 3d animations based on user input. Im a newbie so I dont know a lot of things, I would like these scripts to be integrated to the GUI framework, and package the framework into windows, android and ios. TIA
anime best stuff ever existed
world!
but that image literally pops up when you look up anime girl pfp
i used it when i was 11
like 5 years ago
My region is in Taiwan, I don't see that in anime girl pfp
and she is Menhera, a real illustrator in Japan which have the girl in my icon as her avatar
You should look her up! Her drawings are cute. She even made a mobile game!
I dont think you can make videogames with tkinker
Games you can do in panda3d or in pygame or pygame zero
If you want to stick with python
Hi ! does somebody already use the kivymd MDDatepicker ?
Kivy may work here, with the panda3d-kivy addon@tepid hedge
I just wrote 1000 lines of tkinter with the place manager, and found out that I can do that in 300 lines with grid manager
I'm dying
panda3d-kivy addon would would integrate kivy to panda3d right? What I want is the other way around, build UI in kivy or other framework then add the panda3d on home page or such. I don't know much about the addon, but it would use kivy inside panda3d window right? If these are not possible, would it better to make it a web app instead? but I have no idea with web app dev. Idk how to integrate my scripts on web.
You can also think about making an button which opens a game window
anyone ?
I've not used the add-on myself, mostly as not needed to use panda3d; but do know the maintainer.
But yea the add-on as I understand it, just ensures that they are using the same window as a way to use both libraries.
cause i want to make a month selector with this module but i dont found in the documentation how to do it:(
What's the issue? The kivyMD pickers would be for a whole date; hence the name. For just a month selector you'd need to modify the MD widgets and/or write your own with kivy widgets
ah :/ there is no propertys to change to just make a month selector damn
its because i want to display month data so i want to make just a month selector. But may i'll need to just make a dropdown menu with the month
and how i modify an MDwidget ?
Well MD widgets are just collections of kivy widgets - possibly you might get away with removing widgets from a Picker to leave what you want, but most likely there'll be much more going on... I'll just check the source on that
thanks
I centered a div @terse gull and @umbral root

In 2 prints! And those prints won't erase whatever was behind! Maybe this isn't the best example
I'll get better ones tomorrow when I hook this up to my game engine
But it's a window!
hi
Hello
NO WAY
He knows how to center a div
You are a master
Senior dev
I have no idea how hard this is, so I'm ignorantly astonished
My first thought was I had a picture of these videos on yt in which someones is searching on google how to center div in html
Actually, the way I did this might be a little complicated, but it is pretty satisfying
Here, the list is rendered before the box!
Oh god this is not just any list, I just noticed, I programmed a vertical layout
I'm scawwed of sharing the github, but well, yeah, it is.
It's on the same repo as my rpg game-- I'm making this to have some sort of rendering engine for my text-based rpg
Once I have some content on it, I'll add it to itch with a name your own price of 0
As an executable rather than the source
It kinda is... but not really in the grand scheme of things
just the source code for the "renderer" is 470 lines
But after the renderer is written, setting stuff up for render is pretty easy.
def test():
master_widget = MasterWidget()
list_widget = VerticalLayoutWidget(spacing=0)
list_widget.width = 30
list_widget.height = 30
for i in range(20):
text = TextBox(f"List item {i} {"*"*(i)}", RenderColor(GameColor(math.floor(i*255/20), math.floor(i*255/20), 0)))
text.attach_to_parent(list_widget)
list_widget.attach_to_parent(master_widget)
textbox_widget = DecoratedTextBox(
"Hello\n there,\n mr kenobi guardian of the\n galaxyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
BoxTexture(
"/-\\| |\\-/",
[
RenderColor(GameColor(255, 0, 0)),
RenderColor(None, GameColor(0, 100, 0)),
],
),
)
textbox_widget.set_height(13)
textbox_widget.set_width(13)
textbox_widget.attach_to_parent(master_widget)
textbox_widget.set_horizontal_alignment(HorizontalAlignment.Center)
textbox_widget.set_vertical_alignment(VerticalAlignment.Center)
list_widget.set_horizontal_alignment(HorizontalAlignment.Center)
master_widget.render()
I'm unsure whether I should bind input or animations with the widgets...
oh wow there are no rules about the kinds of files sent other than discord's community guidelines? interesting
If I (or anyone) ever shares a file here, remember that it could be (very) harmful to your computer (and by extension, you).
I might share an exec here if I feel comfortable
from calculations import Cal
from settings import *
import tkinter as tk
#Gui:
class App(tk.Tk):
def __init__(self) -> None:
super().__init__()
#Setup Window:
self.geometry(WINDOW_SIZE)
self.title(WINDOW_TITLE)
self.resizable(0, 0)
self.iconbitmap(ICO_FILE)
#Setup Rows and Collumns
self.columnconfigure(0, weight=1)
#Call Functions
self.__widgets__()
def __widgets__(self):
Title: tk.Label = tk.Label(self, text=WINDOW_TITLE, font=(0, 15))
Title.grid(column=0, row=0, sticky=tk.W, padx=PADDING, pady=PADDING)
if __name__ == "__main__":
app = App()
app.mainloop()``` lookin good so far
Is it possible to display images inside a CMD console?
Not unless you draw them as ascii art
Alright thank you
:incoming_envelope: :ok_hand: applied timeout to @quick venture until <t:1714585160:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
actually yes there is a way
depends on the console
Just a usual terminal
there is also a thing called ueber~~ forgot its name ._.
brb

pretty hard to install though and need a bit of work to get it running
anyone wanna test this out and check if the line numbering is working and that when you spam enter a lot that it is not stuttering
hi
i have some problems with pyqt can anyone help
its a very weird issue that i dont see why is occurring
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(800, 642)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.chatwindow = QtWidgets.QPlainTextEdit(parent=self.centralwidget)
self.chatwindow.setGeometry(QtCore.QRect(0, 0, 651, 541))
self.chatwindow.setObjectName("chatwindow")
# lock chat window
self.chatwindow.setReadOnly(True)
this is the code i have in pyqt5
its only a snippet
under a class Ui_MainWindow
and i have a separate function inside the same class where im trying to access self.chatwindow
but an error shows up telling no attribute
ik the scope but still vscode shows me recommendations while coding
is there any fix to this or any alternative to access them out of scope coz even global doesnt seem to work
can you share your full code using a pastelink?
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
its very huge
i can only show the two functions because thats where im facing the issues
def sendmessage(self):
self.chatwindow.setReadOnly(False)
# append new text to chat window
self.chatwindow.appendPlainText(finaltext)
self.chatwindow.setReadOnly(True)
self.input.clear()
this is a snippet of the other function i am talking about
where do you call this? Where do you call setupUI?
well its the part of a class Ui_MainWindow in pyqt5 so it doesnt need to be called separately
W
basically all functions in the class run on their own without separate calling but the problem is i need to access some elements from setupui in other function
under the same class
can you share that class?
why would you assume it calls things automatically?
do you see your UI actually show up?
because you're likely trying to call sendmessage before setupUI
no its after setupui
alright i kind of fixed it now i was missing something in the arguments
thank you but i still had another doubt
how to call these funcs while threading inside a class
are you using QThread for the threading?
hi everyone,
i'm going to be working on building some custom software this summer, and i'd like to know more about the front end. i need the capacity to make really high quality custom graphics, say something that came out of like unity or unreal, and i need the user to be able to import files of specific types into the software for display. if anyone could offer a very basic overview of how to make this happen, i'd be much appreciative. i know how i'm going to make the backend work and which files but i don't know how to applicationize everything
Can I ask why not just use unity or unreal?
Maybe that is what I need to do
But I need to operationalize custom algorithms within it to manipulate the input files
how do those programs work, do you get to write code inside of them to operationalize stuff?
i'm sure there is already a lot of stuff under the hood like the code for physics et cetera
:incoming_envelope: :ok_hand: applied timeout to @craggy sedge until <t:1714671642:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Hey guys, I'm trying to figure out how to download a video by submitting a url with flask, I tried used a url for action in the html form but it doesn't download any file or do anything and it instead takes the website to another page that doesn't work at all. Any help would be appreciated.
That's quite vague but if you need to display graphics, that's probably your best bet
@tight aurora have a second look at which canvas you are using... Refering to
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
LOL
tysm lmao
i hate those small errors mann
@digital rose this WrapLabel widget i wrote up might be enough for your use case, and theoretically should work as a drop-in replacement without needing to specially handle them from your container frame:
https://gist.github.com/thegamecracks/5595dad631ec50bdc021f945054e86fb
TKinter prblem here:
Why the displayed font size will jump from 14 straigt to 20, when I try giving it 14-20
Hi ,
I m trying to run a python program which has an GUI build using QT
but im getting the following errors , can someone help me.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/bin/puzzle15ai", line 8, in <module>
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/puzzle15ai/main_window.py", line 108, in main
main_window = MainWindow()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/puzzle15ai/main_window.py", line 42, in __init__
self.ui.setupUi(self)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/puzzle15ai/ui_mainwindow.py", line 28, in setupUi
self.centralwidget = QWidget(MainWindow)
TypeError: 'PySide6.QtWidgets.QWidget.__init__' called with wrong argument types:
PySide6.QtWidgets.QWidget.__init__(MainWindow)
Supported signatures:
PySide6.QtWidgets.QWidget.__init__(Optional[PySide6.QtWidgets.QWidget] = None, PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags))
is anyone familiar with tkinter
I know stuff about it, I can try to help
but what do you want to ask
open questions like this won't lead anyone anywhere
import tkinter as tk
from pyautogui import size
from tkextrafont import Font
import tksvg
Get screen size
wnx, wny = size()
Create Tkinter window
wn = tk.Tk()
wn.title("Untitled game")
wn.geometry(f"{wnx}x{wny}")
wn.configure(background="black")
Use the Font class
font = Font(family="Akrobat-ExtraBold", size=45)
Replace the image path with your SVG file path
photo = tksvg.SvgImage(file="frog.svg")
Create frame1
frame1 = tk.Frame(wn, bg="brown", width=100000000000920, height=wny - 900)
frame1.pack(anchor=tk.NW, expand=True) # Position the frame using grid
Configure frame1
frame1.columnconfigure((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), weight=1)
frame1.rowconfigure((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), weight=1)
Create label and label1 within frame1
label = tk.Label(frame1, bg="black", image=photo)
label.grid(row=0, column=0) # Position the label within the frame using grid
label1 = tk.Label(frame1, text="Froggy", bg="black", fg="white", font=font)
label1.grid(row=0, column=1) # Position label1 using grid
Create frame
frame = tk.Button(wn, bg="brown", width=1, height=1)
frame.pack(side=tk.TOP) # Position the frame at the top of the window
wn.mainloop()
frame is at the bottom i dont know why
you mean the last frame is at the bottom?
the btn called frame is at the bottom
Heya, can someone tell me which UI framework to use which can be easy to use and design which I can then integrate with python. I'm looking to create something like a movie ticket booking system for a multiplex (displaying like seat layout, movie posters etc).
Is django ideal for this?
django is specific to web. If you want a python UI, use PySide or tkinter
Is there any mini project/tutorial I can refer. I never really worked on any UI framework, am not really sure how to implement a seat layout
PySide is Qt ri8?
Yes
Is the seat layout just a basic grid?
This will quite a large undertaking if this is your first time working with UI
Seating like a movie theatre like the top row would have more seats, so not really a basic grid
I'm okay with that
as long as you have some sort of 2d list of how many seats are in each row, it wouldn't be too hard to replicate
You would ideally create some sort of widget to represent 1 seat
Yes it's 2d
then create a layout to hold a row of seats
then iterate the rows and create the required num of seats per row
Is there something like QtLayout?
There's QVBoxLayout for Vertical and QHBoxLayout for Horizontal
BTW is there any resource for beginners for UI development?
Start building Python GUIs with PySide2. A step-by-step guide to creating your first window application, perfect for beginners looking to explore PySide2 development. Following this simple outline you can start building the rest of your app. In this tutorial we'll learn how to use PySide to create desktop applications with Python.
Not framework specific, but something that helps to get the gist of it
This site is a great resource
every GUI is going to have its own specific quirks
Thanks a lot, I will check that out
good design applies to any GUI, but the way of achieving it will vary from each library
you could as well, but I think it would be more of a struggle
tkinter is quicker to learn the basics of, but implementing any sort of complexity gets real frustrating, real quick
pyqt/pyside has a bit of a steeper learning curve for sure
but it's far more robust
I could build a decent basic seating chart in pyqt in roughly 30-40 min
but tkinter it would probably take me much longer
Is processing ideal for creating a UI?
not quite sure what you mean by that?
Processing is a flexible software sketchbook and a language for learning how to code. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology…
No clue what this is
@wet marsh I can show you a basic setup for the seating chart if you like
I took this data and created a layout with it
row_data = [5, 5, 7, 7, 8, 8, 8, 8, 9, 9, 9]
Thanks
What about something like this? Is it too complex?
not at all
with some minor tweaks
selectable seats
building UI is all about implementing one thing at a time
build small pieces, and then put them together
Thanks a lot
Can I use PySide6? There's the same tutorial with PySide6, is using Qt 6 okay?
Yes, you shouldn't run into any major issues
PySide2 is Qt5 so it's not that far behind
:incoming_envelope: :ok_hand: applied timeout to @thorn wyvern until <t:1715009722:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
https://www.pythonguis.com/tutorials/pyqt6 you can also check this out
I was learning with it
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.button_is_checked = True # <1>
self.setWindowTitle("My App")
button = QPushButton("Press Me!")
button.setCheckable(True)
button.clicked.connect(self.the_button_was_toggled)
button.setChecked(self.button_is_checked) # <2>
# Set the central widget of the Window.
self.setCentralWidget(button)
def the_button_was_toggled(self, checked):
self.button_is_checked = checked # <3>
print(self.button_is_checked)```
Can someone explain why do I need to use ``setChecked`` after the ``clicked`` signal? I'm a little confused
Its used in that case but you dont have to write code in the same exact way
You just dont have to use it
but I will explain
what this code does
When you click the button it opens this function and sets button_is_checked on user input and prints out that this button is checked and set_checked sets button on checked or not checked
do you understand or not
if you dont understand I can try to explain it better in other ways
^ i dont have much experience with PyQt so i cant say
i mean i struggled to get into it in my last couple of attempts, but i only spent a few hours or so
and i felt the tutorials in Qt for Python i didnt really cover the fundamentals i wanted to know like layouts, but perhaps it would have gone better if i had followed Python GUIs instead
trying to add a password view change into qtdesisgner/ pyqt, but the screen crashes every time i run it... here's the relevant code. commenting out this code loads fine, but it's just the view password button that makes it crash?
pwd is the QLineEdit,
pwdViewBtn, QPushButton for viewing/ hiding password
I bounced off it a few times as well in the start. It eventually just started clicking. I went and rebuilt a lot of UIs I had built already with another library. That gave me a pretty clear goal to work towards which helped a lot
Not really enough info here to know why it's crashing, but also both your conditions are setting the echo mode to the same result. The else should be EchoMode.Password
You want to connect to a method, thus self.pwdView I assume would not crash... Perhaps with *args if the connect passes an object there too
I was confused regarding how the event handler works exactly, that's all
are you still unsure?
Yeah thats my question too
I dont know if I help you
Or maybe someone other should explain it for you
just a theoretical question. i'm gonna make accessible paint app which will use palette names and keyboard to color (pixelart-focused) which will be integrated with builtin tile and map editor (tiled can say but with less options, also keyboard focused) .
is it better to make it multiple-window or with a back/forward arrow at top (single-window) ?
and how to achieve this in tkinter? (it's the only one i've been using but not for multiple-screen apps, once was looking at pygame but it's totally not me…)
multi window is very 1990. use a single window and switch between multiple Frames
ig multiwindow maybe 2005 but shit uxwise anyways
ok, thx
:incoming_envelope: :ok_hand: applied timeout to @broken hatch until <t:1715124807:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
what's with this channel?
AFAIK we have no idea, and are happy for any clues
Bots tend to spam in a fixed order based on our channel IDs. It's when it reaches this channel that our own bot tends to catch it and ban them.
That's a pretty consistent bot!
bot gets the "visual" around here ig
I have a question regarding the architecture of my code. I am using pyqt6 to create gui’s and I have a use case where I need to reform my UI multiple times so I need to remove widgets and attach new widgets until the end of the use case. Should I set all the widgets that I use (button, labels, qlineedits and etc) at my init function or should I set the widget when the function is triggered to go to the state? What would you do, what is better?
we'd really need more specifics to suggest the best possible solution
Hi^^ I am currently stuck in one of my projects: I am writing a digital Character Sheet for a Pen and Paper Game using PyQT6 and Pyside 6.
I am trying to add a QFrame that in itself again contains layouts to another layout . I want to try and not use fixed heights but unless I give the Frame either a FixedHeight or MinimumHeight it doesn't show. Is there a trick with nested layouts and size that I am not aware of?
I am trying to make the entire app responsive since I want to package it for android (on tablet)
Frames will only resize to the size of its contents. You can change its size policy to force it to take up more space
Minimum and MinimumExpanding work best
alternative in what sense? in the sense that its builtin - no, i think its the only builtin ui lib
in the sense of like, ui libraries in general - yeah, there are a bunch, dearimgui, pyqt / pyside, raylib bindings maybe?, just search on pypi / github
:incoming_envelope: :ok_hand: applied timeout to @uncut swan until <t:1715463331:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @digital rose until <t:1715496427:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @storm fiber until <t:1715508501:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Hello, super new to PyQt and I'm trying to get something working with Whisper and I think I'm approaching it wrong. Can't find much help online so assuming it may not be possible.
I'm trying to get the percentage value from a Whisper transcription and pass it through to a progress bar widget. Thought this would be fairly straightforward as I can see the percentage in the console, and print it through its update, but I can't figure out how to pass that value through to my progress bar
so you do have a way to access that value and save it in a variable?
So here's what I have:
class _CustomProgressBar(tqdm.tqdm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._current = self.n # Set the initial value
def update(self, n):
super().update(n)
self._current += n
# Handle progress here
print("Progress: " + str(self._current) + "/" + str(self.total))
from here: https://github.com/openai/whisper/discussions/850#discussioncomment-5443424
which seems to give a bit more access to the actual progress of transcription. But I have tried setting the value in the print to a global variable and get an undefined error elsewhere in the script
what is tqdm?
I know how to set up a QProgressBar, I just don't know what module you're using here but if you can get the value, the QProgressBar isn't too bad to set up
what did you try doing to access/set your global variable?
https://github.com/openai/whisper/blob/v20231117/whisper/transcribe.py#L228-L230
seems like a pretty hacky workaround having to monkeypatch the tqdm function, but their function doesn't provide any callback to track progress...
whisper/transcribe.py lines 228 to 230
with tqdm.tqdm(
total=content_frames, unit="frames", disable=verbose is not False
) as pbar:```
:incoming_envelope: :ok_hand: applied timeout to @digital rose until <t:1715529162:f> (10 minutes) (reason: emoji spam - sent 24 emojis).
The <@&831776746206265384> have been alerted for review.
this is the difficulty i'm hitting, and i think there is something with how it executes the transcription that makes me unable to track it from other functions
but literally on day 2 of messing with this so very likely missing something
percentage = int((self._current / self.total) * 100)
calculating percentage like this, had tried assigning it as global percentage but was getting undefined errors.
i have another function handling the audio transcription and text file generation, but because this line:
result = whisper.transcribe(model, audio, language="en", compression_ratio_threshold=1)
seems to handle the entire transcription loop I can't access the percentage value while its running, I think
i imagine its further complicated by the fact that transcribe() is a blocking function so it cant run in the same thread as your GUI (unless you don't mind it being frozen)
ahhh
qt has their own QThread class iirc, not familiar with how to use it though
I might just have to abandon, its only a small thing but would really like to get it in at some stage
trying to base my ui off Shutter Encoder if you know it, there's a progress bar in there and I thought it was slick 
https://realpython.com/python-pyqt-qthread/#using-qthread-vs-pythons-threading
hmm, i guess in theory you might use a QThread to run the transcribe function, then in your custom progress's update() method you'd send off the value to your GUI via a signal, and have your progress bar hooked up to that
That looks super useful, I guess half the problem I'm having is that the transcription itself needs to be on another thread
emit signals from there
I think my file structure might be a bit off as well
:incoming_envelope: :ok_hand: applied timeout to @uneven sierra until <t:1715548689:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Thank you, that made things better, I am still having issues with some of the labels needing a height, but I guess I have to see where I missed something^^
QLabel inherits from QFrame so they behave pretty much the same (just that labels display text as well)
trying to use PyQt6 and im having trouble reading the package, not much detail in the functions. was wondering if anyone knew how i can get an audio file like .wav to work in it?
# No QtMultimedia backends found. Only QMediaDevices, QAudioDevice, QSoundEffect, QAudioSink, and QAudioSource are available.
# Failed to initialize QMediaPlayer "Not available"
class SoundPlayer:
def __init__(self):
self.splayer = QSoundEffect() # in case i need to use sound effect instead...
self.mplayer = QMediaPlayer()
# Set the audio device for QAudioOutput
self.audio_output = QAudioOutput()
self.audio_output.setVolume(100)
def play_media_effect(self, media_file):
self.mplayer.setSource(QUrl.fromLocalFile(media_file))
self.mplayer.setAudioOutput(self.audio_output)
self.mplayer.play()
What gui library should i use cuz i am confused a lil
Depends really on a few factors. What are you trying to make? How long have you used Python for? Do you have any experience with GUI
I made some apps with customtkinter and i've been developing in python prob for a year now, im trying to make modern looking apps and try something other that ctk
I'd say give PySide6 a try then. It's by far the most robust UI you can use with python
What abt pyqt6?
I'd recommend learning classes then. Learning pyside is actually what really made classes click for me
Classes are giving me java flashbacks
Could we make a windows application and make a UI within it? How would we do that?
yes, we can do so, for that we need a ui framework, talking about python we have tkinter for very simple to pyside/pyqt for more advance ui then you can compile your python application into exe using pyinstaller, and if you want to distribute it on windows you can use Setup Creation tools like Inno Setup Creator and make installers for you windows application
pyqt is the best solution
pyqt is flexible to use. you can build ui with qt designer and use it in you python project.
Just build the app with pyinstaller and copy the ui files in the dist folder
ig you need to install a PyQt6 addon package
I've noticed my destroyed signals aren't getting to their slots if the slot is on a bound method after I updated PySide6 (I assume it worked before as I ran into an error I don't remember), is this expected? partial(cls.method, self) works as a workaround though not sure how I feel about it in the long run
Anybody use tkintermapview here?
Is there a Python desktop GUI framework that natively supports markdown or rich text?
If I make an image, is there a way to make a gui that shape with pyqt?
it works sometimes, othertimes it doesn't. the package details for pyqt are much less descriptive and referring to the docs is confusing when comparing this to dpy representation. i just really dunno what i'm doing w/ it. I got a basic app to work for a timer, etc. but getting the sound to play just errors w/ mp3 and then sometimes plays w/ wav files
what kind of shape are we talking about?
:x: failed to apply.
you can make your window to be any shape on all platforms afaik. definitely on windows, even the win32 api supports it
Hi, i am using to a homework in college, can you help me recommending something for back end? I am stuck in this part
soo, i have an image as background in ctk and it cuts my frame corners (kinda), is there any way to fix this?
are there tutorials or repo examples for windows? I wanna make a custom shape like some games did for launchers, a circle and triangle just for practice. I'm assuming i'll have to use images to make these?
You can't literally shape the window, but you can instead use any image with transparency as your window
I'm not sure if this is the right channel to ask this, but I'm trying to make an app on my PC which is python based just for personal modding
Is there an ideal way to have a windows app icon that can boot scripts?
Any advice is welcome
Well there is a few ways, one being creating a GUI with python (either tkinter, pyqt5, dearpygui, etc) and buttons to execute scripts, or simply a console where you enter in numbers for option of script
what is it that you want?
an app icon for your app you made already? like a shortcut?
Anyone know how to do state management with NiceGUI correctly that is private to each user?
To be private I put everything inside a function, otherwise it gets replicated across tabs.
But now I have no idea how to set itemDataCard's visibile to true, only when a row is selected, because the function onManifestRowSelected has no reference to itemDataCard
hi, using PyQt6 and Qml, I can't find the Resource complier (rcc) tool. is it bundled with Qt Designer/ Creator or do i have to install PySide6 for that? any advice on this subject would help
Trying to create a secondary window to pop up after a user presses the add devices button. What am I doing wrong?
Is Titlebar customization available in tkinter, or do I have to go for GTK or any other library
I would like to merge some basic buttons into my titlebar, like the Search Button and a few menu items, and I was wondering if that could be done with tkinter.
Thank you.
no. you can make your own custom titlebar tho
that is a hacky way, isn't it? and it doesn't behave as well as of a titlebar right
I wish there was a function like the set_titlebar() available in gtk
painthon
https://docs.gtk.org/gtk4/method.Window.set_titlebar.html
If you set a custom titlebar, GTK will do its best to convince the window manager not to put its own titlebar on the window.
it kind of looks like GTK does the same thing, it just gives you a more convenient API?
apparently on X11, root.wm_attributes("-type", "splash") disables the decorative framing (stackoverflow post, tk reference), but im not sure if you still need to implement window dragging yourself
but gtk also provides us with a headerbar widget
which is amazing in terms of acting like a titlebar
even the gtk docs suggest to use it if we want to customize your titlebars
yeah, im not sure tk has a widget that mimics a native titlebar
and I think gtk headerbars can even be dragged and snapped around
although I haven't experimented with that
drag sources/targets according to their docs? https://docs.gtk.org/gtk4/drag-and-drop.html
tkinter has an experimental dnd module but afaik there's no native tk implementation of it, layout snapping and all
you can just use a click + move event handler instead for the dragging
the best way is to ignore the titlebar. its a very os specific thing
put your stuff below it at the top
but I kinda want to customize my titlebar
It gives a much polished look to apps, according to me
and for my custom app (version control software), I need that look
hence I was asking about that
but nvm, I'll just use pyGTK
:incoming_envelope: :ok_hand: applied timeout to @near crane until <t:1716221802:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
;-;
Are there some already assembled tools to make hud/menu for pygame?
Buttons, checkboxes, input fields, scrollbars.
Etc.
!pypi pygame-gui , I guess
for a imgui wrapper should I use pyimgui or dearpygui?
:incoming_envelope: :ok_hand: applied timeout to @timber token until <t:1716301588:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
i would recommend pyimgui
dearpygui is not an imgui wrapper
it is a whole retained mode GUI library built on top of imgui
Well i really just need imgui for a engine so wrapper or not doesnt matter too much
But id assume pyimgui is still better?
yes, it is immediate mode GUI
Alright, thanks
Long story short, I wanted to create a personal script that just runs things in a sequence. But having it as an app trigger instead of a python file I manually run is ideal
The script is supposed to open up other apps and files and feed certain inputs but I just wanted to know if there's an ideal way to just double click and have it run it all in one go
you can create a shortcut which invokes python.exe with your script as an argument. you have all the features a shortcut has this way.
pyGTK isn't maintained, uses GTK2 iirc and doesn't even support newer python versions
to get GTK working on a non-GTK environment (especially mac or win) is some work
!pypi gvsbuild
for windows this is the most correct and modern way. luckily, the devs now offer pre-built releases
so im trying it out and its not working at all
import imgui
# initilize imgui context (see documentation)
imgui.create_context()
imgui.get_io().display_size = 100, 100
imgui.get_io().fonts.get_tex_data_as_rgba32()
# start new frame context
imgui.new_frame()
# open new window context
imgui.begin("Your first window!", True)
# draw text label inside of current window
imgui.text("Hello world!")
# close current window context
imgui.end()
# pass all drawing comands to the rendering pipeline
# and close frame context
imgui.render()
imgui.end_frame()
this is the basic rendering loop on the website
I installed the pygame integrtation and it didnt work
I also installed the full and it didnt work
its not like it returns a error either
it's just nothing
and I tried to remove boith end and end_frame to the same result
im looking at it and it has not been updated in the past year
this indeed does nothing, as expected
you are not using pygame renderer at all, so imgui works, but result of it is not drawn anywhere
hello, questions regarding Tkinter and customTkinter are allowed?
Yes of course, this is the channel for discussing UI
Can i ask to you my question ?
:incoming_envelope: :ok_hand: applied timeout to @digital rose until <t:1716466238:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
!ytdl
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
anyone here knows flet?
That's okay!
because I am going to use C++ for developing those applications, and probably not python...
although thank you very much for sharing this resource with me
so how would I use it?
because no version worked for me
nvm iI got it working by looking at this https://github.com/AbsoluteVirtue/python-cheat-sheet/tree/f21430f77ab44714137e311a7a9217f69603bbf6/pyimgui
still a bit confusing so ima try to get it working inside of my game
Hello, so I would like a little help + explanation regarding the row/columnconfigure I have a frame but I would like the widgets inside to take up all the space
:incoming_envelope: :ok_hand: applied timeout to @open kiln until <t:1716569428:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
I have the following code, how do I point removeRow to the function in my python script? Since I'm adding it directly to the html I'm not sure how to link it
What framework are you using?
hey guys, has also anyone tried the brand new rio framework for webapps in pure python? https://github.com/rio-labs/rio
this would be better asked in #web-development, but ffiw their concept seems similar to NiceGUI
I'm not very familiar with NiceGUI, but it seems like a more powerful version of Streamlit.
Both NiceGUI and Rio are valid options for smaller web apps. However, Rio might offer easier and more maintainable code as your project grows. It provides reactive state management and allows you to build complex, arbitrarily nested UI layouts with concise syntax.
Anyone have a recommendations for a UI library for an application for sorting simple data? Nothing overly complicated, few buttons, file/text upload and output.
if you just want bare bones UI, go with tkinter. If you want a bit more control and some advanced features like being able to drag and drop a file into the application, go with PySide6
anyone knows a guide or can explain how to package PyQt6 for android? pyqtdeploy doesn't seem to support it
Hello guys,
I am writing a code in pyqt according to https://peps.python.org/.
I've seen in examples of pyqt6 that CamelCase is used for variable names. However in pyqt's documentation I found https://doc.qt.io/qtforpython-6/examples/example_widgets_mainwindows_dockwidgets.html that snake_case is used for variables.
To what name convention should I stick with?
I stick to proper python naming of variables. I find it especially nice to know which methods I'm calling are part of the class I'm inheriting from and which are my own custom ones
So for pyqt objects you use CamelCase and for custom methods, variables sanke_case?
no I use snake_case for everything