#user-interfaces
1 messages · Page 19 of 1
Is it the okay button inside the error_win() function?
yes
The back button is implemented slightly differently than then "OK" button. The back button uses TopLevel(), which is the correct thing to do. The "Ok" button uses Tk() which you do not want. You only want one Tk() instance running per application.
hello guys its me again.
can I use tkinters scrollbar while using place method. if there is can you guys recommend me a good tutorial on that. Help would be appreciated!
aint nah way bro
just put the scrollbar shit in a frame in then just use place on the frame
@odd glacier
of?
the code
this is fucken up is crazy 😭✋
that's good
Well I have set_active_tab
And open_tab_set_window
I was calling open_tab then set active
But open tab set calls set active
i see
But yeah everything is customizable so far
i know very little bout coding for uis but keep me updated man
UIs*
also btw if you're looking for a good font for the ui, choose SF Pro Display
segoe ui
The vs code one
Ofc I will there's so much shit to do
some apps/launchers dont give that option and istg its so annoying man 😭
Doing plug in support
just hmu if you're looking for the font list
i will give you the best hand picked fonts' list
Well for adding to menu
editor.add_menu_item( "BMT Options", self.run_bmt_options )
I even have started work on a syntax checker
Runs through code in the open window
And says this looks wrong to me, are you sure?
sounds cool
make it something more unhinged
smth like "quit programming already your code is wrong"
💀
💀
💀 _ _
-# 💀
Well I so far have stored all while loops
And the lines in them
If while loop does not have waittill or wait notify
It's been rough
Next is if line ends with ; but starts with if function while for else
continue
Continue ends in ;
no bruh i said "continue" as in go on 😭
if( value == value2 ) {
continue;
}
Ohhhhhh lol
😭
But yeah there's fuck loads of syntaxing things to check
average programmer experience lmao
is that you in your pfp?
who's that
Bad boy chiller crew
why did his eyes getting pulled together while wearing the mask?
i could never man 😭
sounds like a LOTTA work
but dont give up
you're doing great now
problem is how do i release it
with a batch?
@echo off
echo Installing customtkinter...
pip install customtkinter
if errorlevel 1 (
echo Failed to install customtkinter. Exiting...
pause
exit /b
)
echo Running main.py...
python "%USERPROFILE%\main.py"
pause
i had this for somet else
i got no idea brother
well that install custom tkinter then runs the script
so this works anyways
so the treeview is simple
whats shown in the treeview is self.workingpath
it populates the tree by either if the item selected starts with u"\u00AC" we remove suffix and add that to self.workingpath
if the user clicks go back
we take that away
could i have done cascading file tree, yes, will i down the line, maybe, right now its made to be working in a specific folder
.csc and .gsc files
^ no
This video demonstrates how a Python User Interface can be designed using a simple application like Microsoft Paint and GIMPy-Widget-UI library
The video demonstrates how to create a User Interface for a Python application in Paint. The video uses GIMPy-Widget-UI library.
pip install GIMPy-Widget-UI
github.com/GIMPyWidgetUI/GIMPyWidgetUI-Demo
The video demonstrates how to create a Home Automation User Interface for a Python application on Raspberry Pi in Paint. The video uses GIMPy-Widget-UI library.
pip install GIMPy-Widget-UI
github.com/GIMPyWidgetUI/GIMPyWidgetUI-Demo
Hey guys, I’ve developed a Python program in Spyder for the company I work for and now they want to use it. They’ve asked me to create a basic user interface for the program. I don’t have any experience with UI development, so I’m looking for some advice on where to start. I’ve heard that integrating the program with Excel could be an option.
I'd say it largely depends on your current experience with python and how much time you're willing to dedicate to learning UI
@snow folio
So, I have a question. When using PySide, is there an easy option to create a shortcut that would listen for specific key combination even when window would have been out of focus?
Want one a shopping menu look like for tkinter?
you can use qhotkey i think
qhotkey.register_hotkey(self, qhotkey.HotKey(0, "Ctrl+Shift+S"), self.whatever_function
That doesn't look like it's a thing at all
Or at the very least I'm not able to find any documentation about it
The thing is that it's not a feature in Qt afaik. So you'd need to use another library.
QHotkey is one of a few Qt-idiomatic utilities for it. But it's primarily used in C++, I'm not sure if there's a Python binding. There's one called PyQxtGlobalShortcut but it hasn't been maintained in a while (only seems to be for Qt 5, for one).
Yea, I've found the C++ one, but I haven't seen anything for python
Of course, you can always just use a traditional keyboard module like pynput. Looks like it has global hotkeys.
It doesn't seem to be working well with PySide
!paste Can you share a small example of how you're setting it up?
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.
well, for now I just added it like it was shown in the link you've posted, but here's most of my main.py file:
if __name__ == "__main__":
app, overlay, setup, master, worker = setup_application(path=os.path.dirname(os.path.abspath(__file__)), cuda=cuda.is_available())
with keyboard.GlobalHotKeys({
'<ctrl>+<shift>+t': setup.toggle_overlay}) as t:
t.join()
sys.exit(app.exec())
for context, setup_application handles (among few other things) creating QWidgets that would display the app
Seems like keyboard creates its own thread with threading. join() effectively waits for the thread to terminate. So yeah, you probably want to set the hotkeys inside the main widget itself and manually start and stop the thread.
Makes sense. Anyway I to do it as you said and now it almost works
But for some reason something works differently when calling the method via the hotkey rather than via QPushButton
And I'm not sure why
I'll assume they're calling the same thing? Can you share what it's calling?
That's gonna be a bit hard, because it's not just a method. It's a method that calls a different method that emits a signal that activates a method on a different thread and starts a timer to periodically emit a different signal
If you want I can post a link to my GitHub repo with it
Sure.
It's probably quite a bit messy, so I'm gonna apologize in advance, but here
https://github.com/Lemiru/jp-to-en-translation-overlay/blob/main/app/QT.py
anyway, the method in question is toggle_overlay of the class SetupWindow
and I tried implementing hotkey by adding this
self.hotkey = keyboard.GlobalHotKeys({'<ctrl>+<shift>+t': self.toggle_overlay})
self.hotkey.start()
at the end of the __init__ method and this
self.hotkey.stop()
at the start of closeEvent method
What happens when using the hotkey as opposed to pressing the push button?
Well, normally, the TranslationWorker should run verify_and_load_models and then periodically run translate
When using hotkey though, it only runs verify_and_load_models
Have you checked if exclusively using the hotkey works (as in not interacting with the push button at all)? I'm suspecting this might have to do with how QTimers work with threads.
It doesn't
Also, if that changes anything, the QTimer is not running on that thread with the TranslationWorker
Ah
"Because of this, you must start and stop the timer in its thread; it is not possible to start a timer from another thread."
That's possibly the issue
As the method is probably called from the thread the pynput uses
Yeah, I recently helped someone with a similar issue where they wanted to set a timer interval while it was running but from a different thread to where that was happening. I suggested as a workaround to use a singleshot timer and simply call timer.start in the timeout slot as if it were a typical timer (since that should hopefully take care of the thread affinity thing mentioned in the page). In this case, yeah, you can also try moving the timer to the translation worker and using signals to interact with it from the GUI (which would probably work better).
Moving it to the translation worker isn't really an ideal solution as I first need do few things in the OverlayWindow before I can run the method on the worker
And I'm not even sure if that would have even solved that
I guess an alternative would have been to have the timer always ticking and innstead just having a boolean that would have told the method to do nothing when it is set
Even though its a private tool, I was hoping to get some feedback as I'm new to front end UI development being a data scientist. I still want to improve in all areas I try.
in order; main window, CSV file options popup, source options dropdown, format options dropdown, analysis dropdown.
(if Im using the word dropdown correctly to describe an integrated window that loads when you click a tab?)
I haven't looked at any graphic design stuff and this is only like my third UI.
Looks okay, probably wouldn't change too much. Maybe choose a darker blue or make the text color darker, that should contrast better.
Fair enough.
Thank you, you're right I should make the text something other than white for readability and a bit darker blue would be easier on the eyes!
Could anyone help me convert a Kivy project (its just a simple hello world; I want to test) into an apk file? I'm on Windows, and I've tried multiple online resources like using WSL or using google colab, but none of them seem to work.
hi, I'm using pyqt with pyside2 and I'm trying to add a toolbar corner widget to a tabwidget, but the text in the buttons gets cut off. does anyone happen to know how to fix this? Do I have to edit some css somewhere? Edit: Think I figured it out, changed the padding css so there's no padding on the top and bottom, doesn't clip text anymore
How can I make a shopping gui?
is there a way of changing the size of the font on tabs?
@static cove im trying to update it with main.py so i can treat it like an api after, then use it as a better console for print statements with tooling
!paste use the pastebin pls
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.
so far tried queues, and delays for sending messgaes
ah sure let me remove the wall
I can take a look tomorrow and let you know
i still need to clean it up its gotten a bit messy from trying out ai solutions since original attempts didnt work
legend i usually just do command line stuff so unsure where i've gone wrong
got rid of all the ai suggestions and redid it and cleaned it up a bit since, trying to dynamically update a class variable to use the app loop to update the message now, definitely making more progress, ai was giving me alot of bad suggestions reading through it
i've got it working now, ended up having to add multithreading, it wasn't being updated cause i was using the same thread for the loop
I keep hearing that about AI ( crap code ) , Mmm I made a typing text to speech interface , its locked into one process ( GUI loop OR speech , NOT both ) , need to do asyncio thingy @dapper mirage
Yeah the ai part was a mistake just gave me a load of crap tbh, Ive got it working now ,just needed the gui loop on a seperate thread
Havnt used tk a lot prior so thought it’d push me in the right direction originally but just sent me on a wild goose chase so not touching that again anytime soon
It even broke my creation pattern
With recommendations it gave
Tkinter is good for prototyping - and Im just flipping bits on a breadboard so Im all good with it - can add Tkinter and Pygame into same GUI , check Pygame room on discord thats where I saw that
@dapper mirage
Yeah I’ve used pygame before this was just for a project for a better terminal organisation tbh basically making an endpoint where I could put different prints messages to different tabs for debugging
I do all my testing on W10 PC but also run it on Ubuntu 32 bit OS for RPI3B+ , the CPU runs very hot , added a tiny fan @dapper mirage
that is for Tkinter and pygame experiments
Yeah that was my big issue with using pygame since it’s a constant buffer, tbh originally I wanted to just update the ui by calling events but Aparently it still needs to run a loop
so if no GUI loop , runs lower CPU loading ?? @dapper mirage
ohhh ok just figure it out - pygame a power pig , not Tkinter
Yeah pygame basically keeps refreshing what is on the screen, it’s the way most game setups do it
But yeah usually it’s a bit of a hog
what if draw line data with CANVAS in Tkinter - to draw waterfall maybe ? @dapper mirage
Probably be less demanding but not used to tkinter most my dev stuff is console/cmnd line
Atleast with python
ya i have to learn SSH , headless remote of a PI , make some LEDs toggle @dapper mirage
Nothing to tricky there, have fun it’s a good starting project and ssh is used quite alot
I will set up a RPI ( raspian lite ) and give it a good poke @dapper mirage
How would I run a GUI that previews images in real-time from the I/O point of view? Multiprocessing or asyncio streams? And how would I share the images between the GUI and the processing thread/process? gRPC and base64 data?
I want to capture a webcam as input, do some transformation, and preview the result inside a GUI widget if it is visible while not damaging the GUI's performance nor taking to long to render such that the next processing operation wouldn't happen after the next frame. From the I/O point of view.
I read about the per-interpreter GIL in the 3.12 change notes, could that help?
Has anyone tested those multi-core Trio libraries for parallel cpu-bound tasks?
qtrio and trio.to_thread.run_sync
could this work with tkinter or pysimplegui?
not qtrio, but through trio
Yes you can use trio guest mode with tkinter
thank you
:incoming_envelope: :ok_hand: applied timeout to @scarlet tangle until <t:1736681977: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:1736692962:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
I have data in 1 column but I'm having a hard time getting it to show 2 columns so that the whole 100 lines will fit.
https://paste.pythondiscord.com/NWYA
Create a listbox to display the top 100 coins
listbox = tk.Listbox(root, width=100, height=20, font=("Arial", 12))
listbox.pack(pady=20, fill=tk.BOTH, expand=True)
change to treeview
two columns
0 + 2 goes in text
1 + 2 goes in value
could be somet like
treeview.insert("", "end", text=self.whatever[i] values=(self.whatever[1 + i)
missed a comma, you get it
:incoming_envelope: :ok_hand: applied timeout to @lethal ferry until <t:1736807692:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Hello! I need to create a small IDE in Python, but I don't know any lib for the user interface other than Tkinter... Do you have any recommendations?
How small does the program need to be?
Does not really matter; it just needs to be easy to improve. I have someone who wants to work on it with me but doesn't really dev things.
Kind of a basic option here, VSCode. It has a live collaboration plugin so you can work together with others. It also has a nice feature set and feels pretty snappy
I'm trying to load icon files from exe files on my compter into a pyqt5 table
but it no work :(
and it hurts my soul
could someone with experience in DearPyGui chime in with a first guess as to why this is happening...
one moment, i'll paste a link to the relevant code...
this is the callback: https://paste.pythondiscord.com/5ACQ for the mouse-drag handler
this is the window creation: https://paste.pythondiscord.com/OJBQ
this is the entire file: https://paste.pythondiscord.com/ZVDA
I suspect that this has something to do with clipping and I'm not handling it properly. I've never setup mouse-drag-panning before within a UI toolkit so I'm a lil bit lost...
I also think that the map-viewer-window isn't setup properly with the draw-list inside it?
oh and probably don't need to say this, but in that posted GIF above the drawlist shouldn't be disappearing just because the window is being resized...
and the drawlist only disappears when dragging the window to certain places which is why I think this pertains to clipping....
and mouse-drag-panning within the window is even worse, lol. it flickers and jitters and resets.....
the mouse-drag-panning only works within certain areas of the window and it's SUPER sensitive...
Yo any ideas for how the ui should look (i suck at designing)
Look at existing application guis for examples
K
hi
which library do you recommend for TUIs?
textual, textualize or pytermgui?
or something else?
what kind of app are you trying to make?
what kind of style are you going for?
Im developing an application and have just migrated from PyGTK3 to GTK4, I was using an icon application pystray which made creating a tray icon simple, It seems to call GTK3, what, if any, is the best way to get both to work? File "/home/user1/.local/lib/python3.13/site-packages/pystray/_appindicator.py", line 20, in <module> gi.require_version('Gtk', '3.0') ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "/usr/lib/python3.13/site-packages/gi/__init__.py", line 117, in require_version raise ValueError('Namespace %s already requires version %s' % (namespace, _versions[namespace])) ValueError: Namespace Gtk already requires version 4.0
Maybe too early, seems wx, pystray, everything still uses gtk3... damn
something similar to harlequin
the user can see the available tasks and run the one he wants
no specific style just for them to look good
reposition / rescale only
Looks fine to me in that case
alr good then
Padding
padding in which elements exactly
all of em
hiya
customtkinter
thinking of dividing parts of the app into their own small window or smth like that
and a tab bar at the bottom of the window to access those other windows
what do you think about this idea? how can i execute it well?
Are there any good UI frameworks that have good GUI design tools?
I'm on the fence about PySide6 and PyQT6 because of their licenses, and I haven't yet found any drag and drop tools for GTK4 yet
My main goal is to write an app that can run on all three major desktop OSes (Win, MacOS, Linux)
Kivy may be an option
While I would consult each license for details (Choose A License has a neat overview), PySide6 provides a more lenient license (the LGPL) which means that you only need to provide the source code of the modifications you've done to PySide itself to whomever asks for it (the GPL used by PyQt is a bit more strict in this regard). Both packages provide commercial licenses in case you are not able to meet those requirements.
Similarly to Qt (which has Qt Designer), GTK also has a few design tools. The one particular of note here is Cambalache which exports your UI as an XML file that can then be loaded with GTK. Here's a small guide on it. Kivy previously had designing tools, but they're unmaintained afaik.
If your UI not being "native" isn't a requirement, another option could be shipping a web app wrapped as a standalone package. A popular Python package for this is pywebview. pywebview uses the "native" web engine on the platform allowing for smaller bundles and less resource consumption (but with the drawback of having to support multiple web engines).
Some people may even tell you to forgo these designing tools completely as they aren't as flexible as writing code and may be harmful if you're trying to learn a particular UI. My opinion on this is to feel free to choose either option (UI via code or via design tool) but to be very careful about the way you go about it.
tekgar explains it well. i personally would go with the web ui approach. learning a ui framework is a huge task and in most cases it isn't worth it at all. most of the times it would just lead you to using a poor man's version of css, react etc. and eventually causing frustration. whereas with web dev, you literally have the best of all worlds.
@icy iron
I see. How well do web ui's perform with python?
Are they good for cross platform apps too?
you can make them perform as well as instagram which runs on django.
web is probably the most cross platform compatible thing right now. your ui will work wherever your browser runs. where does it run? everywhere. much better than any ui library
Ooh that's pretty nice, if I can figure out how to get python apps running on mobile I can make it work across 5 or 6 platforms instead of 3 or 4
you can make them perform as well as instagram which runs on django.
I'm looking to make a rather complex GUI
There will be a text output field on the right side and a table on the center and left side [this table can preferably be edited by the user, nothing major just small data correction, in addition it can be filtered ; this table can in theory take a few thousand lines]
In addition there will be the need of quite some buttons, a file selector, and a few menu's.
I basically only know python, which will be enough for my backend. I was considering nice GUI for the frontend as i can do most everything in python. However it is unclear to me if nicegui allows the complexity needed. Does anyone here know? if it is not feasible, what is a good (and well documented) alternative with as few non python things as possible? It needs to be free (for non commercial / open source use)
I am not a great programmer by any measure so having to learn a new language for the frontend feels painfull, on the opposite side, discovering near the end of my project that i have to redo the whole GUI also souunds not optimal.
Hello Everyone
That can probably be done in all of the major Python GUI frameworks. NiceGUI itself relies on the Quasar Framework for components which itself uses Vue. Here are some examples of that. If the components provided by Vue do not allow for that kind of complexity, you can basically insert your own. But, at that point, you might want to consider just using Vue directly for frontend.
PySide6 (one of the major GUI frameworks in Python) probably makes this easier as it has support for the sort of thing you're asking (a layout with buttons and editable tables that can handle a few hundred elements). But again, most frameworks have facilities for this sort of thing (PyGObject, PySide, even Tkinter - albeit with plugins, etc).
guys, why is Qt mirrorlist not opening for me, and the default one shows a network error during the installing (qt online installer)
for the solutions for my problem on their site, the suggested changing the mirror through the terminal
wrong channel, this is for discussing development of user interfaces.
yeah
..
Hello,
I am the founder of cvresumenest and I came here with a problem, a huge one .
I started this website a year back , it’s a free resume maker webiste. The thing where I faced the issue is that the design is very bad.
I am trying very hard to fix this but i cannot visualize what needs to be fixed.
Could anyone please advise me what can be improved? What’s bad ?
Would be so grateful ❤️
im sry
@dusk crater i was looking if we could colaborate
and can any1 rate my ui?
me to the rescue ig
i got a question so i made an gui with figma now i want it in python is there anyway to get the code for it ? i mean i got figma dev mode so i can get the code in css or just the Proparties of everyframe
As far as I am aware, there isn't anything you can use for UIs in Python that use CSS so you'd need to use flask or Eel
hi, in tkinter, how can you make a frame scrollable using a macos trackpad? like if i drag two fingers up, the frame goes down, and vice versa. also for horizontal. i dont want scrollbars
Has anyone tried to make their own type of discord?
anyone with pyqt5 experience could help me out at #1035199133436354600 please?
Mabey try show= false
?
If you want to hide the scroll bars but one to still use them you have to use a show command to configure it to not show or to show
:incoming_envelope: :ok_hand: applied timeout to @meager bolt until <t:1737765271:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
No I mean I want to swipe up or down and then the frame moves I don’t want a scrollbar
Show much do you know about TKinter?
Well I’ve made a fairly decent GUI
I just want to make it scrollable
Like with a trackpad
Without scrollbars
Do you know about the show configuration?
Hi, I am using pyside6 and qt designer. I have a blank disabled QAction widget on a vertical toolbar. Can that widget be set to use up all available vertical space and push the DB icon to the bottom?
I know this is not ui but I don't know where to post this
why do I get this error?
Should've gone in #1035199133436354600
But you're not opening it in a folder, so that means that you're running your code in a separate location to your words.txt file
I'd recommend that you create a new folder and put everything you need into that folder
Alternatively, you can always copy the path of words.txt into the with open('... part
How can I make it worse somebody has to put in a birth date?
np :D
yo
how do i limit the number of window generated when window1 function is called
How can I make limit for allowing a person to view something?
What library does everyone use for GUI applications? Not a big fan of PyQT
i mean whenever i press the button it generates a new window named control panel , and if i press it again it will create another same window total 2 windows to limit this to 1 what shall i do
tkinter for desktop apps. pygame for desktop drawing
remember the open window in a global state and don't open one if one already exists
what don't you like about pyqt?
sorry. my brain wanted to type tkinter but my hands typed pyqt.
I have not used any other libraries and wanted suggestions. I come from a c#/Visual studio winforms background and slowly transitioning to python and it's libraries cause it is kickass
Figma might be too modern and cloud-based, but Tkinter Designer looks like it can quickly build a modern application from it: https://www.youtube.com/watch?v=Qd-jJjduWeQ
Tkinter Designer was created to speed up the GUI-development process in Python. It uses the well-known design software Figma to make creating beautiful Tkinter GUIs in Python a piece of cake.
Link to Tkinter-Designer - https://github.com/ParthJadhav/Tkinter-Designer
Hello I'm ...
there are plenty of classic GUI tools though: https://stackoverflow.com/questions/53378400/visual-basic-like-gui-for-python-with-arrays-of-text-boxes-and-labels
judging by the code, it looks like Qt likes to overcomplicate things: https://www.pythonguis.com/faq/pyqt6-vs-pyside6/
Ok, what if I press the button it generates the window and places the button on like(x=700,y=700) so the button disappears on the screen and generates the new window
I am not that good in python i don't know about global stuff or anything
i see global and scope aren't covered well in https://openbookproject.net/thinkcs/python/english3e/ so use Google: https://www.w3schools.com/python/python_variables_global.asp
you could disable the button instead
Yea
So I've been trying to get a python application with DearPyGUI to compile with both Pyinstaller and Nuitka, but things aren't quite working right. Everything compiles fine, but both produced executables throw the following error:
/home/runner/work/DearPyGui/DearPyGui/thirdparty/glfw/src/window.c:479: glfwWindowShouldClose: Assertion 'window != NULL' failed. Aborted (core dumped)
I've tried including the glfw and dearpygui libraries as hidden imports, but it hasn't really helped. I also tried disabling --onefile but no dice. Here's my build commands:
PyInstaller:
[sys.executable, "-m", "PyInstaller", "--onefile", f"--workpath={BuildDirPath}", f"--distpath={DistDirPath}", "--hidden-import", "'dearpygui.dearpygui'", "--hidden-import", "'dearpygui.core'", "--hidden-import", "'glfw'", "--hidden-import", "'dearpygui'", "--name=Shockfish", "--clean", f"--add-binary={sys.argv[1]}:.", f"--add-binary={sys.argv[2]}:.", "--noconsole", "Main.py"]
Nuitka:
[PythonEXEPath, "-m", "nuitka", os.path.join(CurrentCWDPath, "Main.py"), f"--output-dir={BuildDirPath}", f"--output-filename={EXEFilename}", "--standalone", "--onefile", "--include-module=dearpygui", "--assume-yes-for-downloads", "--remove-output"]
These errors show even with the most basic DearPyGUI example.
I'm running these commands inside of a venv (all packages are installed), and on Kubuntu 24.04. What else could I try to fix this?
I've also noticed that the app doesn't even run without a console on Wayland, but when I run the script through the terminal, everything works just fine
I don't know if it runs fine because there's a terminal though
After some more debugging, I've found "14019 ERROR: Hidden import "'dearpygui'" not found"
I tried cx_freeze as well but it throws the same error asd pyinstaller and nuitka
Maybe you need to name the Python file with a .pyw extension
Or use the pythonw.exe executable rather than the python.exe one
I figured it out. Turns out that the viewport needs to be shown before you draw to it, but this somehow only affected my compiled executable and not my python script
Hey guys, Python newb here, I spent over 10 hours just making these, the buttons are functional and I learnt how to do screen overlays and requests
How can I format the UI better? I really dont like how it looks atm
i like how it looks now
what would be the python equivalent of EGui
egui seems to be immediate mode. The two major inmediate GUIs in Python right now are DearPyGUI and pyimgui. They're basically both bindings of the same thing, dear imgui, but they follow different philosophies, so to speak (dearpy aims to be more complete while pyimgui is more of a direct binding).
im looking at pyimgui which looks really good, better then dearpygui in my opinion, I just dont really like it's documentation
add me
?
JavaScript-based ripple effect library powered by Three.js https://github.com/SanshruthR/ripple3js
i know you want help. use #❓|how-to-get-help, not random channels.
ok should I delete it?
I'm using DearPyGUI, and I'm having some trouble getting callbacks to change values in a class properly. The OkButtonPressed variable is changed with this function:
def SetOkButton(self, Sender, AppData, UserData):
print(id(self))
self.OkButtonPressed = True
if self is UserData:
print("They're the same object")
And this is the button that calls this function (FD is an instance of my FileDialog class):
IMGUI.add_button(label="Save" if FD.SaveFile == True else "Open", tag="FDOkButton", pos=(WinSize[0] - 148, WinSize[1] - 128), callback=FD.SetOkButton, user_data=FD)
SetOkButton correctly changes the value, but I can only see these changes inside of the callback, everywhere else I check returns False instead of True. I've ensured that FD and self are the same object, and that there is nothing that overwrites OkButtonPressed, what could be the issue here?
Also, here's how my FileDialog class is defined:
class FileDialog:
## FUNCTIONS ##
def __init__(self, Title="Shockfish - File Dialog", StartingDirectory=Globals.MainProgramPath, ValidExstensions=[], SaveDialog=False):
self.DisplayAllFiles = False
self.IsMouseReleased = True
self.OkButtonPressed = False
self.ExtensionFilter = ValidExstensions
self.DGDisplayed = False
self.Directory = StartingDirectory + "/"
self.DGWindow = None
self.DGClosed = False
self.SaveFile = False
self.Filename = None
self.FSItems = []
self.Title = Title
def SetOkButton(self, Sender, AppData, UserData):
print(id(self))
self.OkButtonPressed = True
if self is UserData:
print("They're the same object, why isn't ts working :(")
def Show(self):
GUI.FileDialogs.append(self)
So turns out the value only changes after the file dialog is closed?
I'm making a game for my school project any tips/suggestions for UI?
Damn that looks cool
i will give 1 billion dollars to make windows 11 clone using only python
!rule 6 9
6. Do not post unapproved advertising.
9. Do not offer or ask for paid work of any kind.
heya yall, working with Tkinter for the first time. Was curious if someone could help me get these columns looking neater 🙂
did you create frames for each row? every frame has its own grid layout and won't naturally line up with each other, so by putting every widget inside individual frames, they don't consider the alignment of widgets from other frames - if you were to visualize their grids, it would look something like:
you want to put your widgets inside a single frame so they all share the same grid, that way tkinter can pad them out to line up with each other
I did yes
something like: ```py
app = Tk()
Label(app, text="Hello" ).grid(row=0, column=0)
Label(app, text="world!").grid(row=0, column=2)
Separator(app) .grid(row=1, columnspan=3, sticky="ew")
Label(app, text="Hello" ).grid(row=2, column=0)
Label(app, text="world!").grid(row=2, column=1)
Separator(app) .grid(row=3, columnspan=3, sticky="ew")
Label(app, text="Hello" ).grid(row=4, column=1)
Label(app, text="world!").grid(row=4, column=2)
allow columns 0-2 to stretch horizontally:
app.grid_columnconfigure([0, 1, 2], weight=1)```
My issue is, I am generating the info from a Dict that is loaded from a CSV
ohhhh
wait
I know how I can do this, thanks for the info
you can also try making more complex layouts, if you have the time for it - here's one to whet your appetite: https://paste.pythondiscord.com/P3LQ
(revised gist: https://gist.github.com/thegamecracks/ee37fe60a559a609f6ee666bb1ca4e1c)
This is what I am going for, very nice
TkDocs is also a good learning resource, you should have a read through it if you haven't already:
https://tkdocs.com/tutorial/intro.html
these pages in particular about geometry managers and grid might interest you:
https://tkdocs.com/tutorial/concepts.html#geometry
https://tkdocs.com/tutorial/grid.html
Interesting, man making it as a class object is massive
Idk why I didn’t think of that
in the display stuff, you can see 4 button like add1 to add 4
when i click any of those i should get a new pop up window, it should have to entry, one should be preset name and another should be its brightness value, a number field
then a button for submitting (usially apply button), if applied the preset icon and text should be replaced by the name field which the user has typed and when click a popup menu having
3 button, edit, apply, delete
delete button will remove it a put the present name like at the begginging
edit button will give the name and value field which we can use to edit
finally delete apply button will apply the current preset's brightness to the screen (this is the chatGPT entry that i gave but that shit sucks)
this is made in customtkinter BTW
could anyone help me
?
If anyone can help me, please ping me
here
thanks cracks, this is super helpful
Damn that UI looks sick
Hey everyone, may be an elementary question, but how do I fix my margins?
Is it a pagesize problem?
```def generate_pdf_report(self):
data = [["Employee"] + self.days_of_week]
for employee in self.employees.values():
row = [employee.name]
for day in self.days_of_week:
if day in employee.shifts:
shift = employee.shifts[day]
row.append(f"{shift.start_time} - {shift.end_time}")
else:
row.append("")
data.append(row)
# Create the document with custom margins to ensure the schedule is not cut off.
doc = SimpleDocTemplate(
"schedule.pdf",
pagesize=letter,
leftMargin=40,
rightMargin=40,
topMargin=40,
bottomMargin=40
)
table = Table(data)
style = TableStyle([
('BACKGROUND', (0, 0), (-1, 0), '#CCCCCC'),
('TEXTCOLOR', (0, 0), (-1, 0), '#000000'),
('ALIGN', (0, 0), (-1, -1), 'CENTER'),
('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),
('FONTSIZE', (0, 0), (-1, 0), 12),
('BOTTOMPADDING', (0, 0), (-1, 0), 12),
('GRID', (0, 0), (-1, -1), 1, '#000000')
])
table.setStyle(style)
doc.build([table])```
Woahhh
Ever considered using PyQt Fluent Widgets? Would def make this ui look dope!
@modest dove So are you recommending me to learn PyQt ?
Also is it free or does the free version have any limitation ?
Or should i stick with the CustomTkinter (Note that i am using GUI for basic purposes not professionally)
Sorry about late response, but yeah PyQt Fluent Widgets is a addonfor PyQt that allows you to make UI's that kinda look like WIN 11 applications
You can check it out here
i felt like its syntax are a bit complicated
Any way thank you @modest dove for your kind response, I will try PyQt soon
No worries man!
This the right place to ask for some help with PyQt5?
- For help relating to Python User Interface libraries (e.g. PyQT, Tkinter, Rich, Curses, PySide, DearPyGui)
should be yeah
Sweet! Basically, I'm refactoring an application I created a couple of months ago in PyQt5, just trying to improve / clean it up a bit. I'm creating a custom class for QScrollArea to act as a container for other containers and widgets. But for some reason, there seems to be a minimum size set that i can't change. Doesn't seem to matter what i change, it just won't go away. Feel like I'm obviously missing something.
def __init__(self, parent=None, name=None, hor_policy=None, ver_policy=None, warn=False):
if not isinstance(self, QWidget):
raise TypeError("BaseWidget must be used with QWidget subclasses")
if name:
self.setObjectName(name)
self.hor_policy = hor_policy if hor_policy is not None else G.PREFERRED
self.ver_policy = ver_policy if ver_policy is not None else G.PREFERRED
self.setSizePolicy(self.hor_policy, self.ver_policy)
self.warn(warn)
self.setContentsMargins(0, 0, 0, 0)
if isinstance(parent, Container):
parent.add(self)
def warn(self, warn):
self.setProperty("theme", "warn" if warn else None)
def hide(self):
self.setVisible(False)
def show(self):
self.setVisible(True)
class Container(QScrollArea, BaseWidget):
def __init__(self, parent=None, name=None, vertical=True, hor_policy=None, ver_policy=None):
QScrollArea.__init__(self, parent)
BaseWidget.__init__(self, parent, name, hor_policy, ver_policy)
self.setWidgetResizable(True)
self.container = QFrame(parent)
if vertical:
self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.layout = QVBoxLayout(self.container)
else:
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.layout = QHBoxLayout(self.container)
self.container.setLayout(self.layout)
self.setWidget(self.container)
self.setMargins(*G.DEFAULT_MARGINS)```
@burnt gull You should put code in code block with 3 of these signs `
Please what is PyQt, I'm new to python
python bindings for the Qt framework for making GUIs
how can i align the center and modify that button style to rounded button?
its a stream used for gui.
Anyone using console UI? I'm interested in something like curses, but Windows-compatible. I've tried Urwid for now, it looks nice, but I'm having problems as soon as I try to do anything beside the tutorial, and the documentation seems not to be complete.
Are there other console-friendly widget libraries?
My favorite console widget library is called print() and msvcrt for keyboard input
Unless you're planning to do a super complex thing, you don't really need a TUI library
How did u make this
Canvas
yeah
jus use a game engine at this point
its a quiz game
why am i muted
i'm trying to make a game engine with a cute and purple ui in this style
so can anyone help me
How can I make it so that I can append buttons to notebook so in essence I can close those pages
Could you elaborate?
Like a browser
Can you show your code?
I haven't coded it yet I just wanted to know if it's possible to append both of those objects together
What do you mean by notebook
Im trying to animate something on python using pyqt5 but my animation keeps being cut off. If anyone has experience with this or might know how to fix this please respond to this message so i can provide more assets
(ping me)
can same one help me
I want install pyqt3d using pip
pip install PyQt3D i get this error can be some one help plz
`
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [5 lines of output]
Querying qmake about your Qt installation...
These bindings will be built: Qt3DCore, Qt3DInput, Qt3DLogic, Qt3DRender, Qt3DAnimation, Qt3DExtras.
Generating the Qt3DCore bindings...
_in_process.py: /tmp/pip-install-a5joxwql/pyqt3d_f7eeba296e2f4207af7dafc8e008a7a2/sip/Qt3DCore/Qt3DCoremod.sip: line 25: column 9: 'QtCore/QtCoremod.sip' could not be found
/tmp/pip-install-a5joxwql/pyqt3d_f7eeba296e2f4207af7dafc8e008a7a2/sip/Qt3DCore/Qt3DCoremod.sip: line 26: column 9: 'QtGui/QtGuimod.sip' could not be found
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details`
Me too when installing sketchpy and numpy
what editor are you using?
I use vscode
can you maybe access the packages?
maybe you can install it manually theire
it also says something with subprocess so it could be that your environment can’t access the libary for some reason
Can help but i charge
help for what ?
this lib is cool I want it and it's not installed and for c++ is not working it
You’re missing Qtgui/QtGuimod.sip
Are these available on your os package manager?
How to fix any cammand ? can help me
qtgui it's part of qt5
Are you installing into a venv or uv venv?
yeah
has anyone used python to login to network devices, for example cienas, via ZOC terminal?
Like SSH into a device?
I used a library (I think it was called paramiko) for that before
It has to go through ZOC though bc there’s a proxy there u have to use in order to login to the devices
Hi, using Pyside 6 and making a custom title bar for a frameless window. Here in the image, the top is in QT designer, the middle is ctrl-r in qt designer, and the bottom is in the actual app.
You can see the buttons have moved to the left as if there is some padding or margin on the right. But I can't work out why this is happening. Any tips or clues?
Hey everyone, I'm actually trying to dig into project management ( for a project using PyQt ) and I was wondering if there was a way ( i've been looking onnline for the whole day ) to make Modern gantt and calendar ( a bit as with google or notion ) interfaces ! Thanks a lot !
since you are working with Py Qt i don’t really know but with tkinter their is the possibility using themes, look out if their is maybe some kind of style sheets or so for py qt
anyone good with figma?
Guys I need ideas for the header not sure what to do
yapıyon bu işi arda
hey, this is an english only speaking server :)
sorry soory
Hi guys, I got a little question, I'm realitve new with user-interfaces with python.
which is the most lightweight user interface python library?
Hi, I would say Tkinter
Well, I think I will use it, thanks Sherk.
I made this software used tkinter.
Nice, what is about?
Its a Shipping Report App. If you import CSV or Excel file, which contains the data, you can create daily, weekly, monthly reports,
How can I make a good modern looking UI? I dont want to use Tkinter or Customtkinter
i feel like theres something that will happen with this one
PyQt , Kivy.
What abt PySite6?
You mean pyside?
yea
I have no experience with pyside, but they say its awesome. You can find videos on youtube.
Okay ty
Just hoped for someone who maybe worked with it
Does anyone know how to append buttons to notebook tabs
+1 for pyside. I use it pretty much daily.
👍
Outside of tkinter, how can I make a GUI in python?
I've also used Pyside, wxPython, and Flet for user interfaces.
Ok thx
PySide/PyQt both are essentially the same thing - Python wrappers around the Qt framework. Qt itself is one of the most mature framework so I would recommend that as well. There is nothing that comes close at least as far as I know in Python.
Also, if you are planning on using it, I highly recommend you look into the C++ documentation of Qt. It is one of the most descriptive and beautifully documented framework I have seen in my career.
The python documentation is automatically generated and hence, is not the best place to start.
It's very easy to understand how you would write the same thing in Python, just a matter of Syntax 🙂
Were you able to figure this out? I am not sure which screenshot you are referring to? Do you mean the empty boxes in the middle or the windows controls in the title bar?
I have not gone back to it since, but if you look at the position of the empty boxes in the middle image, then the location of a - and X in the bottom picture, they are offset toward the left by several pixels
Hi, everybody. Do you know streamlit?
I have not well understood when to use st.cache_data or st.cache_ressources . I guess, I should not save larger items in session_state.
I am trying to build a GUI, where people can select files from a folder, user can make a selection of files. They get processed and plotted.
The data of the (all?) files is a lazy dataframe. Should something like this be in st.cache_data ?
If you know a nice example, with nice classes for the streamlit gui and the files selection, processing, I would be happy to see it. Would be nice to see how it is done with proper OOP.
the only thing that is happening is a real python game engine
well atleast im right about something will happen
what do you guys think about holoviz panel?
Really a python game engine?
Good luck making a game engine in Python
what is a "real python game engine"?
civ4
:incoming_envelope: :ok_hand: applied timeout to @quasi dock until <t:1741459043:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Hi! Do you recommend using kivy type for a simple application?
Yes, why not. In fact, using Kivy you can create apps for multi-platform with single code base
Come on, thank you very much brother, have a nice day
Idk if this is the right channel but I don't know why my python looks different from everybody's?
that's not python, that's powershell. How exactly did you expect it to look like?
How do I make a gui that looks like this? (Doesn't matter which library)
Please ping me on resposne :)
Well as per the screenshot, I can see the "PyQT" mentioned in the title bar of the window, so that means you can use PyQT to build such a GUI. You can use other libraries as well such as tkinter, kivy, etc.
I looked into that, but couldnt find any styles or eays to do it? Do you have more information regarding the topic?
If you are looking for exactly same then I don't think it is possible but it is platform specific. And looking at it, it looks like windows 7 or 8 but still you may try this solution: https://stackoverflow.com/questions/73918178/pyqt5-windowsvista-style-instead-of-win10-style#answer-73920981
I’ll look into it. Thank you for your help 😁
This one looks kind of like a win 7 gui(but dark mode):
https://github.com/TomSchimansky/CustomTkinter
And this one looks like the win 11 winui3 gui:
https://github.com/zhiyiYo/PyQt-Fluent-Widgets
are you geekin?
wym?
I'm sorry if this comes off disrespectful. But i was asking if anyone knew any old windows GUI's & you send a win11 library & a modern windows 10 gui
ok wasnt sure if you just wanted a windows aesthetic in general
No no, but thank you
@modest dove "For the app to look exactly like Windows 7, it needs to be run on a Windows 7 system or one that has the Aero theme enabled in the first place. Modern Windows versions (Windows 10/11) handle window decorations differently"
heres something close
Click here to see this code in our pastebin.
solved by reinstalling everything
pip install --upgrade qtawesome PyQt6 PyQt6-Qt6```
my first tkinter app be like
Good morning, I've been trying to find reference on setting up Vulkan inside tkinter but have not found any relevant information. Does anyone know if there has been any discussion about this?
Hey all, I need help choosing which library to use for a project, more info in this thread: https://discord.com/channels/267624335836053506/1350229943098937344
any suggestions appreciated
Pygame is probably your best bet here, but realistically Python isn't the best at this. Do you have to use python?
not necessarily but im not sure...
I want to run the program on a raspberry pi and I know how to code in python the best
My suggestion would be something like Godot
the coding language is similar to python
but you'll have way more tools at your disposal to create all the visuals that you want
Hey, had my first time using QT for a basic Deezer RPC ui,
I want a system tray hide feature and i made it, it works normally until I want to compile my python file (code)
But the tray system doesnt work while app is compiled, just hides the app but keeps it working (still works in Task Manager)
Compile Command Used :
```bash
pyinstaller --onefile --noconsole --icon=icon.ico --name=rpc-ui --add-data "icon.png:." --add-data "icon.ico:." rpc-ui.py
Project Structure :
icon.ico
icon.png
rpc-ui.py
settings.toml
I have a python project in kivy(for Android) it's a simple quizz app but I just can't get it to my phone i tried everything it seems the only thing I didn't try was using a Linux system so please can I get help from anyone
made an epg app out of boredom 🙂 still wip
gotta limit the amount of channels it loads at startup, load rest that are needed in background
hey
this is my app
would anybody like to collab with me?
View the code here
Looks pretty cool, but it seems to be extremely flickery on Linux
Also why is there rust for this that only launches the app?
At that point just use something like pyinstaller or nuitka
Maybe you should consider only modifying the parts that are updated and not erasing and loading everything, it's a lot of work for the CPU.
but you are on the right track
I was wondering if anyone who wants to could do this in a cleaner way than I did.
Given a list of glass stained blocks in mc i.e ['red', 'blue ', 'lime'] it generates
Maybe put the beacon and glass to the right of the controls
Coming late to this but I absolutely love PySide6 - I've been using it to build an AI-powered dev environment and it has been great to work with (https://github.com/m6r-ai/humbug). I've also found that Claude has a very strong understanding of how to use it if you need help
thanks
hey fellers. can anyone look into https://discord.com/channels/267624335836053506/1353309844765147146 if u got time. got some trouble here and maybe u guys can help me out.
No lounge?
discussion channels are similar
Slightly off topic, but I am looking for a cross platform UI framework that can support both Python and Java apps. Do you know if Qt works with Java as well as Python? Thanks.
did you use any tool for this ?
Hey guys, i just started learning tkinter using the lesson provided by pycharm but there seems to be a problem with the color. This is my code:
`from tkinter import *
window = Tk()
window.title("Exercise 2")
topFrame = Frame(window)
secondFrame = Frame(window)
thirdFrame= Frame(window)
lastFrame = Frame(window)
topFrame.pack()
secondFrame.pack()
thirdFrame.pack()
lastFrame.pack()
text1 = Label(topFrame, text="This application demonstrates frame layout")
button1 = Button(secondFrame, text="Button 1", fg="green")
button2 = Button(secondFrame, text="Button 2", fg="red")
button3 = Button(secondFrame, text="Button 3", fg="blue")
button4 = Button(thirdFrame, text="Button 4", fg="green")
button5 = Button(thirdFrame, text="Button 5", fg="green")
button6 = Button(thirdFrame, text="Button 6", fg="red")
button7 = Button(lastFrame, text="Button 7", fg="blue")
button8 = Button(lastFrame, text="Button 8", fg="blue")
button9 = Button(lastFrame, text="Button 9", fg="blue")
text1.pack()
button1.pack(side=LEFT)
button2.pack(side=LEFT)
button3.pack(side=LEFT)
button4.pack(side=LEFT)
button5.pack(side=LEFT)
button6.pack(side=LEFT)
button7.pack(side=LEFT)
button8.pack(side=LEFT)
button9.pack(side=LEFT)
window.mainloop()`
The first pic is what it is supposed to look like and the left is what it looks like after I run my code (also the second one is black cuz i have dark mode on rn)
Thx guys!
Rich text library
beautiful music
please teach me how to make this
This is how I made the informations tab:
text = Text.from_markup(
"[bold green]Sleep Client[/]\n"
"[magenta]Brought to you by Fundet & Geoloage[/]\n"
"[yellow]// // ver 1.0.0 // //[/]\n"
"[green]True: On[/]\n"
"[red]False: Off[/]",
justify="center"
)
console.print(Panel(text, border_style="blue", title="Information", title_align="center"))
That looks amazing! I will definitely check out Rich. Thanks!
I've been trying to create a PyQt app where I have a custom header, but windows is showing 5 pixels of whitespace at the top which is ruining my design.
I have tried using Frameless flags but that disables the feauture where windows helps me resize my window
I am trying to achieve the same windows setting that (spotify, vsc, and discord) have on windows,
If anyone knows how to achive this even if its not PyQt, such as (Electron, tkinter) etc please let me know how its done, I cant find anything online
Heres my code:
from PyQt6.QtWidgets import QApplication, QWidget
from PyQt6.QtCore import Qt
import sys
class DummyWindow(QWidget):
def init(self):
super().init()
self.setGeometry(100, 100, 500, 500)
self.setStyleSheet("background-color: red;")
self.setWindowFlags(Qt.WindowType.CustomizeWindowHint)
app = QApplication(sys.argv)
window = DummyWindow()
window.show()
sys.exit(app.exec())
Found this on stackoverflow, works well for me.
Click here to see this code in our pastebin.
Do you know any good libary with good-looking interfaces without using tkinter?
I just used this for the first time yesterday and it seems pretty nice https://github.com/hoffstadt/DearPyGui
yea pyqt5 qtwidgets
depends what the guis for
pyqtgraph is good for graphs
Need something to pop-up and do changes then save in file, lot of buttons configure
i agree with pyqt and qtwidgets
How did you create the blue boxes, this looks sick btw
did a little silly game where you talk with ai generated souls freshly dead and decide their afterlife, you can see their past, chat with them, see their hobbies and a lot more, check it out, totally free https://pyoneerc1.itch.io/spu done with kivy
Long
Add different like shades for every two colums
So one would be light green one would be dark etc it's easier to read
@unborn canyon
@digital rose That gui that i sent is only 262 lines of code
gotta love PyQt6
its got really nice styling options
very customizable
Oh ik it just looks cool with colors
Loke how excel does it
?
What's that gotta do w me
Ion even do ui
Oh
Nvm
I'm dumb
I'm like 90% sure that doesn't make a blue border but idk
Like it's assigning the border colour but doesn't actually show how you made the border
Is it panel in the console.print func ?
This prints the border
console.print(Panel(text, border_style="blue", title="Information", title_align="center"))
And the other is the contents inside of it 🤦
Right
But how does it print the boarder?
Is it the panel in the console.print func
I believe so
How do you not know 😭
I didn't read any of the documentation I just got grok to do it for me lmfao
Can someone help me ? Im using tkinter, and i dont know why but when i click on the button, afterwards it suddenly becomes reactive to hovering (color change and border "inverted) till another button is pressed, how do i get rid of this weird behavior
self.convert_type_menu = tk.Menu(button_frame, tearoff=0, bg="#444444", fg="white")
for mode_name in ["Raw", "Hex"]:
self.convert_type_menu.add_command(label=mode_name, command=lambda m=mode_name: self.file_writer.set_mode(m.lower()))
def show_menu(event):
print("show_menu")
self.dropdown_btn.config(relief="sunken", bg="#2196F3", fg="black")
self.convert_type_menu.post(event.x_root, event.y_root)
self.after(1, reset_button)
def reset_button():
print("reset_button")
self.dropdown_btn.config(relief="raised", bg="#2196F3", fg="white")
self.dropdown_btn = tk.Button(button_frame, text="▼", bg="#2196F3", fg="white")
self.dropdown_btn.pack(padx=(0, 5),side=tk.LEFT)
self.dropdown_btn.bind("<Button-1>", show_menu)
EasyCard+, A simple flashcard editor/viewer
I made a flashcard program using pygame to study for exams. It also has audio-hints that you can record in the
audio recorder that I built into it. I also made it easy and somewhat fun to create, and edit flashcards. I used tkinker
& easygui for popups btw. It was really annoying but I did add support for exporting to PDF, however I couldn't get
the in PDF audio working so I just made it an embedded file. I also put it on my itch.io: https://vmanisherenow.itch.io/easy
how do you fix these gap when the mouse move too fast
def start_drawing(event):
global drawing
drawing = True
x = event.x
y = event.y
if drawing:
canvas.create_oval((x - brush_size / 2, y - brush_size / 2, x + brush_size / 2, y + brush_size / 2), fill=selected_colour, outline=selected_colour)
def stop_drawing():
global drawing
drawing = False
canvas.bind('<B1-Motion>', start_drawing)
canvas.bind('<ButtonRelease-1>', stop_drawing)```
One fix is to track the last point and draw staring line to that.
Another fix which may or may not help is trying to modify setting for high dpi (I had only used for windows)
Use activeforeground and activebackground atrribute values.
Is it possible to make an interface that can add or make a database?
yes but going to need a lot more information on what you mean and are trying to do
Well I wanted to make a medical program and so I don't have to find a database online after getting everything done I want to make it so that it makes the database
I like for example
Ex.
Name: iron fox
Age: 118
Gender: n/a
Contact_info: ggggf
For example
Well I mean its a lot more complicated than just 'making a database' as I assume you plan to read from it, add new patients, update information, etc. But yes it is all possible to do and something I am actively working on myself for a different type of program
So, you'll need more than just this bare skeleton, but one way you could go would be to have your 'things' (like the patient record you showed for Iron Fox) be Pydantic (JSON) models, and then having that automatically get mapped to your database schema: https://docs.pydantic.dev/latest/examples/orms/
Here's somebody basically doing the thing https://github.com/litestar-org/polyfactory/issues/504#issuecomment-1966027097
If your 'things' have a more well-known structure in advance, just defining them directly as database 'models' would be easier.
I found a tutorial
Do I have to install the package or is it already pre-installed with python
Separately, for both pydantic and sqlalchemy, yeah.
I tried to follow myseqel as perfect tutorial haven't been able to find an import for Windows terminal
Is that okay cuz I can't find any pip for any of those including the myseqel
Maybe it's case-sensitive? I just did pip install SQLAlchemy and it worked
pip install pydantic works fine too. Make sure your pip is set up reasonably I guess?
Which one would you recommend?
...
Sorry, what are you asking exactly?
Which one do you prefer and I got to run now turns out it was using the wrong
I don't know your exact situation, but..
I personally would prefer to use 'just' SQLAlchemy, and pre-define what all my models looked like.
If you need something where the user is deciding on the attributes of things each time at runtime, you might want to get Pydantic involved.
So it really depends on your goal. SQLAlchemy on its own is a simple great way to store your objects in a database.
If that feels like "grr, this isn't enough like JSON", then that's when Pydantic would come in.
import mysql.connector
"resource": "/c:/Users/iorn/databaser.py",
"owner": "python",
"code": {
"value": "reportMissingImports",
"target": {
"$mid": 1,
"path": "/microsoft/pyright/blob/main/docs/configuration.md",
"scheme": "https",
"authority": "github.com",
"fragment": "reportMissingImports"
}
},
"severity": 4,
"message": "Import \"mysql.connector\" could not be resolved",
"source": "Pylance",
"startLineNumber": 7,
"startColumn": 8,
"endLineNumber": 7,
"endColumn": 23
}]
Did you pip install this? https://pypi.org/project/mysql-connector-python/
Yes
Yes it's still won't work
If you are still getting that same import error after installing that package, check your environment's Python config, because it's not seeing the right packages. Double-check how the Python 'profile' etc is set up.
Got to get it to work
I had to install the connector separately from mysql
I'm making a nice wrapper around tkinter. What's the lowest python version I should try supporting? 3.7?
Probably every 3.x that isn't EOL
so 3.9 as of today
are you sure about this
I am having the hardest time. I've scoured docs and used several resources online, but I can't figure out how to add a light blue background to tabs in my gui. How are we supposed to make this look good?
ttk widgets are more difficult to style, and at least on windows, several appearance options have no effect, but at least for widgets that support it, you can configure the root style with a background for all of them at once: ```py
from tkinter import Tk
from tkinter.ttk import Style
app = Tk()
style = Style(app)
style.configure(".", background="azure")
... ``` example: https://paste.pythondiscord.com/7LVQ
hmm, apparently you can also manipulate the layout of the treeview to replace its background element, but it seems somewhat annoying to do that manually
looks nice what did you use for the gui?
Looks like something web based
yeah it looks like an electron app
i would like a user interface that populates the entire wall in my room please 😌
Little projectors are super cheap now, and way better than they should be
I didn’t think about that. But who uses projectors for computing 
Working on a music player, does the UI look decent so far?
feel free to suggest things
It looks good, I would change the seconds display to a minutes and seconds display. That would look alot better
have you tried using custom tkinter
great for styling
I really need to learn that
I use regular tkinter for quick and easy GUI’d but custom would just make my work look so much nicer
Am I having a problem with this frame label even though it's just a normal label within the frame I'm following the video I typed the with the modification of it being smaller
Man why didn't anybody tell me about asciimatics, this seems neat.
what yall think of my server monitioring ui for my website id say its got some work but its almost there
need to create a cli using click module in pyhon
object is to create a automl pipline that will preprocess the data with help of ai
My first app :
this application coded with tkinter
please give me your opinion or the review in the application
I am fourteen (14) years old
I am from Morocco ❤❤❤❤❤
hi; I've deleted your messages containing links to exe files, since we can't validate the safety of those;
next time, consider sending a GitHub (or alternative) link to source instead
(also please don't spam the same text across random channels)
i like the colors
That's just my terminal's color scheme lol
but thanks
oh
Hi all! I was looking through the pinned messages in this channel and just wanted to say that Gooey https://github.com/chriskiehl/Gooey/tree/master?tab=readme-ov-file#examples is worth mentioning. It is super easy to use and fun for little side projects
I personally prefer Google's Fire cause it recognizes function/method parameters and auto generates the CLI from that, so there's no use for argparse
Ohhh very cool! I will give python fire a try. I guess the best use case for gooey is if you already had a terminal app that uses argparse and want to make it more user friendly. But I did not know about this. Thanks!
so i want to make a fuction that allow you to change the canvas size and i need help to make it work
c_width = 900
c_height = 500
window.title('draiwing app')
window.geometry("%dx%d" % (width, height))
window.minsize(m_width, m_height)
canvas = Canvas(window, width=c_width, height=c_height, bg='white')
canvas.pack()
def change_canvas_size():
global c_height, c_width, entry, entry2
c_height = int(entry.get())
def canvas_size():
global c_height, c_width, entry, entry2
Size_window = Toplevel(window)
Size_window.title('canvas size')
Size_window.geometry('400x100')
entry = Entry(Size_window, width=10)
entry.pack()
entry2 = Entry(Size_window, width=10)
entry2.pack()
button = Button(Size_window, text="button", width=10, command=change_canvas_size)
button.pack()
!cleanban 1137082364628058193 "3 days" Asking for jobs and direct copy/pasting from ChatGPT are not allowed.
:incoming_envelope: :ok_hand: applied ban to @woeful mason until <t:1745692249:f> (3 days).
def change_canvas_size():
global c_height, c_width # no need for global entry or entry2 here
try:
# Update canvas width and height from entry fields
c_width = int(entry.get())
except ValueError:
# Handle invalid input (non-integer values)
print(f"Invalid width was entered defaulting to current c_width: {c_width}.")
try:
c_height = int(entry2.get())
print("c_height:",c_height,"\nc_width:",c_width)
except ValueError:
# Handle invalid input (non-integer values)
print(f"Invalid height was entered defaulting to current c_height: {c_height}.")
# Resize the canvas
canvas.config(width=c_width, height=c_height)
def canvas_size():
global entry, entry2 # no need for global c_height or c_width here
Size_window = Toplevel(window)
Size_window.title('canvas size')
Size_window.geometry('400x100')
entry = Entry(Size_window, width=10)
entry.pack()
entry2 = Entry(Size_window, width=10)
entry2.pack()
button = Button(Size_window, text="button", width=10, command=change_canvas_size)
button.pack()
Qt provides an animation framework that should allow you to do some animations.
Here's an example with QPropertyAnimation which is probably the simplest out of these: https://www.pythonguis.com/tutorials/pyqt6-animated-widgets/
Thank you so much it works!
I made a custom module for tkinter from boredom```py
from tkinter import *
from q import *
mainWindow(Tk(),PACK_DISPLAY).title("Hello, World!").setDimension(480,360).setPosition([400,200]).s(q(Label(text="I am a text!"))).appendTo(getMainWindow()).s(q(Button(text="Click me!",command=lambda: getMainWindow().children[0].attr("text","My contents have changed!")))).appendTo(getMainWindow()).show()```
So first time using tkinter and I am trying to make dynamic text boxes (purpose being to populate them later much like a spreadsheet) What I am confused about is how one of these methods works but the other does not.
textBoxArray = [dateBox, chargeBox, amountBox, tagBox, noteBox]
# This loop creates them correctly
i = 0
while 0 <= i < len(textBoxArray):
textBoxArray[i].grid(column=i+1, row=1, sticky=N, padx=5)
print(i)
i = i +1
# This loop dumps them on top of each other
for boxes in textBoxArray:
gridOffset = 1
boxes.grid(column=gridOffset, row =1, sticky=N, padx=5)
gridOffset = gridOffset + 1```
You're assigning gridOffset = 1 inside the loop, not before it
You may enjoy enumerate here with a starting index of 1
hmm ok I need to not try and do classes with this first real attempt lol. just overcomplicating it for myself. But it is functionally getting there
How can I create a closeble tab similar to this
in what library/app/etc?
and like what parts of it are you trying to mimic primarily?
TKinter
Tk
You could try DearPyGUI
?
What is that
man i thought this was javascript for a second
cuz who tf uses camelCase in python Pain
I made a class to basically create 5 text boxes dynamically. So when I import csv data it will create how ever many rows of them it needs.
The reason for this is I'll be doing a db on the backend(which I already have Im just building a GUI from the ground up, previously CLI only).
The class:
class TextBoxBuilder:
# original test moved to TextBoxBuilder_test.py
instance_count = 0
def __init__(self, mainframe):
self.mainframe = mainframe
TextBoxBuilder.instance_count += 1
def createTextBoxRow(self, expenses):
# print(dir(self.mainframe))
print(expenses)
# self.mainframe = mainframe
dateBox = Text(self.mainframe, width=12, height=1)
chargeBox = Text(self.mainframe, width=30, height=1)
amountBox = Text(self.mainframe, width=5, height=1)
tagBox = Text(self.mainframe, width=15, height=1)
noteBox = Text(self.mainframe, width=60, height=1)
textBoxArray = [dateBox, chargeBox, amountBox, tagBox, noteBox]
i = 0
while 0 <= i < len(textBoxArray):
textBoxArray[i].grid(column=i+1, row=self.instance_count, sticky=N, padx=1)
print(i)
i = i +1
self.populateBoxes(expenses, textBoxArray)
def populateBoxes(self, expenses, boxes):
#this relies on one single entry, need to change its comprehension to handle multiple entries
date = expenses[0].strip("'")
charge_name = expenses[1].strip("'").strip()
charge_amount = expenses[2].strip("'")
boxes[0].insert("1.0", date)
boxes[1].insert("1.0", charge_name)
boxes[2].insert("1.0", charge_amount)
def main():
def file_import():
importfile.set(filedialog.askopenfilename(title="Select Expenses to Import"))
expenses = parse_imports(importfile.get())
update_TextBox(expenses)
if not importfile:
return
def update_TextBox(expenses):
displayExpenses = TextBoxBuilder(mainframe)
displayExpenses.createTextBoxRow(expenses)```
And my questions is if this is a good way to do this as I'll have several views that are like this as well as taking user input etc
I'll add that I know instance count isn't sustainable longer term but it worked as a POC for dynamic row numbers via the class. But that will be easy to handle later but just counting results from queries or imports and get counts from there.
If you just need simple rows that hold one line of text each, use Entry instead of Text
that being said, I'd consider using a different GUI library that actually has proper spreadsheet widgets
PySide6 has QTableWidget
Hmm I guess I'll take a look at entry instead and also pyside6
FWIW you might also be interested in tksheet if you want to stay with tkinter, it seems like a fairly comprehensive library for this:
https://ragardner.github.io/tksheet/DOCUMENTATION.html ```py
from tksheet import Sheet
data = ...
headers = ...
app = Tk()
sheet = Sheet(app, data=data, headers=headers)
sheet.enable_bindings("all", "edit_cell")
sheet.pack(expand=True, fill="both")
app.mainloop()```
ah thanks I will look at that. I did kinda of want to stick with tkinter since I decided to use and learn it. Maybe this library will make this easier. I am going to try and make Entry boxes work as well for the sake of learning. Fundamentally only a small component of all of this is actually csv, the rest will be from db queries which I know is functionally similar though technically different.
ahh, that sounds fair
Yea to add more information the purpose of this view is basically a check/edit opportunity before data from the csv is put into the database. After which all interaction with the data will be handled via the db. Though I was hoping I could create a module that I could use for any time I needed to display the data in an editable format.
hmm well I guess I have no funcitonal reason I need to stay with tkinter in general. I plan to make a web app version of this anyways maybe ill take a look at pyside6 after all, seems to have more capabilities and a more modern look which would be nice
eh screw it, not going to change libraries Ill just try and make tkinter do what I want.
hmm ok I think I need to change the structure from a list to a dictionary of lists so I can more reliably iterate through it
I like it!
im trying to use pyside now and can't get it to do async properly
QAsyncioEventLoop.create_connection() is not implemented yet
The usual way I see async stuff done within Qt in Python is with trio (they have an example in the docs). QtAsyncio is currently in technical preview so it's not there yet.
Hi, everyone! I'm new to Python and to programming, and kinda want to have an interface because I think it would get me something palpable, a sense of "this is getting done, finally", that just the lines of code do not do for me... That said, which free "GUI maker" do you recommend? Also, if I want to someday sell an app, there's any option to do code and interface entirely free?
i think it's easier to do the async stuff with a different class just for pulling data, and that class can be passed labels for the gui so it can write to them
I've got the data being collected, just no gui right now
Click here to see this code in our pastebin.
An inclusive subreddit for all Pagans regardless of theistic views or paths. We are a stronger community through diversity and inclusion.
Paganism is a term to describe the modern religions that have been revived, reconstructed, or inspired by the pre-Christian religions of mainly the European and Near East regions.
?
Yes, I use async code inside my pyside6 app extensively! I'm using qasync. You can see it in use at https://github.com/m6r-ai/humbug - the entry point that sets things running is here: https://github.com/m6r-ai/humbug/blob/main/src/humbug/__main__.py
i gave up and did it another way
do you use sockets?
i think pyside6 async shit the bed once i tried networking
(this is a modbus project)
this is where im at
I'm using aiohttp to make REST requests to AI backends. The AIs all stream their responses back as a series of server-sent events which could run for several minutes, and there could be quite a few such streams running at any one time
i think the issue was i could not use sockets within the qt async thread
it was not implemnted apparnetly
I've not tried socket-level access but the docs do talk about QTcpSocket and using non-blocking sockets - I've used similar approaches with other network stacks in the past, but not sure how well they work here
yeah im not making qpymodbus
i just send the data over a signal
seems to work just fine
Ngl tkinter canvas are hard to draw (especially coordinates system)
Can anyone explain to me??? I
i do
you got a problem with that?
https://github.com/GyanOp900/TheBiller I'm a beginner started about 9 months ago this is my first big project ya'll please give an honest rating bout it.
'TheBiller' is a sleek, modern desktop billing application tailored for small retail stores, kiosks, and general shops. Built with Python and PyQt6, it offers an intuitive and user-...
Why no screenshots
@bronze iron success!
Card transactions still have the WORST metadata/formatting, it's amazing to me circa 2025
How what would you recommend for hey out of the way interface that uses mysql?
What does "hey out of the way" mean here exactly?
You mean like an existing UI for MySQL?
Yes sorry it's currently 10:28 pm for me
I'm very tired but my ADHD is reminding me of everything
This one is pretty cool but only just has started to do Linux support; historically has been Windows https://www.heidisql.com/
HeidiSQL is a free and powerful client for MariaDB, MySQL, Microsoft SQL Server, PostgreSQL, SQLite and Interbase/Firebird
A lot of people use https://dbeaver.io/ at my company, unless they've recently switched..
I've still never really been as productive in anything again as I was in TOAD for Oracle 🫗
Agree, and that is ligtly sanitized for test data. the original is even worse and the formatting is worse too
developing a good importer for these formats is going to take much longer and so simplifying it to CSV for now was the only way to keep moving forward 
!pypi batgrl
Appreciate you
anyone know how to make the custom title bars w rounded corners and icons as the X etc?
its general package but it provides nice and easy setup tui functions: https://github.com/EliaOndacs/corelib
figured it out
I work hard today
I'm the same one know how to use the function for a radio buttons
This is why I have so far I wanted to make it smaller but having it fell on the x-aix
not quite sure what you are asking but it sounds like you want the two radio buttons closer together? Can you provide the code for them so we can analyze it. without seeing the code we cant really help
Bro, that design is great 👍
thats slick, love the color choices too
Anyone here know urwid?
looks like a neat library but sorry, none at all
Thanks. I have some pretty basic questions, but no one has used it here, it seems.
might be someone around to show up that has but if its basic have you tried the docs or similar? or I guess just ask your question directly and see if you get something
Yeah Ive spent a bunch of time looking at the docs. Its a conceptual thing, I think. Like I want to start super basic, and create an empty box, and I cant figure it out.
I no it's frowned upon by some people, but have you tried asking Ai like grok or gemini to get a better understanding?
No.
I've had some issues with documentation before. Maybe try to use Grok's Deepsearch function, has helped me before
Someone suggested another tool, Textual. Im going to look at that.
Goodluck!
Do you think I need to change from grid to place to get radio buttons closer to each other
:incoming_envelope: :ok_hand: applied timeout to @quartz hound until <t:1746841062:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Hi all, I'm looking for a little help with a issue I'm having with Kivy in Python
Full context and issue is here:
https://stackoverflow.com/questions/79615076/image-not-reloading-kivy-python
https://discord.gg/HCpRYpdm discord link to official kivy group
Im going to make an interface IDE like thing for python and call it TkinterFace
anyone wanna help me out
i work for this like 2 weeks
i want to create a app for pc, something that is flexabile and has lots of customabilty to design and im not sure what langauge, anyone got any ideas (not python)
I mean this is a python server so if you dont want to use python then wrong place to ask
realstically this is the best use of AI when it comes to programming cause you actually could learn something instead of having it do it for you so its fine imo
I'm making a pyqt app for a node-based editor (which will be made into a plugin for another Qt application). I have a problem where the node's input widgets within a QGraphicItem don't get updated/repainted when interacted with (i.e. QLineEdit widgets don't show the cursor, nor what is being typed). The widgets get updated when I click away from the node, then select it again; or when interacting with a QComboBox, for some reason that works just fine).
This is my class which contains the widgets:
from PyQt5.QtWidgets import QWidget, QVBoxLayout
from PyQt5.QtGui import QColor
from QpnSettings import QpnSettings
class QpnNodeContentWidget(QWidget):
def __init__(self, parent=None):
super().__init__(parent)
self.layout = QVBoxLayout()
self.layout.setContentsMargins(0, 0, 0, 0)
self.layout.setSpacing(0)
self.setLayout(self.layout)
palette = self.palette()
palette.setColor(self.backgroundRole(), QColor(QpnSettings.NodeContentBackgroundColor))
self.setPalette(palette)
self._count = 0
self.setFixedSize(0, 0)
def AddWidget(self, widget: QWidget, newWidth: int):
widget.setUpdatesEnabled(True)
self.layout.addWidget(widget)
self.setFixedSize(int(newWidth), int(self.height() + widget.sizeHint().height()))
self._count += 1
return self.height() - (widget.sizeHint().height()/2)
Well, I found a solution, but it's probably not the best solution. Doing this, absolutely slams a CPU core to 100% (but it fixes the issue). This is the node class which holds the proxy widget for the node content widgets. I added a line in the graphic items's paint() function to update the widget proxy.
class QpnNode(QGraphicsItem):
def __init__(self, title="Undefined Node", parent=None):
super().__init__(parent)
self._title = title
self.inputs = []
self.outputs = []
self.inputWidgets = []
# UI Elements
self._titleBar = QGraphicsSimpleTextItem(self._title)
self._nodeContent = QpnNodeContentWidget()
self._nodeContentProxy = QGraphicsProxyWidget(self)
self._nodeContentProxy.setWidget(self._nodeContent)
self.InitUI()
def paint(self, painter: QPainter, option: QStyleOptionGraphicsItem, widget=None):
# Node paint code hidden for brevity
...
# Force update the content widgets
self._nodeContentProxy.update()
There's gotta be a better way to do this.
Guys
I am working on an interesting open source project, back-end is almost done, but I was hoping if anyone would like to contribute to build the ui
I hate designing
without knowing what your proxy widget does, is the 100% load problem that in updating the proxy you also retrigger the paint? I've had that sort of thing happen in the past. Your original problem sounds like there's probably one or more events you need to listen to and that may need you to and that need to trigger some form of update that will in turn repaint your widget? I had a few weird problems that sound similar to what you've described a few months ago when I built a terminal emulator widget but found I wasn't updating a viewport correctly sometimes
You could just share the repo link and people could look but this isnt like a recruitment board or anything
@wheat ether This is the class that the proxy widget holds.
Hi Guys, I’m a Product Designer with 5 years of experience and a strong passion for solving real-world problems through thoughtful, intuitive design, whether it’s helping users interact with immersive XR environments, navigate complex government systems, or engage with AI tools that enhance daily life. I’m excited to bring my skills to a team where design drives impact and innovation.
Let's connect and discuss your project..
!rule 9
That's probably a bot account
Yea probably
It's not completely Open source, 😅
Why are bot accounts allowed?
"allowed" is not what that is
they arent but its not like there is some simple way of auto deleting bots. especially when they dont post certain things like forbidden urls, etc
Oo
I mean you could share the part that is but if you are looking for like an actual dev partner you should try a different site for like contract work or similar.
Thx for advice
Do I need to use a button to key behind information?
What does the GUI do?
🥲 hard to explain back
It helps user to convert lectures video into notes
So the youtube button, opens youtube within it
And notes button open notes
(in very short)
How about a timer and a point system
I'm sorry that I didn't understand it at first but maybe something underneath just so people who don't use a pad in paper and then average or an area lines when they're not on the computer can understand and if you put an appoint system and assign points to if it's the video is a lecture and you spend time on it instead of having them be able to open YouTube and then do whatever you were paying retention because people don't want people points to be going down and what if you added a quiz button that quiz you on the lecture that you're currently doing you know you paste in the URL and it generates a quiz and it giving you points that can be used to make their notes Fancy ect
Thats a Great idea
But I thought copy pasting url might break the momentum, won't it look like an extra burden like external
Extra task
Btw it has the quiz things
I know it might seem odd to have him paste in then you are out but think about it so that they don't have to look for the same video 100 times by using the same keywords and it popping up different it just seems people time in essence
Well it's an idea
Is there hover effects? I think it be a nice addition to add a on hover to show the title of the buttons and cool animations :O
!e```py
Geometry_1 ("!x!")
Geometry_2("?x?")
Root.geometry(Geometry_1)
If con_1 == "" and con_2 =="" :
Root.geometry(Geometry_1)
Is this how I can change the screen size in my programs
Hover effect on button
No ads, please.
Is it possible to change the geometry using an if statement
Which gui library u are using
I changed the geometry of the main window with the press of the button
(looka like u are using tk ?)
yo looks cool what is this
I am making ai /llm powered learning tool
Like video lecture into detailed notes
Gives you flashcards
Quiz
oh damn nice
you can always cross question
But I don't know much about ui design
honestly at the question of designing a UI a good place to start would be to look for examples that you like and would want to use and incorporate inspiration from those into your own.
https://paste.pythondiscord.com/EPUQ @agile cargo
Is this okay for my root?
:incoming_envelope: :ok_hand: applied timeout to @light vigil until <t:1747429107:f> (10 minutes) (reason: newlines spam - sent 125 newlines).
The <@&831776746206265384> have been alerted for review.
Can someone can help me figure out why I am unable to get the scrollbar to show up in this test code using tkinter? https://pastebin.com/SqG6mGda
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
it looks like it's being covered up, but I thought the whole point of a grid layout was that the widget in column 0 wouldn't cover the widget in column 1
I got it to work by changing the master of the widgets in ScrollableFileList to None, though I don't know why that works. It was just something I found after hours of searching the internet.
also, by doing this the position of the individual components in ScrollableFileList belong to, and are placed in the grid of the root window, which doesn't seem to me like it's in the spirit of grouping widgets together into custom ones.
master=None just means to use the root widget as the parent, that being Tk(), but your original code was on the right track - i believe the issue was on line 29, you forgot to pass the parent widget to the Listbox superclass, so it became a child of the root widget and not ScrollableFileList, then by calling file_list.grid(row=0, column=0, ...) with the same grid coordinates as the scrollable file list, the listbox completely drew over your frame and obscured it
you can tell by setting sticky="W" on just the file_list, it draws the listbox on the side and you can see that the scrollbar was hiding under it
and just adding super().__init__(master, ...) in your FileList class fixes your code snippet:
Thank you.
I made a prototype game i tkinter and someone suggested to convert it into pyside6 but I've never used pyside6 before and I'm having problem converting it into pyside6 do you guys think it's worth it to convert into pyside6?
this is the game in tkinter
Your in #user-interfaces on a python server?
i talked about this on #game-development and someone recommended I talk about this in userinterface
nevermind I don't think you're talking to me
Sorry for the confusion. I was talking to @humble agate
cute penguin
Appreciate it
Are there features you're struggling to implement in tkinter for this game?
so I haven't came up with a lot of features yet but I will and it possible that some things I want to do I won't be able to do in tkinter but i could just come up with something else that works with tkinter
it's also just nicer to have a more up to date version
It's probably worth it if you're interested in learning more about GUI
What you have so far wouldn't be too hard to recreate in PySide with a bit of know-how
Has anyone tried to use the native asyncio support in PyGObject lately?
Basically importing the GLibEventLoopPolicy class from gi.events??
Asking because I can't just make that import
Despite having the latest version of PyGObject installed
I have a issue up here
I have a markdown text
I want to render it
I am using pyside6
Can anyone help me out in how to render the markdown text format
You could use QTextEdit which supports setting text as Github-flavored Markdown (via QTextEdit.setMarkdown()). If you need more features though, then you could get a Markdown-to-HTML converter such as mistune and render to HTML using the Qt web engine.
My text output response comes out as stream, just like chatgpt, so when I used this it was only showing single letter at a time
How do I make it so as soon as the text something in the interface it changes the geometry of the room and then replaces everything on the widget
!e```py
Geometry_1 ("200x200")
Geometry_2("400x400")
Root.geometry(Geometry_1)
con_1 = 'x'
Con_2= 1
If con_1 == "x" and con_2 =="1" :Root.geometry(Geometry_1)
:x: Your 3.13 free threaded eval job has completed with return code 1.
001 | File [35m"/home/main.py"[0m, line [35m9[0m
002 | If [1;31mcon_1[0m == "x" and con_2 =="1" :
003 | [1;31m^^^^^[0m
004 | [1;35mSyntaxError[0m: [35minvalid syntax[0m
!e```py
Geometry_1 ("200x200")
Geometry_2("400x400")
Root.geometry(Geometry_1)
con_1 = 'x'
Con_2= 1
If con_1 == "x" and con_2 =="1" :Root.geometry(Geometry_1)
:x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 9
002 | If con_1 == "x" and con_2 =="1" :Root.geometry(Geometry_1)
003 | ^^^^^
004 | SyntaxError: invalid syntax
I've literally just been building something that sounds very similar to this - something that takes AI streams and renders the markdown from the chat conversation into a QTextEdit. There are couple of minor things not yet supported (blockquotes being the main one). The project is open source so if helpful you can read through the markdown parser and the markdown renderer - https://github.com/m6r-ai/humbug
Dude thanks for your insight I will surely take a look on this
Btw I figured out using markdown library and bs4
(in pyside6) is there a way to set a the font of 12 QLabels without having to do it for each one (I want to avoid: 12 Lines of code setting the font for each one)?
Yes mate
There are two ways
You can loop through the list
Or set-up custom stylesheet
from PySide6.QtWidgets import QLabel, QApplication, QWidget, QVBoxLayout
from PySide6.QtGui import QFont
app = QApplication([])
window = QWidget()
layout = QVBoxLayout(window)
# Create labels and store them in a list
labels = [QLabel(f"Label {i+1}") for i in range(12)]
# Set a common font
common_font = QFont("Arial", 14)
# Apply the font in a loop
for label in labels:
label.setFont(common_font)
layout.addWidget(label)
window.show()
app.exec()
Or you can directly setup the stylesheet
Ok thanks
Did it really work for u ?
I haven't implemented it yet,
hii!! is it better to use pyqt6 to just stick to pyqt5? for gui apps
qt5 is pretty-much completely out of support now (even for people who paid for support) - unless there's a good reason not to then qt6 is a good bet (I've been using it for the last few years and very happy with it)
Difference also shouldn't be too drastic, apart from some deprecations and rearrangements, but the code should remain mostly the same.
# import
import time
import random
import datetime
from lists import *
from tkinter import *
import mysql.connector
from tkinter import ttk
from tkinter import messagebox
class registration_sys():
def __init__(self,root):
self.root = root #sets up main window
self.root.title("log in")
self.root.geometry(log_in_geometry)
# user log in
UserName_entry = ttk.Entry(self.root,
font= standerd_font,
width=20)
Password_entry = ttk.Entry(self.root,
font= standerd_font,
width=20)
UserName = UserName_entry.get()
Password = Password_entry.get()
# entry boxes
UserName_entry.place(x=100,
y=270)
Password_entry.place(x=100,
y=320)
#button
sign_in_button = Button(root,
font= standerd_font,
text="sign in")
sign_in_button.place(x=159,
y=390)
#window sizes
if UserName == "silvercross" and Password == "17":
print("jj")
root = Tk()
ob = registration_sys(root)
root.mainloop()```
Anyone else find the tkinter documentation pretty painful to read? -_-
the one in the python docs? i cant recall the last time i looked at that page after i found out about TkDocs and tcl/tk's API reference
Like these
https://www.tcl-lang.org/man/tcl8.6/TkCmd/ttk_frame.htm
I find their formatting to be very hard to read or confusing much of the time
Maybe I'll try the python docs one
ah, i think their API reference isn't great for learning since it lacks any form of tutorials/guides, but it's at least a decent reference and has some useful explanations scattered around there (e.g. pack -> the packer algorithm)
for learning tkinter and Tk's concepts, i find TkDocs substantially nicer in that regard
https://tkdocs.com/tutorial/intro.html
Introduction: Part of a Modern Tk Tutorial for Python, Tcl, Ruby, and Perl
yea I like that site but the info on it is extremely limited which is where I struggle. I find it enough of a hassle I am strongly considering changing my project over to PySide or PyQT.
like trying to do combo boxes just now and for one the tutorial image shows like 5x what the 'sample code' is so there is just no explanation there nor is there a coerrelary between that page and the full docs.
please how to correct this problem
!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.
post code and errors as text not screenshots.
ok
There was an error uploading your paste.
the erreur is ichiers sélectionnés : ['C:/Users/p131242/OneDrive - Alliance/Outils_MTM/MTM_Dev/Code_MTM/All_Acquis/27_11_2024_Flexivan_SV159_91X7_Test2_Part15_UC60.dat']
📥 Chargement : C:/Users/p131242/OneDrive - Alliance/Outils_MTM/MTM_Dev/Code_MTM/All_Acquis/27_11_2024_Flexivan_SV159_91X7_Test2_Part15_UC60.dat
collecting_data: 0.94s
metadata_extraction: 0.00s
🚨 Erreur dans test2 : The future belongs to a different loop than the one specified as the loop argument
that looks great, also lol "pirated games".... 
haha
can you provide the full traceback of the error. as that text doesnt match the error message
📥 Chargement : C:/Users/p131242/OneDrive - Alliance/Outils_MTM/MTM_Dev/Code_MTM/All_Acquis/27_11_2024_Flexivan_SV159_91X7_Test2_Part15_UC60.dat
collecting_data: 0.91s
metadata_extraction: 0.00s
🚨 Erreur dans test2 : The future belongs to a different loop than the one specified as the loop argument
much more readable, and the amount of pirated games increased a good bit ;D
okay bad news
I added a robocopy feature
where u can mirror drives
and I forgot to add like 4 step verification
so I managed to mirror my D drive to my C drive
my 2 tb ssd to my 1tb ssd in other words
that’s how that went
I managed to save everything and quit it before it took my whole system but it managed to delete all my steamfiles and put them somewhere random
and some other files
so im not sure what it fucked up
so I took all my save files and the project and reset the pc
I was practicing very bad programming
that’s like fucking with the electrical grid but not turning off the power
oh well
It’s been half a year
it was time for a reset anyways
"teaching moment" as they are called
now I get to reinstall all my apps tho
Should be fun
indeed, recently upgraded to win11 so I feel that
upgrade…
well microsoft's version of 'upgrade'
Where technically we didnt 'delete' anything, but still broke over 70% of your apps
I like windows 11, but its still a bit buggy
yeah bc my windows was luckily on the drive I didnt mutilate
that is lucky, otherwise you probably would have just hard crashed and not been able to stop it
so it all just transferred over to that but then something must’ve messed up alobg the way
woulda lost all my files lol
robocopy is dangerous business
yup, that aisde I really like your ui though. impressed its Tkinter personally. Been having a lot of headaches with it myself lately, mostly documentation related
chatgpt knows a lot about it
I was struggling myself
its surprisingly good with ui