#user-interfaces

1 messages · Page 57 of 1

fading kraken
#

Hello I am 9th grader and i'm trying to create an app which live streams arduino data on to your phone. I am using kivy to create this app but I dont know how to create a bluetooth interface with the app I have alredy figured out how to create a live plot with kivy I just need to get the data from the arduino via bluetooth to the mobile app

merry zodiac
#

Hey guys, I'm trying to load database entries into a Tkinter window, is there something magic like C# WPF has data binding and MVVM?

digital rose
#

interest anyone?

spark crest
#

Hello im trying to make it so a label prompt will pop up in a tkinter window for only 5 secs (temporary) then it'll disappear, anyone know how to do it? Thanks

desert rose
#

@digital rose Just saw this on the subreddit

#

Im having trouble with PyGui

#

instead of just the window

digital rose
#

dm me

desert rose
#

Okay

past locust
#

@spark crest if youre trying to make a popup/prompt, just use the tkinter.messagebox!

#

Here's an example:
`from tkinter import *
from tkinter.messagebox import showinfo
def showpop():
popup=showinfo("hey","sup user")

window=Tk()

popupbut=Button(window,text="popup",command=showpop)
popupbut.place(x=0,y=0)

window.mainloop()
`

#

@spark crest

digital rose
#

correct me if im wrong but why use tkinter?

past locust
#

He asked for implementation in tkinter lol

#

Hello im trying to make it so a label prompt will pop up in a tkinter window for only 5 secs (temporary) then it'll disappear, anyone know how to do it? Thanks
@spark crest

digital rose
#

but why

past locust
#

Why not?

digital rose
#

use pygui man not cool

#

same excat thing just ones easyer and can do more

spark crest
#

you cannot customize the color bg font etc in pygui if im correct

digital rose
#

LOL

#

cap

spark crest
#

@spark crest if youre trying to make a popup/prompt, just use the tkinter.messagebox!

digital rose
#

you can

spark crest
#

thanks will try

digital rose
#

in fack theres an entire gui that does that built in

spark crest
#

oh i see, i didn't know you can customize them

past locust
#

@digital rose every gui has its pros and cons. I will not get into whats better and what not. People use whatever they want to, depending on their needs.

digital rose
#

i understand

#

but this really removes the needs for others

#

its a all in one

past locust
#

And who said u cant do more in tkinter??

digital rose
#

tkinter can set back ground other than that there the same

#

and there working on adding that

#

and then some

#

and its easyer

spark crest
#

eh they're both good, maybe pygui is easier for others, and maybe tkinter is easier for others?

digital rose
#

yes i can agree

#

but pygui is basicly english

spark crest
#

haha

digital rose
#

but simpler

#

see

#

ok gn

spark crest
#

hmm @past locust im getting an error saying 'showinfo' is not defined

#

its a function right

#

nevermind its fixed i just used pygui instead haha

#

thanks anyways its still help

past locust
#

@spark crest u can do :
`from tkinter import messagebox

si=messagebox.showerror("hey","there was an error")
`

#

Instead of using showinfo() @spark crest

#

Never mind u used pygui

pure wedge
#

is flaskwebgui good

spark crest
#

Thanks anyways :DD

fluid tinsel
#

when I remove the syntax highlighting, it runs perfectly.

#

nevermind, it’s just some weird things with regex, ^ wasn’t escaped and when it got added to operators, it broke it.

teal hearth
#

In PyQt5 :

I have a bunch of buttons in a UI that I have set up. when the user clicks any of these buttons it's color changes to yellow. i am using the button.setStyleSheet("color: rgb(255,255,0);') to change the color to yellow.

If the user clicks another button I want the color of that to change to yellow and the previous one to change to white. in order to do that I need to run a loop with an if condition and check which buttons are already yellow. can someone help me with the code to retrieve that earlier set yellow.

fluid tinsel
#

according to what I understand, you need to run a loop in a PyQt5 program, for your own events, which stops it.
you can use a ‘thread’ that carries the loop.
here’s an example:

import threading
from PyQt5 import ...

def EventLoop():
    while True:
          ...

thread_instance = threading.Thread(target=EventLoop, daemon=True)
thread_instance.start() # permanent thread
# rest of your app
teal hearth
#

@fluid tinsel was that for my question ?

#

I dont understand that answer . Im sorry. I just want a way to retrieve the stylesheet color of a button

pure wedge
#

how do i make a gui with html and css for python?

fluid tinsel
#

you can set a variable with it’s color.

bronze basin
#

@fluid tinsel was that for my question ?
@teal hearth if you want the loop to be running while the GUI is also running

#

you have to use multi-threading

#

cause it will interrupt your main event loop

nocturne fog
#

helloo

#

im currently designing a gui for an axe throwing game

#

i just couldnt figure out how you integrate a fullscreen picture

#

i prepared one for the background

#

but it has these terrible borders up and down, left and right

#

i included the prepared picture for the background via tk.Label()

#

i tried the fill and expand option but they dont apply to images

#

any ideas on how to get a borderless fullscreen picture?

past locust
#

@nocturne fog u need to use a game library. Tkinter is a GUI module. Use something like pygame, and try asking in #game-development

nocturne fog
#

aight thanks @past locust

teal hearth
#

@bronze basin not that advanced at all yet. I don't think I can get that working

bronze basin
#

@teal hearth but if you want a loop that runs all the time while your GUI is also showing

#

this is what you have to do

#

maybe you can learn a bit more about PyQt in general and its multi-threading features and come back to it?

digital rose
unique forge
#

Hi, I want to update my current app created with PyQT5/ QT Designer One of the things I want to add is a setting where I can enlarge and decrease the font size of the text inside QLineEdits. How can I do this. Thanks, Famous8

maiden dragon
#

does what I am doing here make sense

from tankui import DeethanizerApp

class loadingapp(wx.App):
    def OnInit(self):
        self.frame = loadingdlg(None)
        self.SetTopWindow(self.frame)
        self.frame.Show()
        return True

class makeapp():
    def __init__(self):
        if doload == 0:    
            if __name__ == "__main__":
                app = loadingapp(0)
                app.MainLoop()
        if doload == 1:
            if __name__ == "__main__":
                app = DeethanizerApp(0)
                app.MainLoop()
makeapp()
#

basically i want to open up a dialog that selects which all to run with a dropdown menu then close that app and run the slected one

#

!paste

#

i am using wxpython by the way

digital rose
#

hellow....? anybody here to help?

#

i want to ask How do you Flash A text in PyQt5?

#

Just like a warning text but animating after a specific interval of time,

unique forge
#

Hi, I want to increase the font size of all text in a PyQT5 UI with a Horizontal Slider, does anyone know how to do this. Thanks, Famous8

teal hearth
#

@bronze basin . I will do that. Thank you

visual stag
#

Which library would you recommend for cross-platform GUI in Python? I'm wondering how well PyObject would compare to PyQt, PySide, etc

digital rose
#

ok how do I create a tkinter gui

#

to control

#

my discord bot

visual stag
digital rose
#

I mean

#

yess

#

*yes

#

but linking it to discord

visual stag
#

There's probably a REST API, which you can adapt as I was demonstrating with this

deep hornet
#

hi

digital rose
#

how do i make a simple GUI?

#

hi

deep hornet
#

@digital rose

#

how do i make a simple GUI?
@digital rose use tkinter

digital rose
#

like an OK button

deep hornet
#

i am giving the code

digital rose
#

whats that

#

pip install tkinter?

deep hornet
#

no

digital rose
#

oh

deep hornet
#

it is by default there

#

wait

digital rose
#

or you could use something better

#

what?

#

like dearpygui

#

i only wanna make an OK button and a link

#

easy

deep hornet
#

kivy or pyqt5 but htey arew tough tkinter is the easiest

digital rose
#

no dear is the easyest

#

i am a beginner in GUI

#

it even has a gui to make things easyer

#

oh ok

deep hornet
#

ok

digital rose
#

so do i pip install it?

#

yes

#

then?

#

but make sure pip and stuff are up to date

#

they are

#

good

#

heres the cmd

#

updated a week ago ig

deep hornet
#

from tkinter import *
screen = Tk()

screen.mainloop

digital rose
#

whats this?

#

pip install dearpygui
or
pip3 install dearpygui

#

then dm me for example code

deep hornet
#

but tkinter is the easiest

digital rose
#

no

deep hornet
#

it comes by default and it takes 3 lines to create a screen

digital rose
#

same with this

#

and

deep hornet
#

but this is not popular

digital rose
#

it has guis made to make it easyer

#

no its not popular bc it just came out

deep hornet
#

tkinter is more popular and easier according to google

digital rose
#

google doesnt even know this exists

deep hornet
#

lol

#

i have searched 3 websites and tkinter is more easier

digital rose
#

im not here to argue

#

im just saying what i use

deep hornet
#

@digital rose use tkinter more easier faster, and comes by default no need to doanload

digital rose
#

do whatever

deep hornet
#

im not here to argue
@digital rose sry me too

#

actually both are awesome

#

we should never disrespect anything

#

@digital rose

digital rose
#

yes

deep hornet
#

so fight solved

digital rose
#

yes

#

use what ever you want

deep hornet
#

yes

#

it depends from person to person

digital rose
#

but.. this has built in guis for colors, buttons and text

deep hornet
#

ok

#

bye

digital rose
#

ok

#

bye

deep hornet
#

lets be freinds

digital rose
#

ok

deep hornet
#

yes

visual stag
#

tkinter strangely enough isn't often installed by default on Linux distros, and it can't be installed through pip

digital rose
#

lol rlly?

#

isnt linux made with programmers in mind?

visual stag
#

Obstensibly yes, but there's often this focus on keeping the base OS lean and anything else needed is available in the package manager like so: sudo dnf install python3-tkinter

#

But I feel that tkinter is one of those packages that should be preinstalled because Python is used everywhere on Linux and tkinter is a de facto standard for the language

deep hornet
#

lol

vale flint
#
from tkinter import *
import time

root = Tk()

root.title("Pomodoro Timer")
root.geometry("300x300")

root.config(background="#45b3e0")

#functions
def countdown(t):
    while t:
        mins, secs = divmod(t, 60)
        timer = '{:02d}:{:02d}'.format(mins, secs)
        print(timer, end="\r")
        time.sleep(1)
        t -= 1
        seconds.config(text=str(secs))
        minutes.config(text=str(mins)) 

#creating labels
global minutes 
minutes = Label(root, text="0", font=('Helvetica Neue', 20), bg="#c9e9f6", fg="#898b8a")   
minutes.place(x=60, y=80, width=80, height=80) 

minuteLabel = Label(root, text="MINUTES", font=('Helvetica Neue', 10), bg="#c9e9f6", fg="#898b8a")   
minuteLabel.place(x=60, y=170, width=80, height=20) 

global seconds
seconds = Label(root, text="0", font=('Helvetica Neue', 20), bg="#c9e9f6", fg="#898b8a")   
seconds.place(x=150, y=80, width=80, height=80) 

secondLabel = Label(root, text="SECONDS", font=('Helvetica Neue', 10), bg="#c9e9f6", fg="#898b8a")    
secondLabel.place(x=150, y=170, width=80, height=20) 

countdown(5) 

root.mainloop()
#

hey guys, im trying to create a countdown timer but it doesnt seem to be working 😭 please help

deep hornet
#

hi

lost dragon
#
def TimeTable():
    Button(style='TimeTable.TButton', text="TIMETABLE", command=TT).grid(column=1,row=1)

def loop():     # Time Display       
            l=Label(text=current_time(), style='Time.TLabel')   # Creates a Label with the current time
            l.grid(column=0, row=0)   # 'pack's the label
            Win.update()    # Updates the GUI
            Win.after(1000, l.destroy())    # Destroys the Time Display Label after 1000ms
            loop() # Re-calls this function
TimeTable()
quitBUT = Button(text='QUIT', command=Win.destroy)
quitBUT.grid(column=0,row=1)
loop()

How would I put TIMETABLE right next to QUIT

digital rose
#

{PyQt5} Hey guys, i wanna ask How do you use the accept and reject function of QdialogBox?
in my case i want to get the value of Comboboxes whenever the ok button is pressed

tacit sky
#

i am making a palgiarism checker for uni project

#

can anyone recommend the best python UI i can use , like user has to upload the file and all

bronze basin
#

Pyside2

modern marsh
#

i have learnt tkinter enough to create ok GUI's that serve my purpose

#

now i am seeking for a GUI that is more aesthetically pleasing

#

any suggestions?

#

ping me 🙂

bronze basin
#

@modern marsh Pyside 2

modern marsh
#

hmm ok

fluid tinsel
alpine yarrow
#

aaa

bronze basin
#

@fluid tinsel weird. try increasing the size of the textbox or smth that will make its resolution more detailed

digital rose
#

Hey guys

#

I need help with loading multiple images from different URLs in tkinter GUI

silk basin
#

Would anyone know how I could convert this popout menu to a simple dropdown box in PyQt5? I am assuming QComboBox but I don't know to get a grid inside of a QComboBox.

eager beacon
#

Use a listView in the combo and a QStyledItemDelegate

silk basin
#

I will have to do research on both of those lol. No clue what they are

eager beacon
#

would probably be easier to convert that to a frameless widget and create a label that looks like a combo drop down that when clicked opens the framelessWidget under the label

#

If that is an actual QMenu you could use a tool button with menuButtonPopup mode and set the menu to the toolbutton

#

that would be the easiest way to do what you're trying to do

silk basin
#

@eager beacon I will give that a shot! thanks for the suggestion

silk basin
#

@eager beacon This is what I am trying to do but it doesn't seem to be working like I want it too

near arch
#

any idea how to display Gifs in Tkinter?

#
def RunGIF(icons,tail,head,ImageNumber,img,panel):
    print(ImageNumber)
    ind = 0
    GifFrame = os.path.join(head,tail)
    while True:
        if '.gif' in str(tail):
            try:
                im = Image.open(GifFrame)
                resized_im = im.resize((128,128,),Image.ANTIALIAS)
                tk_im = ImageTk.PhotoImage(resized_im)
                panel = Label(window, image=tk_im)
                panel.place(x=400,y=20)
                print(ind)
                #sleep(0.01)
            except:
                ind=0
        else:
            tl.cancel()
            break
def showIcon(ImageNumber,icon):
    global Iconwidth, Iconheight,Infos,img
    gifs = 0
    x = icons[ImageNumber]
    img = Image.open(x)
    Iconwidth, Iconheight = img.size
    img = img.resize((128,128), Image.ANTIALIAS)
    img = ImageTk.PhotoImage(img, format="gif -index 0")
    panel = Label(root, image=img)
    panel.image = img
    panel.place(x=400,y=20)
    test = 0
    head, tail = os.path.split(x)
    File_size = round(os.stat(os.path.join(a,tail)).st_size/1024, 2)
    Infos = Label(root,text=f"Filename: {tail}\nFile Size: {File_size} KB\nDimensions: {Iconwidth} x {Iconheight}\nWidth: {Iconwidth} Height: {Iconheight}")
    Infos.place(x=380,y=210)
    t1=threading.Thread(target=RunGIF,args=(icons, tail,head,ImageNumber,img,panel))
    t1.start()```
this is what i have
#

but the gif dont move idk why

plain elk
near arch
#

that doesnt seems to work

#

@plain elk

fluid tinsel
main cedar
#

guys so im having a problem, pretty basic

#
field = Entry(root).insert(0, 'Sample text')
field.pack()

root.mainloop()
#

and this is the error im getting

#
Traceback (most recent call last):
  File "/home/joshua/PycharmProjects/gui/main.py", line 22, in <module>
    field.pack()
AttributeError: 'NoneType' object has no attribute 'pack'
#

it does work when i do

field = Entry(root)
field.insert(0, 'Sample text')
field.pack()

root.mainloop()
#

but isnt .insert() a method of Entry()?

inner nest
#

Entry has an insert() method @main cedar

#

maybe you can pack your entry before inserting ?

deep hornet
#

@main cedar put the thign like sample thing in like this text="brtyyh"

main cedar
#

Ohhh much better

#

Thanks!

obtuse pumice
#

Difference between PyQt and PySide?

rocky dragon
#

Mostly the licensing

obtuse pumice
#

What about documentation? I'm a complete beginner

tacit sky
#

is pyqt5 totally free?

next hare
#

yes

plain elk
#

only if you open source your project and use the GPL

tacit sky
#

like im making this for UNI

unique forge
#

@tacit sky PyQT5 is your best bet

#

also it has QT Designer, which is a drag and drop interface

bronze basin
#

Difference between PyQt and PySide?
@obtuse pumice Pyside 2 has more flexible licensing

obtuse pumice
#

@bronze basin What about quality of documentation?

bronze basin
#

its good i guess comparatively and both their syntax and features are basically the same

#

so 99% of the things you learn in Pyqt you can do in Pyside 2 and vice versa

obtuse pumice
#

Okay, i will start with pyside then

unique forge
#

Hi, I want to increase the font size of all text in a PyQT5 UI with a Horizontal Slider, does anyone know how to do this.
also I want the QLineEdits to expand to the size of its contents. I have multiple QLineEdits, but the output is always different, and I want it to expand to the size of its contents also how can I do this. Thanks, Famous8

maiden dragon
#

anyone around that could help with some basic wxPython stuff?

plain elk
#

like what?

maiden dragon
#

so i had an app that was running fine but i wanted to have an interface that opens before the app opens

#

so you can select which file to use

#

and now i just cant get things to start

#
class makeapp():
    def __init__(self):
        if doload == 0:    
            if __name__ == "__main__":
                app = loadingapp(0)
                app.MainLoop()
        if doload == 1:
            if __name__ == "__main__":
                app = DeethanizerApp(0)
                app.MainLoop()
makeapp()
#

basically i cant lauch the Deethanizer app properly now

#

does it have to do with "name == "main"" because no articles can seem to dumb it down enough for me as to what that does

plain elk
#

it means something like
if this is the starting script

so if you run the script directly it's True and if you import the script it's False

maiden dragon
#

this is what it used to be

from tankui import MyApp
import wx.lib.inspection

if __name__ == "__main__":
    app = MyApp(0)

    #This is its own GUI/application it is used to help debug wxpython and show you various elements of the app
    #wx.lib.inspection.InspectionTool().Show()

    #Makes the application visible
    app.MainLoop()

MyApp renamed to Deethanizer App

plain elk
#

You should try to debug it

maiden dragon
#

the vscode debugger has always been pretty confusing to me

plain elk
#

like, if you try to print a message, does it print?

#

is doload ever 0 or 1?

maiden dragon
#

yeah i mean hypothetically it runs because i get an error that something down the line isnt found

plain elk
#

idk

maiden dragon
#

yeah hold up

plain elk
#

oh

maiden dragon
#

!paste

plain elk
#

then maybe post the error? xD

maiden dragon
#
(base) C:\Users\Nicks\Desktop\Deethanizer V4\HYSYSapp>C:/Users/Nicks/anaconda3/python.exe "c:/Users/Nicks/Desktop/Deethanizer V4/HYSYSapp/source1/main.py"
Traceback (most recent call last):
  File "c:\Users\Nicks\Desktop\Deethanizer V4\HYSYSapp\source1\tankui.py", line 869, in OnInit
    self.frame = MyFrame(None, wx.ID_ANY, "")
  File "c:\Users\Nicks\Desktop\Deethanizer V4\HYSYSapp\source1\tankui.py", line 300, in __init__
    self.hyComAPI = ComAPI()
  File "c:\Users\Nicks\Desktop\Deethanizer V4\HYSYSapp\source1\hyComAPI.py", line 26, in __init__
    self.simulation = self.hysys.SimulationCases.Open(resource_path(r'deethanizer_ts.hsc'))
  File "<COMObject <unknown>>", line 2, in Open
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -1072879842), None)
OnInit returned false, exiting...
#

like i know sort of what this error means but given that nothing changed in the script there it shouldn't even be an issue

#

@plain elk i was being silly i forgot you need to be connected to a VPN to run my program requires a connection to validate a license

plain elk
#

Oh. Glad you figured it out ^^

maiden dragon
#

still some issues but not a matter of it plin out not working

#

like its way slower than i would imagine which is odd

median ridge
#

not python related but just general - after creating a ui design in figma or adobe, how do you go about implenting it

uncut pawn
#

I am trying to install a package but it is saying"Fatal error in launcher: Unable to create process using '"c:\users\owner\downloads\python.exe" "C:\Users\Owner\Downloads\Scripts\pip.exe" install pyqt5': The system cannot find the file specified. " what do I do

hard hemlock
#

@median ridge Programs like figma are made to prototype and create mockups, it's up to the developer to actually use the visuals, information, and size/spacing to achieve the goal

median ridge
#

yeah but from a dev standpoint how do you turn the prototype into reality

digital rose
#

any ideas for intermediate gui projects?

obtuse pumice
#

Qt library? @median ridge

weak trout
#

Hello 👋. What library is better: tkinter or pyqt5? With "better" in this case I mean the library that gives you the more possibilities to create GUIs and "easy" to use

obtuse thistle
#

tkinter is easier and pyqt5 gives more possibilities

weak trout
#

The answer I was looking for 😅 thank you!

obtuse pumice
#

For what application? @weak trout

weak trout
#

It's a desktop application. Doesn't involve much graphics, just a small menu with some options. Though I want it to be good-looking

pastel kelp
#

TKinter is easier to use and CAN get you decent menus and GUIs, however TKinter is much more complex, and although it is harder to set up, it might be worth it for good-looking GUIs

#

Most people use TKinter only for popup windows and error messages, because its functionality is limited

#

I would prefer PyQT5... it even has a GUI editor that let's you auto-generate PyQt5 code by dragging items on the screen

#

I'm not really an expert on the "Good Looking" part of it, but I would expect PyQt5 to look better than TKinter

rocky dragon
#

Both are customizable to some degree so it depends on the use, I don't think their difficulty is that different although tkinter will be easier to start with as qt needs some getting used to

weak trout
#

I'll consider my decision. Thank you all for your comments, really helped 👍

pastel kelp
#

No Problem 👍

obtuse pumice
#

If PyQt5 and PySide2 are about identical, is there any reason to choose the one or the other except for licensing?

unique forge
#

nope

#

licensing is the only thing setting them apart

rocky dragon
#

I had some problems with pyside2 in one case and they handle a few things differently, so I'd maybe try them both out and go with what suits you and your project more

hollow needle
#

Anyone familiar with Choropleth maps? I already have a map working using Plotly, I just have a question about presenting my map using Qt UI.

obtuse pumice
#

Is there any good tutorials on how to structure a good program in Qt?

eager beacon
#

@silk basin what happened?

uncut pawn
#

How can I create a module for Tkinter

#

???

eager beacon
#

what do you mean?

craggy moss
#

PyQT5 the best thing

digital rose
#

someone please answer this

#

its about PyQt5

eager beacon
#

@digital rose did you figure it out? Link is dead

digital rose
#

And this solved it for me

deep hornet
#

hi

#

i am resizing an img pls help

#

anyone

eager beacon
#

resize probably works in place so it would return None

#

@digital rose why would you want to include the UI file anyhow? seems unnecessary...

deep hornet
#

ok

uncut pawn
#

How to create a module that works with Tkinter

#

????????

modern marsh
#

?

eager beacon
#

@uncut pawn what are you talking about?

obtuse pumice
#

In Qt, should QStackedWidget be used when a menu bar chooses the displayed info?

eager beacon
#

you can do that

#

can you give any more details than that?

obtuse pumice
#

I want pushbuttons for menu choices, so when pushing the menu items, the "main" area changes depending on choice

#

tab widget wouldn't work i think

#

This is outside of Menu bar

eager beacon
#

i don't see why it wouldn't work with a tab widget

#

although the tabs would be visible

obtuse pumice
#

Tab widget are locked next to each other right?

#

Or

#

tab choices

eager beacon
#

I don't understand what you mean 'locked next to each other'

obtuse pumice
#

Sorry 😅

eager beacon
#

it would be easier to go with a tab widget, that way you don't have to worry about highlighting the right button if someone decides to use the tab to navigate instead of the menu buttons

#

er... i meant it would be easier to go wth a stacked widget

obtuse pumice
#

Thinking about something like this

#

Then the content widget needs to be inside a stacked widget i assume

#

or the multiple content widgets

eager beacon
#

yeah, just make some checkable buttons and a stacked widget hooked up to them and you're g2g

obtuse pumice
#

Nice

#

Not sure why i'm doubting myself, but good with some reasurance 😛

eager beacon
#

I'd probably avoid using a toolbar for it but thats mostly because I hate the behavior of toolbars

#

Has anyone here ever created a custom calendar with QtWidgets?

obtuse pumice
#

Also, is there someway to force user to only enter numbers in something like a line edit?

eager beacon
#

use a spinbox

obtuse pumice
#

Or should i just use spin box?

eager beacon
#

well

#

thats the easiest solution

obtuse pumice
#

Can i remove the rightmost side increment and decrement?

eager beacon
#

you could use a QValidator

#

the buttons you mean?

obtuse pumice
#

Yeah

#

Validator would probably work

eager beacon
#

you can set set the button symbols to NoButtons to hide the spin/double spin controls

#

if you disable the wheel event a spinbox would be pretty much the same thing as a lineEdit with a validator and take less effort

obtuse pumice
#

Okay, thanks 😄

digital rose
#

I started with tKinter module today

#

So I want to make a upper frame a interface for TV screen , whenever I click on the button channel plus , channel increase by 1

#

I want to change the current label and not print a new one , I want to change existing label on the screen

#

Help pleaseee

#

your_label.config(text='new_text')

#

It's not working ,wheneve I click the button , nothing happens

#

Label['text'] = new text

#

I am doing this inside a function

#

Button["command"] = function

#

Why I should use config?

#

Label['text'] = new text
@digital rose same .

digital rose
#

"import tkinter
root=tkinter.Tk()
l1=tkinter.Label(root,text="hello bois").pack(side=tkinter.LEFT)
def kpk():
l1["text"]="changed to bye bois"
btc=tkinter.Button(root,text="button",command=kpk)
btc.pack()
root.mainloop()
"

#

'''import tkinter
root=tkinter.Tk()
l1=tkinter.Label(root,text="hello bois").pack(side=tkinter.LEFT)
def kpk():
l1["text"]="changed to bye bois"
btc=tkinter.Button(root,text="button",command=kpk)
btc.pack()
root.mainloop()
'''

#

button isnt doing anything

#

😭

unkempt mist
#

who can help me with Tkinter?

#

write in PM pls

obtuse pumice
#

Why is it so difficult to move a frame in Qt Designer?

eager beacon
#

its not 🙂

obtuse pumice
#

I have 3 frames "top, center, bottom" inside another frame. How can i easily choose the placement of those 3?

eager beacon
#

send screenshot

obtuse pumice
#

When i try to move one to the bottom, it jumps out of the parent frame

eager beacon
#

oh

#

break your layout

#

then move

#

then lay out

obtuse pumice
#

Wow

#

Okay

#

That was not hard at all 🙈

#

Thanks

eager beacon
#

yeah, took me about 2 years to figure that one out

obtuse pumice
#

Can i lock the size for a frame in Qt Designer?

eager beacon
#

set the sizePolicy to Fixed

#

@obtuse pumice just curious.. why did you choose designer over creator?

#

seems like most people on here are using designer

obtuse pumice
#

No reason really, i started follow a youtube tutorial which used designer

#

So a frame the geometry is grayed out 🤔

#

I guess i could use the maximumSize to change the size

eager beacon
#

what are you trying to do that you want to change the geometry?

#

typically you would just adjust the sizePolicy and the min/max size

obtuse pumice
eager beacon
#

and maybe the baseSize if they ever got that working

obtuse pumice
#

The upper left frame is to big

eager beacon
#

set the lower frame size policy to Expanding

#

and the upper to Preferred

#

the verticalPolicy that is

#

the verticalPolicy that is

obtuse pumice
#

Now when i try to resize it, it just eats up the bottom frame

#

Now when i try to resize it, it just eats up the bottom frame

eager beacon
#

because there isn't anything in the bottom frame yet

#

what's going in there?

obtuse pumice
#

Okay, i will try to put something there first

eager beacon
#

you can use a vertical spacer to see what it would look like fully expanded

#

I just looked at your screenshot

#

looks like you set upper to expanding instead of preferred

plush stream
eager beacon
#

create a frameless widget with a widget across the top with that contains a label for the title and a button

#

connect the button to widget.close()

plush stream
#

That's what im trying to avoid actually, is there no way to make something like that without creating frameless window?

eager beacon
#

why are you trying to avoid it?

#

it takes like 10 minutes tops

#

thats a qMessage box

#

maybe you could hack on that

deep hornet
#

can anyone tell me what to learn after tkinterr for gui dev

eager beacon
#

do you want to learn more gui stuff?

#

Everyone should know a little bit of Qt imo

deep hornet
#

yes

#

what bout kivy @eager beacon

eager beacon
#

I've never used it

#

Unless you have a really good reason to want to learn Kivy over Qt i'd strongly suggest learning Qt

pastel kelp
#

Kivy is a pain to work with in my experience

eager beacon
#

Qt has a learning curve but once you learn just a little bit you have so much more flexibility to do things how you want to do them instead of looking for some tkinter hack

#

if you haven't noticed a large majority of the questions here are about tkinter

#

and its not because its mega popular

dire sinew
#

need help with a gui i've created, i want to restart the GUI with a push of a button, i did some research and found this code snippet ```def restart_program():
try:
p = psutil.Process(os.getpid())
for handler in p.open_files() + p.connections():
os.close(handler.fd)
except Exception as e:
logging.error(e)

python = sys.executable
os.execl(python, python, '\'{}\''.format(sys.argv[0]))```
#

but i get this error

#

Process finished with exit code 0
#

when i push said button

#

when i research that error, i found info that implies that i'm trying to close the program from outside of it.

eager beacon
#

what framework?

dire sinew
#

i'm using pysimplegui if that's what you mean

#

the gui is opening an excel sheet and modifying certain cells

eager beacon
#

@dire sinew

#
import itertools
import sys
import time
import os

i = 0
started = False
print('Open')


def on_close():
    python = sys.executable
    os.system(f'{python} {__file__}')
    global started
    started = False
    sys.exit()


for i in itertools.count(0):
    if i == 20:
        print('closing')
        started = True
        break
    i += 1
    time.sleep(0.05)
print('closed')
on_close()
#

that works for me

dire sinew
#

thanks @eager beacon

eager beacon
#

did you try it?

#

curious if it works in an event loop

#

I just tested with that for loop at the bottom there

dire sinew
#

i'm now getting this error after i added it in

#

Process finished with exit code 0```
eager beacon
#

which line threw that one?

#

the __file__ line?

dire sinew
#

that's the only error its giving me

#

but its possible that that line is the culprit

eager beacon
#

copy the on_close stuff to your button press I guess

#

you don't need started or sys.exit()

#

is the line with __file__ the file you run to start your gui?

dire sinew
#

i'm using pycharm and just running the code from that

eager beacon
#

is it your main file though?

#

the one that kicks everything off and launches the gui?

dire sinew
#

yes

#

can i just replace file with the name of the py file?

eager beacon
#

you might try printing __file__ to see what its coming up with

dire sinew
#

ok

eager beacon
#

you need an absolute path i believe

#

and assuming you're on 3.4 or newer __file__ should provide that

dire sinew
#

printing file gave me the correct path to my py file

#

i have the function def outside of the button press, and i have the for i in itertools code in the button press

eager beacon
#

you don't need the for loop at all

#

i was just using that to keep it going to see if it worked

#

the on_close() function should be what your button connects to

#

and you only need the _open() function if you want to kill the original process

#
import os

from PyQt5 import QtGui, QtWidgets
from PyQt5.QtWidgets import QPushButton


class Widget(QtWidgets.QWidget):
    def __init__(self, parent=None):
        super(Widget, self).__init__(parent)
        self.layout = QtWidgets.QGridLayout()
        self.setLayout(self.layout)
        self.b = QPushButton(f'{os.getpid()}')
        self.b.clicked.connect(lambda x =os.getpid():self.on_close(x))
        self.layout.addWidget(self.b)
        self.pid = os.getpid()

    def on_close(self,pid):
        self.pid = pid
        self.b.setText(f'{pid}')
        python = sys.executable
        self.destroy()
        os.system(f'{python} {__file__}')
        self._open(pid)

if __name__ == '__main__':
    import sys
    app = QtWidgets.QApplication(sys.argv)
    w = Widget()
    w.show()
    sys.exit(app.exec())

this works in pyqt

#

this is all super hacky

#

why do you want to do this?

dire sinew
#

i realized while i was coding the GUI that after the user would input the new data to the excel spreadsheet, the only way to add a new row of data would be to restart the gui, or am i not thinking this through correctly?

eager beacon
#

you are almost certainly missing something

#

I can't imagine that you couldn't extend a table widget row count after it had been created

#

I've never used pysimplegui though

dire sinew
#

the GUI

eager beacon
#

next time use pyqt and I may be able to help

dire sinew
#

lol

eager beacon
#

oh, so its not even a table widget?

#

its just a bunch of inputs that get turned into a row in some spreadsheet?

dire sinew
#

yes

eager beacon
#

so I have to ask, why is restarting the gui the only way to update the spreadsheet?

dire sinew
#

i didn't think i could make it go to a new line after the user inputs the data from the first button press

eager beacon
#

why not?

dire sinew
#

i'm assuming i can then. I'm a noob at this

eager beacon
#

What makes it go to a new line when you start the gui?

#

hopefully this is just a fun exercise and no hospital will come near this tool 🙂

dire sinew
#

oh its called a hospital because of all the bad PCB's that have failed testing

eager beacon
#

well there's some good news!

#

how many lines of code is this app?

dire sinew
#

81

eager beacon
#

if you want to post it here I can take a look and may be able to point you in the right direction

dire sinew
#
import PySimpleGUI as sg
from openpyxl import load_workbook
from openpyxl.styles import Alignment
import os
import sys

wb = load_workbook(filename='Hospital QNs_Status.xlsx')
sheet = wb['QNs']
new_row_location = sheet.max_row + 1
center_aligned_text = Alignment(horizontal='center')


def on_close():
    python = sys.executable
    os.system(f'{python} {__file__}')
    global started
    started = False
    sys.exit()


print('Opening user interface...')
sg.theme('Dark Blue 9')

layout = [[sg.Text('Enter QN # here', size=(15, 1)), sg.InputText(do_not_clear=False, key='-OUTPUT1-'),
           sg.Button('QN #', tooltip='Press to enter data to workbook', key='-IN1-')],
          [sg.Text('Enter Product P/N', size=(15, 1)), sg.InputText(do_not_clear=False, key='-OUTPUT2-'),
           sg.Button('Product P/N', tooltip='Press to enter data to workbook', key='-IN2-')],
          [sg.Text('Enter status of job', size=(15, 1)),
           sg.InputCombo(('OPEN', 'IN WORK', 'WAITING PARTS', 'Waiting Planner', 'COMPLETE'), key='-OUTPUT3-', size=(20, 1)),
           sg.Button('STATUS', tooltip='Press to enter data to workbook', key='-IN3-')],
          [sg.Text('Enter the defect step', size=(15, 1)),
           sg.InputCombo(('MTP', 'ATP', 'VIBE', 'ESS', 'HIPOT', 'LEAK', 'NFF', 'INSP'), key='-OUTPUT4-', size=(20, 1)),
           sg.Button('DEFECT', tooltip='Press to enter data to workbook', key='-IN4-')],```
#

ugh

eager beacon
#

new_row_location = sheet.max_row + 1 should probably go at the end of your submit function

#

assuming it passes, add a new row

#

or you could throw it at the beginning and create the row and then enter the data into the row after its been created

#

at the beginning means the beginning of the submit function instead of adding a new row after every submission

#

that way, if its near the beginning you won't have an extra empty row in your spreadsheet

dire sinew
#

this is the code for the button presses

#
while True:
    event, values = window.read()
    if event in (sg.WIN_CLOSED, 'Cancel'):
        break
    if event == 'Submit':
        wb.save('Hospital QNs_Status.xlsx')
    if event == 'RESET FORM':
        on_close()
    elif event in '-IN1-':
        qn_entered = values['-OUTPUT1-']
        sheet.cell(column=1, row=new_row_location, value=qn_entered).alignment = center_aligned_text
    elif event in '-IN2-':
        pn_entered = values['-OUTPUT2-']
        sheet.cell(column=2, row=new_row_location, value=pn_entered).alignment = center_aligned_text
    elif event in '-IN3-':
        status_entered = values['-OUTPUT3-']
        sheet.cell(column=3, row=new_row_location, value=status_entered).alignment = center_aligned_text
    elif event in '-IN4-':
        defect_entered = values['-OUTPUT4-']
        sheet.cell(column=4, row=new_row_location, value=defect_entered).alignment = center_aligned_text
    elif event in '-IN5-':
        causes_entered = values['-OUTPUT5-']
        sheet.cell(column=5, row=new_row_location, value=causes_entered).alignment = center_aligned_text
    elif event in '-IN6-':
        notes_entered = values['-OUTPUT6-']
        sheet.cell(column=6, row=new_row_location, value=notes_entered)```
eager beacon
#

oh

#

its not even a function

#

this gui framework is strange

#

you should be able to put the new_row_location line right betweenif event=='Submit': and wb.save('Hospital QNs_Status.xlsx')

dire sinew
#

well, i'm new to all of this, just started learning 3 weeks ago

eager beacon
#

if I'm understanding everything

#

well honestly you dodged a bullet by steering clear of tkinter

dire sinew
#

i started on tkinter, and then discovered pysimplegui

eager beacon
#

horrible docs and a weird api makes for a difficult learning process for people who are just starting out

#

well now you know about pyqt5!

#

or pyside2

#

i'm not picky!

#

they are exactly the same for every reason you would care about

dire sinew
#

ok i will move the new row location

eager beacon
#

try entering 2 different entries after to see if it worked or not

dire sinew
#

nice

#

it works

#

that was so much simpler than what i was trying to do

#

thank you so much!

eager beacon
#

no problem

#

glad it worked out

digital rose
#

is it possible to make a button in tkinter to make a while loop that never ends, UNLESS they press a stop button or something that stops the app with:
quit()
is it possible to do something like that?

glad adder
#

just asign the quit() function to a button

digital rose
#
from tkinter import *
root = Tk()
Button(root,text="Quit",command=quit).pack()
root.mainloop()
modern marsh
#

yes

digital rose
#

yeah

digital rose
#
from tkinter import *
root = Tk()
Button(root,text="Quit",command=quit).pack()
root.mainloop()

@digital rose can't you do like do mainloop() instead of root.mainloop()?

#

whats the diferrence?

inner nest
#

mainloop() is a method of your tkinter application, you need to associate this method with his object. The method allows basically the application to receive informations/events from the mouse and keyboard @digital rose

digital rose
#

but what happens when you have multiple windows?

#

do i do mainloop()?

#

@inner nest

inner nest
#

One application Tk() can have multiple runtime Toplevel() child windows. You need to call mainloop only once. Mainloop() is listenning to events like open a new window, destroy a window, click a button....

digital rose
#

Hi, I m new into python programming and i would like to know if anybody uses a simillar software as scenebuilder (java) but for python tkinter ?
i heard of Page, is it efficient or you prefer the "good old way"?

obtuse pumice
#

Qt question:
I'm displaying numbers inside a QSpinBox, but is it possible to set length of numbers? So 0 = 00000000 and 1 = 00000001 and 2 = 00000002

#

Leading zeros

digital rose
#

Hi

#

Hi, I m new into python programming and i would like to know if anybody uses a simillar software as scenebuilder (java) but for python tkinter ?
i heard of Page, is it efficient or you prefer the "good old way"?
@digital rose ?

#

yeap

#

@digital rose can't you do like do mainloop() instead of root.mainloop()?
@digital rose If you have one window make root.mainloop() but If you have multiple windows you will make just mainloop() .

#

yeap
@digital rose I think there is software help you make programs layout in python

#

but everything in script is better

#

okay thx for your answer

#

you're welcome

narrow condor
#

hi, I'm using a tkinter GUI and pyinstaller, but whem I close the window the app still running in task manager, so many times as I open it, aways will open another one and I need to finish the process by hand, one by one

#

how can I close it from the script?

#

already tried sys.exit()

crystal sentinel
#

hmm i just use exit() by itself

pastel kelp
#

Yeah

#

isn't exit() a built-in in Python?

crystal sentinel
#

i tink so

#

@narrow condor if not, try the quit() method

#

should work by itself

narrow condor
#

I got an error

crystal sentinel
#

oof

narrow condor
#

can't run script, something like that

crystal sentinel
#

hmm can you send the problem code?

narrow condor
#

theres no code, is just a alert popup

#

"Failed to execute script"

crystal sentinel
#

wierd, where are you using the exit()?

narrow condor
#

last line

#

after mainloop()

#

oh I think I figured out

#

there is a Thread in my script

#

I commented the Thread.start() and it finished

crystal sentinel
#

ahh ok

narrow condor
#

but I still dont know how to kill this thread

#

searched a lot and didn't got it

void nest
#

I don't think that's possible with threading

#

Well not directly

#

You've got to do something with daemons

#

that's one reason why I started using multi-processing instead of threading

crystal sentinel
#

sorry to interrupt, my tkinter thing is kinda messin

I have a button that i press in the LoginPage class that then calls checkLogin
Then i have a label in MenuPage that i want to change to "second str"
but when i call setUserInfo from checkLogin the tkinter varibales doesn't update, its still "first str"

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

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

heres the sample code, any ideas why infoVar isn't changing to "second str"?

narrow condor
#

that's one reason why I started using multi-processing instead of threading
@void nest thx, I will look for it

#

and thx @crystal sentinel

crystal sentinel
#

^v^

silk basin
#

setDisplayFormat does not work

eager beacon
#

what did you try @silk basin

silk basin
#

@eager beacon currently writing a function to convert my 24 hour time to 12 hour time

eager beacon
#

but whats the problem?

silk basin
#

I thought there would be a function already built in python to simple convert that time to a 12 hour time format

eager beacon
#

you're using the Qt version in the screenshot

#

well almost

silk basin
#

yeah I literally just finished writing a function to do it for me

#
    @staticmethod
    def convert12(str1):

        time = ""
        # Get Hours
        h1 = ord(str1[0]) - ord('0')
        h2 = ord(str1[1]) - ord('0')

        hh = h1 * 10 + h2

        # Finding out the Meridien of time
        # ie. AM or PM
        Meridien = ""
        if (hh < 12):
            Meridien = "AM"
        else:
            Meridien = "PM"
            
        hh %= 12
        # Handle 00 and 12 case separately
        if (hh == 0):
            # print("12", end="")
            time = "12"
            # Printing minutes and seconds
            for i in range(2, 5):
                # print(str[i], end="")
                time = time + str1[i]
        else:
            # print(hh, end="")
            time = time + str(hh)
            # Printing minutes and seconds
            for i in range(2, 5):
                 # print(str1[i], end="")
                 time = time + str1[i]

        return time + " " + Meridien
eager beacon
#

lol

silk basin
#

was that useless

eager beacon
#

100%

silk basin
#

damn

#

feels bad lmao

eager beacon
#

print(new_time.time().toString("h:mm:ss ap"))

#

when you called time())

#

you were not referencing QDateTImeEdit anymore

#

its a QTime object

#

setDisplayFormat only affects what you see in the UI I think

silk basin
#

holly crap I couldnt find any documentation on taht

#

you are a wizard

#

PyQt and I have a love hate relationship when it comes to its documentation

eager beacon
#

you were probably looking at QDateTimeEdit or something

#

you get used to it

silk basin
#

I looked at both :/

eager beacon
#

also, never ever ever write your own date time code

#

there is a 99.999999% chance you will mess it up

silk basin
#

figures lol

eager beacon
#

date time stuff is some of the trickiest stuff to progeram correctly

silk basin
#

you wouldn't happen to know how to make the am/pm Capitalized with one of your ingenious 1 liners ?

eager beacon
#

just capitalize it

#

i mean AP, not to use upper()

silk basin
#

oh

#

gosh

#

so simple

#

it hurts me

eager beacon
#

I'm sure you're a lot quicker to write code now than you were a month ago, right?

silk basin
#

ohh

#

yeah 100%

#

you alone taught me so much

eager beacon
#

it just takes time

#

you and a lot of time at that

#

cause qt is huge

silk basin
#

It is insane how big it is

eager beacon
#

it's because its used in embeded iot stuff, and digital dash boards and 10000 other things other than a desktop app

#

its like an OS in a box almost

silk basin
#

That is insane

eager beacon
#

hows your app coming along?

#

you've been at it for a while now

silk basin
#

It is coming along real nice

#

yeah it is a semester long project. Like the Professor literally just said "create a note taking app"

#

so thats what I have been up too

eager beacon
#

how did you all decide to store the notes?

silk basin
#

I decided to do it in QSettings

#

it was very simple

#

once I figured it out. Everything you input into QSettings is key'd

#

and it has a very convenient "retreive keys" function

eager beacon
#

haha really?

#

😦

silk basin
#

yep

eager beacon
#

ahh whatever

#

so long as it works

silk basin
#

yep

eager beacon
#

this is my favorite note taking app

#

steal some ideas from it

silk basin
#

when we finish project for our final submission Ill make my github repository public and let you download the executable

eager beacon
#

oh man

#

you're gonna have fun with that part!

silk basin
#

so you can see source code and how everything works. It will also have detailed documentation.

#

Oh lmao

eager beacon
#

sounds good

silk basin
#

getting the exectuable working is impossible

#

pyinstaller is the dumbest thing I have ever messed with

eager beacon
#

FBS is slightly easiier

#

but not by much

silk basin
#

we are just having lots of compatablity issues

eager beacon
#

it only works with 3.6 i think

#

MAYBE 3.7

silk basin
#

we are on 3.8 :/

eager beacon
#

pyinstaller that is

#

you have to do a ton of stupid stuff to get it working in 3.8

#

I honestly don't even remember what they are

#

but its well worth downgrading python to avoid the hassle and googling

silk basin
#

would there be any issues downgrading?

eager beacon
#

not unless you're using some feature that was added in 3.8

silk basin
#

okay cool

eager beacon
#

even thats easy to work around

#

theres like 10 ways to do everything in python

silk basin
#

Yeah it is kinda amazing

#

Ill relay the information back to my members

#

you have been so much help. The projects final submission is due tuesday

#

thursday*

eager beacon
#

oh

#

can you use libraries ?

#

or are they restricted?

#

if you can you should take a look at this

#

instantly make the app look better with like 3 lines of code

silk basin
#

we can use that and I have looked into it but we didn't know if that would work

#

how could we implelent that?

eager beacon
silk basin
#

So that would just go in our main?

eager beacon
#

yes

silk basin
#

ohh

#

bet ill look into it

#

Ill create a branch and test it

eager beacon
#

its the easiest thing you can do to improve the ui

silk basin
#

How do I go about importing that library

#

or do I just download it

eager beacon
#

just clone the repo

#

or download it with pip and throw it in your requirements.txt

silk basin
#

^

eager beacon
#

pip install qtmodern

silk basin
#

i like the second option better

#

okay ill try it in a bit

eager beacon
#

what does APP do?

#

there aren't a ton of great reasons to subclass QApplication

#

either way

silk basin
#

yeah no clue why or even when they did this

#

but

eager beacon
#

qtmodern.styles.dark(app) should still work

#

did you also apply the stylesheet?

silk basin
#

I did only what you sent in the SS above

eager beacon
#

I'd use app instead of ctx

#

well, wait

#

you never told me what App is

silk basin
#

Lol i gotta ask my team members I literalyl have no clue. They changed all this last week

#

so this is something called app.py

#

so I think App is the whole program

eager beacon
#

I see

#

it's customary to name that something that makes sense

#

like MainWindow or Window

silk basin
#

yeah I don't know my teammebers do major refractors without me even knowing lol

#

its so random,

eager beacon
#

how do you guys divy up the work?

silk basin
#

Github issues

#

We have weakly meetings and decide on what issues we need to implement and then go from there

eager beacon
#

you can make the UI look a bit nicer if you want to set an app palette to override the button text color

#

or you can use a stylesheet

silk basin
#

One of our team members has had an internship for 2 years now so he is very 'professional' and our git hub is very organized. We use pylint and use code freezes idk hes going way to hard

eager beacon
#

I like to think of what a linter says as a suggestion 🙃

silk basin
#

lol

slow plover
#

how can i make a camera application with tkinter without using opencv?

digital rose
#

u cant??

#

idk

#

but opencv is beter tho

eager beacon
#

why don't you want to use opencv?

#

its probably the easiest way to do that

digital rose
#

there is much more use

#

for image recognition

#

such as a program with tk + webbrowser, going to open chrome://newtab when the face is correct

inland notch
#

alright, so i'm trying to make a responsive thingy, and this is what i've got

    endx = shotgunbutton.winfo_x()
    diffrence = endx - Game.winfo_width()
    for button in buttonarray:
        xbutton = button.winfo_x()
        ybutton = button.winfo_y()
        button.place(x=xbutton-diffrence, y=ybutton, anchor=tk.NW)```
shotgunbutton = rightmost button
digital rose
#

It is possible to change the titlebar color in pyqt? jut the color of titillebar without affecting it's buttons?

inland notch
#

is there like a way to track how much to window changes size?

eager beacon
#

@digital rose you have to make your own window from a frameless widget to do something like that because the windows are controlled by the OS

inland notch
#

fixed it!

eager beacon
#

pretty neat for tkinter

inland notch
#

Thanks! I've been working really hard on this game for a long time!

eager beacon
#

what kind of game is it?

inland notch
#

like a platformer shooter kinda game?

#

if you want to play it, i can send the gamejolt link

eager beacon
#

yeah send me a link

#

but I wont have time to play it until sometime tomorrow

inland notch
eager beacon
#

I tried launching the game but I can't seem to start it or click on anything

#

am I missing something?

#

ah, okay got it working

velvet garden
#

@inland notch can you make it for mac too?

velvet garden
#

i need help in the ios application pythonista... I want to learn more about the ui module

#

wdym?

digital rose
#

i have a question: What is the best gui library for python?

velvet garden
#

tkinter

#

or

#

uhm

#

pyglet

digital rose
#

is pyqt5 good?

velvet garden
#

idk

#

never heared of it

digital rose
#

i dont really like tkiner because its just too old

#

and outdated

velvet garden
#

okay

#

try pyglet then

#

or just do whatever you like

digital rose
#

never heared of it
@velvet garden PyQt5 comes with a designer tool so you can move the button with cursor and drag and drop widgets without any code so its much easier

#

ill try pyglet

velvet garden
#

oh nice

#

still

#

idk it

digital rose
#

now you do

#

btw how do you not a have a pfp

velvet garden
#

i do

#

but it is a png

#

of a png

#

png.png

#

it's just empty

#

i need help in the ios application pythonista... I want to learn more about the ui module

plain elk
#

If you need help, why don't you ask something?

velvet garden
#

i did....

#

i just want someone to learn me more about the ui module

modern marsh
#

@inland notch that is so damn cool

#

did you use only tkinter for that?

uncut pawn
#

So I have a Py. file I will call that 1. In 1 there is a Tkinter window. In another file called 2. I want to add a button on the Tkinter window in 1. How do I do that? pls answer me it been a month and I can't find the answer.

#

@eager beacon

blissful vale
#

What have you tried?

uncut pawn
#

They are both in the same dict

#

Nothing works

#

I don't know what to do

uncut pawn
#

So I have a Py. file I will call that 1. In 1 there is a Tkinter window. In another file called 2. I want to add a button on the Tkinter window in 1. How do I do that? pls answer me it been a month and I can't find the answer.

wary birch
#

Hi, quick question: I've been using the bar and Labels from ipywidgets to keep track of long computational tasks. But I see that sometimes things "lose rhythm". Does the update of ipywidgets compromise the computational performance?

inland notch
#

@inland notch can you make it for mac too?
@velvet garden I don't think I can lol

#

did you use only tkinter for that?
@modern marsh for the gui? yeah. but I used pygame for the audio because tkinter can't do audio

eager beacon
#

@uncut pawn I don't know about tkinter well enough but assuming it has some sort of callback behavior you should be able to import 2 into 1 and connect a callback from whatever triggers the button to be created

uncut pawn
#

@eager beacon do you know who use tkinter

#

??

eager beacon
#

@uncut pawn most people in this channel judging by the huge number of questions about it

uncut pawn
#

k

#

Is Tkinter bad

#

I am planning to use Pyqt5

inland notch
#

tkinter is not bad, no

eager beacon
#

its bad for a lot of things but fine for others

#

just depends on what you're doing

inland notch
#

I made a game with tkinter

#

It's fine

#

I mean like

#

it does have it's limits

#

audio for example

#

and perfomance

idle nest
#

Any ideas how to use open CV to focus camera on one open object at once and ignoring other objects ?

velvet garden
#

f

inland notch
#

w h a t

#

you mean focus as in dof?

velvet garden
#

okay im gonna ask again

#

i need someone to just teach me some of the basic stuff in pythonista 3 ui module

inland notch
#

there's actually a great website where you can find people that can teach you this stuff!

velvet garden
#

and where's that?

inland notch
velvet garden
#

ah

#

i don't understand a single word of what those people tell me

bronze basin
#

then you must learn

#

and try to make sense of it

velvet garden
#

yeah

digital rose
#

https://gamejolt.com/games/WidgetsGears/530598
@inland notch is this made in python?

Game Jolt

🎮 Welcome to Widget's gears! [Media 4528691] In this game, you play as the mascot for Widget's Gamehouse, Widget. Widget uses his "Fun-Gun" to get make work of enemies named "Boredom Blobs". Each...

digital rose
#

anybody??

plain elk
#

?

digital rose
#

How to make the end of the Label

inner nest
#

you can use "width" or "wraplength" parameter if you are using tkinter

digital rose
#

yeah

#

I made it

#

thx anyways

inland notch
#

@inland notch is this made in python?
@digital rose yeah

granite drum
#

Anyone know how to store the click of a button as a string?

digital rose
#

what do you mean

#

a button state is bool not string

#

do you mean store the input of a text feild onclick?

#

@granite drum

granite drum
#

idk

#

im new to this

#

but yeah i need to store the input onclick

#

@digital rose

#

for example theres a numpad on screen and i need to record data thats typed into it

digital rose
#

okay what are you using? it it just pure javascript?

#

or are you using python backend?

#

usually what I would do for that is add an id to the tag of the input text

#

and get it dynamically in javascript code

#

@granite drum

granite drum
#

its all python

#

no JS

#

i barely know how to code

#

sec

#

thats it @digital rose

digital rose
#

okayyy

#

I'm not so good at tkinter which is what I assume you're using

ornate tapir
#

@granite drum how’d you get your video to be so smooth and HD

digital rose
#

I'm not so good at tkinter which is what I assume you're using
@digital rose I know a lot of tkinter

#

any question about tkinter just ask me

#

@granite drum how’d you get your video to be so smooth and HD
@ornate tapir he was recording using shadow play

#

this sortware for nividea cards only

#

Anyone know how to store the click of a button as a string?
@granite drum ?

#

store ?

#

You mean bool prop?

#

it's just call a function when it is clicked

#
from tkinter import *
from tkinter import ttk
root = Tk()

def clicked():
    Label(text="clicked").pack()

btn = ttk.Button(root,
            text="click me", # The text on the button
            command=clicked) # This is for call fumction when it's clicked
btn.pack()
root.mainloop()
#

Output when it's clicked:

#

call the func when it's click one time

#

re click = re call the function

#

there is another ways to call the function

#

there is the .bind and more

#

but the command option is easier and good

#

@granite drum

livid zodiac
#

Hey - I have the following problem:
My group and I, we need to program a software artifact, evaluating people based on text passages provided in an online assesment tool.
We already considered naive bayes but are still looking for an applicable algorithm.
We are focusing on the character traits "openess" & "neuroticsm" (read from unstructured text)

We will conduct a survey in order to conduct a dataset - because there are not enough german sets for training the algorithm.

We want to include regx, looked already at nlp-algorithms, but we aren't sure, which algorithm is the best one to integrate (in terms of time, ressources and difficulty)

The Project needs to be finished in january.

Looking forward to your feedback! 🙂

digital rose
#

hi

#

You mean you want a software like the discord software ? @livid zodiac

#

online chat ?

livid zodiac
#

More of an applicant online assesment. So Company XYZ offers a position. Person applies. And the algorithm checks the text provided by the applicant for character traits like openeness

#

e.g. He / She writes: "... I like to go out with friends", the algorithm ranks it as "Openess" and ranks the applicant for 4/5 openenss

#

someway like that

digital rose
#

ah

#

I know now

#

Algorithm

#

I'm no thing at algorithm

#

you have very advanced problem

#

sorry I don't know the solution

#

but this channel is not for Algorithm

livid zodiac
#

thanks alot!

inland notch
#

Can you have a tkinter button that's just text?

digital rose
#

ah I don't make any thing but you're welcome @livid zodiac

#

Can you have a tkinter button that's just text?
@inland notch Yes

#

FLAT

inland notch
#

could you give me a code example?

digital rose
#

yeah i will

#

sec

#
from tkinter import *
root = Tk()
btn_flat = Button(root,text="Click me",relief='flat',bd=0)
btn_flat.pack()
root.mainloop()
granite drum
#

@ornate tapir use nvidia geforce if you have an Nvidia gpu

inland notch
digital rose
#

ah

#

I think there is way

#

sec

granite drum
#

@digital rose can you help me improve my code?

digital rose
#

yeah

#

I think there is no way

#

but you can make some bricks

#

@inland notch

inland notch
#

some bricks?

digital rose
#

yeah like the alpha brick

inland notch
#

what's an alpha brick?

digital rose
#

this to make some transparent

inland notch
#

how do i make an alpha brick?

digital rose
#

make a function

#

sec

#

I will send the code

#

root.wm_attributes("-transparent", True)

#

root.config(bg='systemTransparent')

#

then add it for the bg of the button

#
from tkinter import *
root = Tk()
root.wm_attributes("-transparent", True)
root.config(bg='systemTransparent')
btn_flat = Button(root,text="Click me",relief='flat',bd=0,bg="systemTransparent")
btn_flat.pack()
root.mainloop()
inland notch
digital rose
#

if you have error say

#

unknown color name

#

what is your os?

inland notch
#

Windows

digital rose
#

ah

#

this for mac os

inland notch
#

Can you do it for windows?

digital rose
#

yeah I think

inland notch
#

do you
know how?

digital rose
#

in wndows no

#

but

#

you can make the window alpha

#

root.attributes("-alpha", 0.5)

#

in windows

inland notch
#

but that's not what I want to do lol

#

hmm, I think I know a way

digital rose
#

cool

#

but that's not what I want to do lol
@inland notch ah okay

#

there is articl for that

#

saying

#
Tkinter frame transparent background

Transparent background in a Tkinter window, There is no cross-platform way to make just the background transparent in tkinter. You just cannot set the transparency of the frame in tkinter. But you can set the transparency of the whole window with root.attributes ('-alpha', 0.5) You can also do root.attributes ("-transparentcolor", "red") if you are using Windows, but again it will be applied to the whole window.
digital rose
#

how can i fix that?

#

even if i remove the buttons, its still like that...

#

im trying to make a tictactoe game

#

and im trying to make those barriers between the x's and 0's

inner nest
#

hmm I don't think this is the better solution here. You can for example play with "borderwidth" parameter on buttons or labels (i dont know what's the widgets you are using here) to make like a table.

digital rose
#

label

#

im using a label with a textvariable

inner nest
#

there is a lot of example of this game made in python, you should look on github for example

#

it would be easier i think

digital rose
#

yeah, i don't want to just steal someone else's code

inner nest
#

hmm using librairies made by other is stealing ?

digital rose
#

no

#

i guess ur right

inner nest
#

try to understand the solution and then you are not simply copy

digital rose
#

ok

inner nest
#

"good artists copy, great artists steal" Picasso

digital rose
#

lmao they just use images

#

i havent thought of that

digital rose
#

Whats the best gui tool to use for my usecase?

I need text that I can place wherever I want
I need buttons that I can click on that just run functions I make.

wooden escarp
#

@digital rose User tkinter

#

lol i said that wrong

#

use tkinter

#

tkinter a gui library

#

super good

digital rose
#

I just got pinged 3 times in general telling me to use tkinter

#

I guess im using tkinter

gritty gale
#

Can you make an nice looking modern ui with tkinter?

digital rose
#

whaaaaaat is this @digital rose

#

😂

#

what

#

the string prop

#

you make it art

#

idk lol

#

there is better way

#

the canvas

#

im making a photo in photoshop rn

#

but there is canvas

#

for that

#

you can darw with canvas rectangle and lineand Shape

#

is it hard?

#

no

#

easy

#

ok

#

yeah