#user-interfaces

1 messages ยท Page 66 of 1

digital rose
#

Okay

#

Thanks. I figured it out ๐Ÿ˜„

red sapphire
#

I'm watching that video now!

#

I've also been looking into Ren'Py considering I'm doing gamedev. Seems like it might be entirely possible to not use it for its intended purpose, and instead just use it to display text and have interactable buttons and whatnot

dusty scarab
#

If you really want to code something easy, tkinter is nice enough. You can get it to be a bit more advanced if you put a little extra thought into it. Most people consider tkinter too primitive.

onyx hawk
#

@ivory ember it works niceley, thank you

ivory ember
#

๐Ÿ‘

modern marsh
#

Use threading

#

It's not very hard

buoyant reef
#

it says no such directory

#

but its in the file?

strange owl
#

Minecraft Autominer is the directory or the workspace?

tribal path
#

Remove the first slash (and potentially the folder)

digital rose
modern marsh
#

nice

digital rose
#

Why?

digital rose
#

Ah

#

Easy to fix second I will show you how.

sinful ember
#

does anyone know how to fix this error (It's on a function)

function already defined line 1

Sorry if im in the wrong channel, im new to python and dont know where it goes

unique forge
#

also

#

you defined a function twice

sinful ember
unique forge
#

wait

sinful ember
#

oh

unique forge
#

you define a function once

#

and you can call it whenever you want

#
def Hello():
    print("Hello")
#

this is a function

#

you can call it

#

whenever you want

#

with this

#

Hello()

sinful ember
unique forge
#

defining it, does not call it

sinful ember
#

im only defining it once

#

calling it here

ionic moat
#

In Qt Designer, how do I implement a button with a drop down menu next to it? Kinda like QComboBox except button-like?

#

Maybe I can make a stylesheet and code from QComboBox to fit my needs, but is there other ways?

unique forge
#

just use stylesheets with it

ionic moat
#

Oh

#

How do I use stylesheets for the button though?

#

like on the right

unique forge
#

I'm not sure

#

check out the docs

ionic moat
#

I did, I didn't get anything helpful

#

the only thing I got was how to edit it in stylesheets

#

but that resets the original

#

and the arrow in the middle is a url from an image I think

#

because when I edit it, it disappears

unique forge
#

try chunk

#
QComboBox::chunk {
//QSS Code
background-color: black;
}
digital rose
#

yes

unique forge
#

what is your preferred language

#

if it is not english, we can go to DMs

#

@digital rose

digital rose
#

yes

#

sorry

ionic moat
#

How do I make a gradient going from top to bottom

digital rose
ionic moat
#

in a stylesheet

unique forge
digital rose
#

you speak to ?@unique forge

unique forge
ionic moat
#

yeah but top to bottom

#

that one makes it go right to left

#

oh nevermind

#

thx

ivory ember
#

in PyQt5, how might one go about animating a button so the scale increases when it is clicked using

Qtc.QPropertyAnimation(self.<widget>, <what goes here>)
ivory ember
#

quick search found the solution

#
self.anim = QPropertyAnimation(self.<widget>, b"size")
self.anim.setEndValue(QSize(250, 150))
ionic moat
#

How do I underline a specific character in QPushButton

#

Something like this, the N is underlined like N

#

I want that

#

for the QPushButton

#

via QtDesigner

red sapphire
#

What is the general consensus on Kivy, for beginners?

unique forge
#

@ionic moat copy and paste the underlined text

ionic moat
#

Wdym?

unique forge
#

copy and paste

#

the underlined text you want

#

or

#

actually

#

use QSS

ionic moat
#

Okay

#

how do do that

#

I have the stylesheet window opened

unique forge
#
text-decoration: underlined;
ionic moat
#

what do I do

#

that's gonna underline the first character?

#

Only N

#

not ew

unique forge
#

hmm

#

use HTML

ionic moat
#

I can use HTML in a Stylesheet window??

unique forge
#

no

#

not in stylesheet

#

like this

#

actually

#

double click it

#

and go to this window

ionic moat
#

alright now it's letting me edit the text

#

this is for a QPushButton

unique forge
#

that will do the html for you

ionic moat
#

it doesn't have rich text

unique forge
ionic moat
#

only plain text

#

Idk why tho

unique forge
red sapphire
#

I watched the comparison video that was posted here a while ago and figured that Kivy would be simpler to pick up (made it sound like Qt has a lot of complication and some C++ leftovers). Also it seems like Kivy is easier to make cross-platform especially with mobile?

#

Qt definitely seems powerful but I think my main thing is keeping the learning curve small

modern marsh
#

yeah , go for kivy then!

dull trench
#

so is this for tkinter?

dusty scarab
#

We can help here...most of the time

ionic moat
#

Does anyone know how to overwrite a default QSS of a QPushButton without resetting the entire stylesheet? Windows 10 has a nice looking default button design, but I wanna change only the background of it to be transparent, but when I do that, it resets the entire stylesheet.

#

I want something that looks like this:

#

and when you hover, you get this:

#

right now I get this for my GUI

#

I wanna make the background transparent

#

(without affecting all the other stuff)

dusty scarab
#

I don't know anything about Qt, but is there some sort of alpha/gamma setting from 0 to 1 to set transparency?

eager beacon
#

Why don't you set the bg color to the same color as the widget that contains them?

ionic moat
#

I can do that?! Hold on lemme try

#

that looks like it freezes the buttons

#

no animations, no hover colour/animation, nothing

#

just makes the background transparent for the widget the buttons are in and freezes them, they're stuff functional, they can still do things

#

but they're like "dead" if you know what I mean

dusty scarab
#

Isn't there some sort of Z setting in the layout? Kind of like some form of layering stating which item is on top, bottom etc for the same X/Y

eager beacon
#

Qt doesn't work quite like that. What needs to happen is an additional entry in the stylesheet to address the hover functionality.

#
QPushButton::hover{background:rgb(200,200,255);}
ionic moat
#

Also: 3 questions

#
  1. Is there a way to animate the hover background, like instead of changing the background as soon as the mouse hovers over the button, it kinda like fades in
#
  1. How do I underline a specific character of a QPushButton, like the first letter
eager beacon
#

1 QProperty Animation

ionic moat
#
  1. How do I make a QPushButton that does nothing but bring down a drop down menu (with another button thing with an arrow pointing down that is attached to the button)
eager beacon
#

2: add an & before the character you want to be underlined

ionic moat
#

as seen here

#

before the character? I thought it was after

#

but it doesn't matter, it doesn't work

#

it doesn't underline anything

#

which is weird

#

this on Qt Designer by the way

#

it could be giving the wrong preview

eager beacon
#

So, do you understand what the underline indicates?

ionic moat
#

that it's a shortcut?

eager beacon
#

correct

ionic moat
#

Like underlined N on a button means Ctrl + N to activate this?

dusty scarab
#

in tkinter it would be called an accellerator

eager beacon
#

you create shortcuts by setting text as &New

ionic moat
#

I have this though

#

is this not the right way?

#

I think Qt Designer is lying to me, I don't think it's giving the right preview

eager beacon
#

I've never done that in designer so I couldn't say

ionic moat
#

I'll try by code

eager beacon
#

why don't you run uic and find out

ionic moat
#

Well it still doesn't underline it

#

can you try it on your side real quick?

eager beacon
#

uhh, I guess

#

oh, I never answered #3

ionic moat
#

strange

#

doesn't work for me

#

can you send the code in text form

#

maybe other things in my GUI is messing it up

eager beacon
#

I'm not sure if you can do it with a qpushbutton, you can use a QToolButton and set a menu on that button with the actions you want

#

then set QToolButton.InstantPopup I guess as the popupMode for the button

#

haven't tested but I think thats how I did it before

#

what style() are you using for your app object?

ionic moat
#

wdym

eager beacon
#

The application style.. I assume that means its default.

ionic moat
#

probably

eager beacon
#

try app.setStyle('Fusion')

ionic moat
#

Oh Qt Designer has an option for Fusion style

#

I've seen that

#

it works for that

#

but not default

#

only fusion style

eager beacon
#

well there you go

#

Oh... wait

#

I think I remember seeing a bug when I was using windows a while back

#

run your app and press shortcut once

ionic moat
#

Okay I pressed the shortcut

#

it acted like it clicked the button

#

but my cursor wasn't there

eager beacon
#

okay, still no underline though?

ionic moat
#

Nope, for default no

#

I don't know why it does that

#

but the shortcut works

#

the underline still is not there for some reason

eager beacon
#

try clicking it first in default, then pressing the shortcut key

dusty scarab
#

On Windows, there is a setting to "Always" show underlined characters. Usually in accessibility IIRC

ionic moat
#

still nothing

eager beacon
#

It was something weird I figured out like that to get them to show before just tweaking the stylesheet after using Fusion

#

hmm, well...

ionic moat
#

I can just hard code it in right

#

by getting like a character that looks like the letter N but with an underline

#

a non ASCII character

eager beacon
#

I wouldn't suggest doing that but I'm sure you could do something hacky like that

ionic moat
#

well I don't have a choice

#

Maybe I have to do it

eager beacon
#

hmm, you have the choice of using Fusion

ionic moat
#

Well as long as I can make it look windowsy style then sure

#

but transparent in fusion is dark

eager beacon
#

Again, why are you using transparent?

#

The border is whats causing the gradient effect your seeing

ionic moat
#

I have to use transparent because the button is infront of a gradient

#

I can't put a colour behind it because it'll obtruct the gradient

eager beacon
#

Oh, I couldn't see that from your screenshot

#

remove the border and then set a new one if the look you are going for needs one

ionic moat
#

Why don't buttons have rich text???

eager beacon
#

No idea why you would need it

#

the text is only there to tell the user what should happen when its pressed

#

use QPainter and you can make it look like an alligator with rich text coming out of its mouth if you wanted to

ionic moat
#

do you know why editing the style sheet of css QCheckBox::indicator makes the check mark invisible?

eager beacon
#

really its the same reason the hover went away on the button when you changed something. A new stylesheet was applied and you didn't supply an image of a checkmark for QCheckBox::indicator:checked

ionic moat
#

Wait so I have to load my own image?

#

what's the rule thing called

#

like I have to set to a url right?

#

like checkmark: url(path/to/check.png)

eager beacon
#

image: url(path/to...

ionic moat
#

oh

thick lance
#

Hi, i am trying to use tkinter to make a small interface for a programme, and i need dto get the chdir from the python opened file browser . But i can't manage to get back the chidir and if it is possible the name of the txt file to open . Could someone help me ?

maiden dragon
#

wasn't sure if this was the right place to post this so i tried general but had no luck there:

I have a python program running on some virtual machines. It seems for one reason or another the program is generating temporary files that are not being deleted and after some time it renders the VM useless would anyone have any experience that could help me fix this?

ionic moat
#

Is there a way to my QCheckBox::indicator:checked without having a url(image)?

ionic moat
#

QSS

#

QSS Stylesheets

#
QCheckBox::indicator:checked {
  image: "symbol in a string"}``` something like that
unique forge
#

I assume

#

maybe background-image

#

but thats CSS, not QSS

ionic moat
#

it's gotta be QSS

#

QSS is much smaller than CSS

#

I wish they were the same thing lol

#

that'd be much easier

dusty scarab
# thick lance Hi, i am trying to use tkinter to make a small interface for a programme, and i ...

This is relatively easy to do.

from tkinter import filedialog as tkfiledialog

try:
  txtfileName = tkfiledialog.askopenfilename(initialdir="/some/optional/path", title="Please provide location")
  if txtfileName != "" and txtfileName != ():
    txtfilepath = str(txtfileName).rpartition(os.sep)[0]
except Exception as exp:
  print("ERROR {str(exp)}")```
There are some good videos about how to do this at https://www.youtube.com/c/Codemycom/videos
thick lance
#

Ty

dusty scarab
ionic moat
#

How do I connect QScrollArea to QScrollBar in Qt Designer

unique forge
#

he has a video on QScrollBar and QScrollArea

ionic moat
#

Okay

#

@unique forge but is there a way to do this via Qt Designer

#

if not, that's okay

unique forge
#

stylesheets

#

@ionic moat wanderson uses Qt DEsigner for that video

ionic moat
#

Oh

#

Sorry I can't find the video

#

would it be okay if you can link it here?

#

nevermind I found it

#

The video tells me to layout vertically, but I can't

#

the thing is grayed out

ionic moat
#

Can I do something like css QScrollArea:vertical { slider-position: middle; } for QScrollArea to make the vertical scroll bar set to the middle by default

digital rose
#

Hello i need help with QT5

#

who can help me

eager beacon
#

you should open a help channel and state what the problem is if you need help with something

digital rose
#

yes but is only a little thinks

#

@eager beacon

digital rose
#

Hi

narrow fable
#

ai discord bot

unique forge
#

@narrow fable this has nothing to do with GUIs

obsidian hare
#
  def buttons(self):
    self.ForwardCanvas = tk.Canvas(self.window, width = 10, height = 10, background = "blue");
    self.ForwardButton = Button(self.window, text = "-->");
    self.ForwardCanvas.create_window(window = self.ForwardButton)

I'm trying to make some buttons on Tkinter, but this throws the error:

Traceback (most recent call last):
  File "main.py", line 39, in <module>
    main.buttons();
  File "main.py", line 12, in buttons
    self.ForwardCanvas.create_window(window = self.ForwardButton)
  File "C:\Users\redacted\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 2809, in create_window
    return self._create('window', args, kw)
  File "C:\Users\redacted\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 2766, in _create
    cnf = args[-1]
IndexError: tuple index out of range
tribal path
#

I believe you need to provide x/y values for the window

ionic moat
#

How do I set the position of two scroll bars, vertical and horizontal in a QScrollArea to 50%, halfway?

#

keep in mind that there's no QScrollBar here
these are all in a QScrollArea by default
I'm trying to do something like
QScrollArea.verticalScrollBar.setValue(50)
(pseudocode) something like that

thorny lava
#

Hi, if I create a new discord server, lets call it "Example", the Servers Icon is set to a picture "E".
Same, if I create a new gmail account, it starts with the first letters.

Does any1 know how this technique is called? I want to create something similar for my website and would like to research

mint cloak
#

@digital rose I just cant get a straight response from you!

fierce nova
#

why is tkinter documentation so bad

dusty scarab
fierce nova
#

nice thanks dude

digital rose
#

ui created with tkinter looks really shitty

#

do you guys really use it?

dusty scarab
obsidian hare
#
  def getPath(self, DirPath):
    print(DirPath);

  def pathEntryBox(self):
    self.DirPath = None;
    self.Path = tk.Entry(self.window, width = 100);
    self.Path.pack(padx = 0, pady = 0, side = TOP);
    self.PathButton = tk.Button(self.window, text = "Enter", command = getPath(self.DirPath));
    self.PathButton.pack(padx = 0, pady = 0);
    self.DirPath = self.Path.get();

I'm trying to get the input of an entry box when a button is clicked, but im a bit confused how to do it. getPath() and pathEntryBox() are in the same class so i can't call getPath() using ...command = getPath())...

dusty scarab
#

To get the text from an entry box, it should be as simple of just Entry.get()

#

And you can always use command=lambda: somefunc(params)

obsidian hare
#

What does the lambda do? Also Im not sure how to call the function when the button is pressed because you cant call a function that is defined in the same class as you caled it in i dont think

obsidian hare
#

thanks

dusty scarab
#

Granted, they aren't exactly OOP orientated, but you should get a general idea.

obsidian hare
#
 self.PathButton = tk.Button(self.window, text = "Enter", command = lambda: getPath(self.DirPath));

Err:

    return self.func(*args)
  File "main.py", line 23, in <lambda>
    self.PathButton = tk.Button(self.window, text = "Enter", command = lambda: getPath(self.DirPath));
NameError: name 'getPath' is not defined

I defined getPath() directly above the current function

#

@dusty scarab

dusty scarab
#

Post the complete code to a pastebin
!code

#

!paste

proven basinBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

obsidian hare
#

ok

dusty scarab
#

Don't you have to do `lambda: getPath(self, self.Dirpath)?

obsidian hare
#

i dont think you need to for calling a function?

dusty scarab
#

I realize when it comes to OOP, my code doesn't qualify so my perspective comes from that of a procedural background. Try using:

def getPath(self, DirPath="/some/fake/path"):```
to see if that is all it is.
#

That way, you are specifying a default value for the 2nd param and if you see "/some/fake/path" as output, you know you aren't passing params correctly.

obsidian hare
#

i just get the same error

   return self.func(*args)
  File "main.py", line 23, in <lambda>
    self.PathButton = tk.Button(self.window, text = "Enter", command = lambda: getPath(self.DirPath));
NameError: name 'getPath' is not defined
dusty scarab
#

What about lambda: self.getPath(...)?

obsidian hare
#

yea now it's outputting a blankspace

dusty scarab
#

a missing self screws one's self

#

In your __init__, try setting self.DirPath equal to some bogus value to see if that changes anything.

obsidian hare
#

same output

dusty scarab
#

Sorry, I haven't messed with Python OOP enough to know what else to do.

obsidian hare
#

thats ok, thanks for trying lol

fierce nova
livid vine
#

anyone familiar with pyqt5?

unique forge
#

why dont you go ahead and ask your question

digital rose
#

what is that

modern marsh
#

What is what?

meager spoke
#

how to set multiple shortcut to a single button in pyside6?

brisk sparrow
#

Hello, I am trying to make a gui to my python application, so I try to use PySimpleGUI and then I see a very cool designs on PyQt5, so I download PyQt5 from https://sourceforge.net/ website, I install, etc. and I create my first window. a really cool window. When I go to Form-View Code this show to me a really COOL error!

Unable to launch C:/Python35/Lib/site-packages/PyQt5/uic.```
digital rose
#

Hey does someone know how i can make a sliding menu bar in kivy without using kivymd?

modern marsh
#

that QtDesigner version is old i guess

#

idk

unique forge
#

then, you need to rename the file to uic.exe

unique forge
#

also @brisk sparrow that is not PyQt5, that is Qt Designer, which is a design tool used to make apps to be exported into PyQt5

modern marsh
#

oh i see, thanks for correcting me :)

unique forge
#

I was having the same problem

#

very easy fix though

brisk sparrow
#

thanks

brisk sparrow
#

I go to uic. folder and rename pyuic5 to pyuic.exe and uic.exe, then I go one folder back and i found pyuic.bat and i copy and rename the copy to uic.exe, I copy all the uic file names and rename to .exe

unique forge
#

thats not correct

brisk sparrow
#

enter on a voice channel to I share my screen

unique forge
#

no its fine

#

I will show you step by step

#

@brisk sparrow first, go into this folder C:/Python35/Lib/site-packages/PyQt5/

#

got it?

brisk sparrow
#

yes

#

sorry, my discord just lag and kick

unique forge
#

now

#

look for pyuic5.exe

brisk sparrow
#

yes

#

ok

unique forge
#

and rename it

#

to uic.exe

brisk sparrow
#

I only have pyuic.bat

#

I dont have .exe

unique forge
#

hmm

#

did you rename pyuic5.exe already?

brisk sparrow
#

no

unique forge
#

rename pyuic5.bat

#

to uic.bat

brisk sparrow
#

ok

#

ok, tehn

#

then?

unique forge
#

try viewing code again

brisk sparrow
#

ok

#

Nop..

#

the same error

unique forge
#

press Start button

#

and search

#

pyuic5.exe

brisk sparrow
#

ok

unique forge
proven basinBOT
#

Hey @brisk sparrow!

It looks like you tried to attach file type(s) that we do not allow (.exe). We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg, .webm, .webp, .flac, .afdesign, .m4a, .csv.

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

unique forge
#

did you find it?

brisk sparrow
#

in the search box no, but searching on the fiels explorer yes

#

files*

unique forge
#

ok

#

go to the folder pyuic5.exe is in

brisk sparrow
#

ok

#

ok

#

I am in there

unique forge
#

now

#

copy the file

brisk sparrow
#

ok

unique forge
#

and paste it in C:/Python35/Lib/site-packages/PyQt5/

#

then, rename it to uic.exe

brisk sparrow
#

ok

#

the same error

unique forge
#

hmm

brisk sparrow
#

the file has the python icon

unique forge
#

just use the command then

#

pyuic5 -x file.ui -o file.py

#

in the CMD

brisk sparrow
#

My pc is in portuguese and not in english

modest tendon
#

what lib should I use for ui

#

I was told tkinter is deprecated

#

ok

#

there is literally no reason for this not to work

#
import tkinter as tk

window = tk.Tk()
waxen wadi
#

I advise you to add this line

#
window.mainloop()
#

It's quite important for events, and it's highly recommended

#

Basically it should be always used

unique forge
brisk sparrow
#

ok

unique forge
#

name it your files name

#

and do it in the same directory

#

as the file

brisk sparrow
#

ok

unique forge
#

@modest tendon PyQt5 is great

#

also @modest tendon tkinter is not deprecated

#

I dont think it is

modest tendon
#

no need for the double ping

obsidian hare
#
  def getPath(self, DirPath):
    print(DirPath);

  def pathEntryBox(self):
    self.Path = tk.Entry(self.window, width = 100);
    self.Path.pack(padx = 0, pady = 0, side = TOP);
    self.DirPath = self.Path.get();
    self.PathButton = tk.Button(self.window, text = "Enter", command = lambda: self.getPath(self.DirPath));
    self.PathButton.pack(padx = 0, pady = 0);

Hey, can someone help? I'm not sure why the DirPath isn't printing. I'm new to tkinter

#

when i press the Enter button after inputting something in the Entry box, the console just outputs a breakline

unique forge
#

is this python?

#

why do you have a ;

#

after each line

#

@obsidian hare also I like your pfp ๐Ÿ™‚

#

igglepiggle

obsidian hare
#

lol thanks

unique forge
#

I used to watch that when I was a baby lol

obsidian hare
#

lol

obsidian hare
unique forge
#

are you trying to have a file dialog?

#

or something else

obsidian hare
#

file dialog?

unique forge
#

where the file manager opens

#

and you can choose a file

#

or folder

obsidian hare
#

No. At the moment im just asking the user to input the path for the directory

unique forge
#

ok

#

would you like to switch to a fileDialog?

obsidian hare
#

yea sure

unique forge
obsidian hare
#

thanks

#

Thanks! Managed to modify it to get the directory not the file, too!

vague skiff
#

creating a user interface is hard in python , or am i wrong?

dusty scarab
#

tkinter makes it easy

vague skiff
#

ty!

#

could i create a simple exe file at the 'end' with it ?

dusty scarab
#

check into pyinstaller for that

digital rose
#

how would i make a html and css ui with python as backend?

unique forge
#

@vague skiff no it isnt hard

#

but if you use tkinter it is VERY frsutrating

#

use PyQt5 and Qt Designer instead

dusty scarab
#

It can be frustrating. You just have to think in a different way.

unique forge
#

also @digital rose use EEL

dusty scarab
digital rose
ionic moat
#

Does anyone know how to change the colour of a Line in QT inside of a QWidget's stylesheet?
I did something like css Line { color: rgb(132, 132, 132); } but it didn't work

fierce nova
#

at this point, im like eff it

#

idc if its partial credit, i refuse to do anymore

ionic moat
#

All GUI development things are extremely difficult

#

tkinter where every single part is a living hell

#

PyQt5 where debugging is hard

#

and yeah

#

that's it

#

dunno about kivy but I heard it's a pain to set up

digital rose
#

Traceback (most recent call last):
File "c:/Users/lenov/Desktop/Coding/Fichiers Python/Victor/main.py", line 23, in <module>
kv = Builder.load_file('my.kv')
File "C:\Users\lenov\AppData\Local\Programs\Python\Python38-32\lib\site-packages\kivy\lang\builder.py", line 306, in load_file
return self.load_string(data, **kwargs)
File "C:\Users\lenov\AppData\Local\Programs\Python\Python38-32\lib\site-packages\kivy\lang\builder.py", line 373, in load_string
parser = Parser(content=string, filename=fn)
File "C:\Users\lenov\AppData\Local\Programs\Python\Python38-32\lib\site-packages\kivy\lang\parser.py", line 402, in init
self.parse(content)
File "C:\Users\lenov\AppData\Local\Programs\Python\Python38-32\lib\site-packages\kivy\lang\parser.py", line 511, in parse
objects, remaining_lines = self.parse_level(0, lines)
File "C:\Users\lenov\AppData\Local\Programs\Python\Python38-32\lib\site-packages\kivy\lang\parser.py", line 674, in parse_level
if current_property[:3] == 'on_':
TypeError: 'NoneType' object is not subscriptable

#

can someone help me with this error?

haughty crown
#

should i use kivy to make mobile apps?

digital rose
#

same question lmao

haughty crown
#

lmao

#

i was told it sucks and was slow

digital rose
#

idk i think its the only option

haughty crown
#

but then some other ppl say they loved it

dull trench
#

Try it

digital rose
#

theres also pyqt5

haughty crown
digital rose
#

but idk

#

rn im tryna code in kivy

haughty crown
#

oh

#

tell me how it goes

ionic moat
#

I don't think you can make mobile apps with PyQt5

digital rose
#

its been 20 mins im trying to find whats the problem with my script

warm spire
#

im also coding in kivy rn

digital rose
warm spire
#

same

#

its hard to find someone here that knows kivy

digital rose
#

im just doing it to create a mobile app

warm spire
#

yup same

digital rose
#

but i think learning another langage would be easier

digital rose
wanton grail
#

@warm spire @digital rose Kivy is easy to pickup than Java. I have done several apps with Kivy, it's awesome. There is a Kivy Server you can join incase you need help.

wanton grail
proud birch
#

Ok, So I want to use Micropython on an ESP32 to run an interface with a rotary encoder. The problem I have is I can't seem to quite wrap my head around the logic in the code to set something like this up. Any ideas?

#

I have coded in Python for a while. It's just this particular concept just seems to not quite click in my head.

#

I can figure the setting up of each of the screens, and most times just one screen is pretty easy to set up with a couple of buttons, but it's switching to another screen and the code still working that I can't quite figure.

#

Most of the other programs I have written use some sort of module that handles the switching between screens for me. Such as a web server you just write each page and link buttons to another page, or in pysimplegui, it has a way to handle that as well. It's just I'm having to write the code myself this time, and I don't quite get how it works.

vague skiff
#

@unique forge Thank you ! will try those tools!

unique forge
#

you are welcome!

tidal kayak
#

Hey guys! I have a 3D array (both as numpy and as list) which has 1's or 0's if there's a cube (voxel) there. I checked this topic on stack-overflow (https://stackoverflow.com/questions/44825276/visualizing-a-3d-numpy-array-of-1s-and-0s) and implement matplotlib to my project but it has got no interactive as you know. Is there any module suggestion for this?

vPython: I tried vpython, it works on my machine but depends on lots of additional modules I want less (in case I can't achieve my goal, I'll use it)
Mayavi: It is perfect but I couldn't install/run PyQt5 because of a problem I've mentioned in Qt forums here: https://forum.qt.io/topic/124252/symbol-lookup-error-lib-x86_64-linux-gnu-libqt5xcbqpa-so-5-undefined-symbol-_zn22qwindowsysteminterface24setplatformfilterseventseb
Glumpy: I checked it and it's so much powerful but hard to understand and implement. Actually, I don't want to spend that much of time to that project.
VisPy: I tried it with a backend of Qt, Wx or SDL2. When I tried to test it with vispy.test() it gives me an error which says there's no backend.
VTK: Same as glumpy, I think it's harder then Glumpy.

digital rose
#

anyone know how to fix this kivy problem?

#

assert(rule not in self.rulectx)
AssertionError

digital rose
obsidian hare
#

it's fine someone helped me :)

#

they should me how to do a file dialog

obsidian hare
#

and anyway, the python interpreter allows ;

digital rose
#

Example:

from tkinter import *
root = Tk()

My_btn = button(master=root ,text="GG" ,bd=0)
My_btn.pack()

root.mainloop()
digital rose
#
from tkinter import filedialog
obsidian hare
#

.....i just said they already showed me how to do it lol

digital rose
#

It's have usefull functions like askopenfilename()

digital rose
#

Sorry about that

obsidian hare
#

lol np

digital rose
#

๐Ÿ‘

sturdy skiff
#

Is there any downside in using Python + Electron? Anyone have experience with this combo

coarse wigeon
#

can anyone help with creating a board for a boardgame, but it's a 2d-cylinder shape? I'm trying to use tkinter

#

It's like a monopoly board (no grid in the center) but instead of line segments it's half circles

#

stadium / capsule board shape

ionic moat
#

Does anyone know how to make a QScrollArea move with the window?

#

like this

#

The top widget grows to the right

#

and the QScrollArea grows around

#

the whole bottom part of the GUI should be the QScrollArea

digital rose
#

I don't know in pyqt sorry

wanton grail
#

@ionic moat right click, click Layout at the bottom, select horizontal or vertical alignment

tired yarrow
#

can anyone tell how do i wait for userinput in a textinput box ?

#

please ping me if u know

hazy cosmos
#

nice project

deft bluff
#

hey guys

#

how can I assign a function to a menu bar element

#

in pyQt5

bright ravine
#

hi in pyqt5 designer how do i add an video
also its its not possible in that is there any way of adding it if yes how ?
i am new to pyqt5

chilly bear
#

Which module is best for user interfaces?

bright ravine
ivory ember
ivory ember
# bright ravine hi in pyqt5 designer how do i add an video also its its not possible in that i...

I almost never use the designer so I only know how to do this in code. You need to create a QMediaPlayer object along with a QVideoWidget(). Code it something like so:

#Specific imports
from PyQt5 import QtMultimedia as qtmm
from PyQt5 import QtMultimediaWidgets as qtmmw

#Making the widgets
self.player = qtmm.QMediaPlayer()
self.video_widget = qtmmw.QVideoWidget()
self.player.setVideoOutput(self.video_widget)

#Ways to call it
play_act.triggered.connect(self.player.play)
pause_act.triggered.connect(self.player.pause)
stop_act.triggered.connect(self.player.stop)

the code above is not complete, it simply shows you the basics of playing video.

ivory ember
ivory ember
#

np

hazy cosmos
#

i know tkinter would you say i should learn pyqt or something else

meager niche
#

Pyqt is better in my opinion

#

Just looks more modern

ionic moat
#

It resized the Q scroll area to very small size

novel rover
#

Hi don't know if i am i the good channel to ask question about sphinx documentation

#

don't know why i have this blue wheras i did a perfectly normal striing

unique forge
#

you have to code that though

#

Qt Designer doesn't have those widgets

bright ravine
#

oh ok ty

modern marsh
#

what is the widget in qt to enter text in multiple lines?

#

like a editor kinda thing

maiden dragon
#

I am sort of stuck using absolute positioning is there a way for me to use sizers if my controls dont fit on a gid at all

#

The black boxes show examples of places where a control needs to be idk how i can put things in the right places without using absolute positioning

ivory ember
proud birch
#

anyone here familiar with Micropython?

#

I need help with writing a GUI on an OLED display with a rotary encoder.

modern marsh
native compass
#

anyone that have experience with tkinter can help me lagging after using socket?

modern marsh
#

not responding?

#

if so, use threading

native compass
#

yes its like freezing for around every 5 seconds

#

this is my code

#
import socket
from tkinter import *
from tkinter.ttk import *


# main window
norex_window = Tk()
norex_window.title("AIO")
norex_window.geometry("1000x1000")
norex_window.configure(bg='white')


HOST = '192.168.0.72'  # raspberry pi's ip address
PORT = 8080


def dht_data_from_server(x):
    x1, y1 = x.split(",")
    return x1, y1


def dht_client():
    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        s.connect((HOST, PORT))
        while True:
            data = s.recv(1024).decode('utf-8')
            print(data)

            x_temperature, y_humidity = dht_data_from_server(data)
            temp = x_temperature
            hum = y_humidity
            # print("Temperature", temp, "C")
            # print("Humidity", hum, "%\n")

            # labels
            #tem_label.config(text=temp)

            hum_label.config(text=hum)

            # update every minute
            tem_label.after(60000, dht_client)
            hum_label.after(60000, dht_client)
            norex_window.update()

# room temperature widget labels

tem_label = Label(norex_window, font=('times', 15, 'bold'), background='white')
tem_label.place(x=500, y=500)

hum_label = Label(norex_window, font=('times', 15, 'bold'), background='white')
hum_label.place(x=500, y=530)

dht_client()

mainloop()
#

its receiving sensor data from rpi

modern marsh
#

i see

#

try to put the socket stuff in a separate thread using the threading module

native compass
#

im not sure how to do that, i tried but failed

modern marsh
#

i will send you a threading tutorial by realpython

#

try that and if you still fail , i will help :D

native compass
#

great thank you:)

modern marsh
ivory ember
native compass
#

i got unexpected statement

native compass
# modern marsh try that and if you still fail , i will help :D
import socket
from tkinter import *
from tkinter.ttk import *
import threading


# main window
norex_window = Tk()
norex_window.title("AIO")
norex_window.geometry("1000x1000")
norex_window.configure(bg='white')


HOST = '192.168.0.72'  # raspberry pi's ip address
PORT = 8080


def dht_data_from_server(x):
    x1, y1 = x.split(",")
    return x1, y1


def dht_client():
    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        s.connect((HOST, PORT))
        while True:
            data = s.recv(1024).decode('utf-8')
            print(data)

            x_temperature, y_humidity = dht_data_from_server(data)
            temp = x_temperature
            hum = y_humidity
            # print("Temperature", temp, "C")
            # print("Humidity", hum, "%\n")

            # labels
            tem_label.config(text=temp)

            hum_label.config(text=hum)

            # update every minute
            tem_label.after(60000, command=threading.Thread(target=dht_client).start())
            hum_label.after(60000, command=threading.Thread(target=dht_client).start())
            norex_window.update()

# room temperature widget labels

tem_label = Label(norex_window, font=('times', 15, 'bold'), background='white')
tem_label.place(x=500, y=500)

hum_label = Label(norex_window, font=('times', 15, 'bold'), background='white')
hum_label.place(x=500, y=530)

dht_client()

mainloop()

#

i added threading in update every minute line

modern marsh
#

wait

#

the tkinter.after is like a time.sleep right?

native compass
#

it is supposed to update the label every minute

modern marsh
#

so what is the problem here?

native compass
#

i got error unexpected statement

modern marsh
#

full traceback?

native compass
#

i think i used threading in a wrong place

modern marsh
#

hmm

native compass
#

tem_label.after(60000, command=threading.Thread(target=dht_client).start())
TypeError: after() got an unexpected keyword argument 'command'

modern marsh
#

i dont remember

#

check the docs

native compass
#

yeah , im not sure where should i implement threading

maiden dragon
#

related to what i asked ealirer but maybe someone has a more general idea. how would you go about making a UI that looks and functions similar to the one in tis picture

#

or this

ivory ember
#

i'd suggest finding stylesheet for PyQt5 online that looks similar, then applying it

elder grotto
#

Hey guys, I am using Tkinter, and I need to run a loop where I store the attendance status of each student into a database. To mark the attendance of each student, I am trying to loop the student name and a tkinter.entry widget in which the attendance is entered. However, as the number of students keep changing, I will need a variable number of variables to store the attendance value i got from the tkinter.entry widget. I tried doing this def markatt(): conn = sqlite3.connect('attendance_mgmt.db') c = conn.cursor() att = tk.Tk() c.execute('SELECT student_name FROM student') studentnames = c.fetchall() i = 0 j = 0 print(studentnames) att_values = {} l = len(att_values) for students in studentnames: att_values[student] = 'Unknown' for students in studentnames: for j in range(len(students)): tk.Label(att, text= students).grid(row = i, column = 0) att_values[student] = tk.Entry(att) att_values[i].grid(row = i, column = 1) i = i+1 tk.Button(att, text = "Submit", command = lambda: SubmitAtt()).grid(row = 0, column = 3) conn.commit() conn.close() To no success as i get the following error - IndexError: list assignment index out of range. This is because tk.Entry doesnt have a value. I am not sure how to be able to solve this problem I have and hope i can get some help. Thanks!!

knotty karma
#

It would be useful to see the full error

stray jackal
#

tkinter + pygame = animated GUIs

sage rune
#

we need to see the line

elder grotto
#

?

sage rune
#

the full error you get back

elder grotto
#

So i changed up the code a bit

#
        conn = sqlite3.connect('attendance_mgmt.db')
        c = conn.cursor()
        att = tk.Tk()
        c.execute('SELECT student_name FROM student')
        studentnames = c.fetchall()
        i = 0
        j = 0
        print(studentnames)
        att_values = []
        val = ''
        l = len(att_values)
        for students in studentnames:
                for j in range(len(students)):
                        tk.Label(att, text= students).grid(row = i, column = 0)
                        val = att_values.append(tk.Entry(att))
                        val.grid(row = i, column = 1)
                i = i+1
        print (att_values)
        tk.Button(att, text = "Submit", command = lambda: SubmitAtt()).grid(row = 0, column = 3)
        conn.commit()
        conn.close()```
#

to this

#
    val.grid(row = i, column = 1)
AttributeError: 'NoneType' object has no attribute 'grid'```
#

and this is the error im getting now

#

no idea why๐Ÿ˜…

amber roost
#

.append has no return value, so val in your double loop becomes None.
Also, a function named markatt sounds like a very bad place to create a Tk window in

#

For the lifetime of your tkinter application, only one Tk should exist and have its mainloop running

sage rune
#

to explain a bit further, lists are mutable so append directly changes the list you call it on, it doesn't return a new list

elder grotto
sage rune
#

what you want is py val = tk.Entry(att) att_values.append(val) val.grid(row = i, column = 1)

#

but that still won't work

#

you don't call grid like that

#

afaik

#

wait maybe you do

#

apologies, you do

elder grotto
#

Won't val will hold the att_val(user input) of only 1 student, there can be 30+ student names and i need user input(to mark attendance) for each student name on one page, which is why i thought i could use lists

sage rune
#

yes it will

elder grotto
#

i could be very wrong, quite the beginner ๐Ÿ˜…

sage rune
#

this method should work

#

also what is studentnames

#

why are you iterating students over studentnames, then an unused iterator for every element of students

elder grotto
#

studentnames is a tuple with the student names stored in my DB - i fetched it here c.execute('SELECT student_name FROM student') studentnames = c.fetchall()

sage rune
#

how is it a tuple

#

a tuple of what

#

ah i see

#

so why do you add a new student label for every element of this tuple

#

if it's like (name, age, birth) you add 3 identical buttons whose text is the tuple

elder grotto
#

so my goal is to display each student name, and then an entry box next to each student name, where the user can write either Absent or Present.

elder grotto
#

I think if i explain this function it will be easier for you to understand

sage rune
#

well for each student, you add three Labels at the same position on the grid

#

if there are three elements in the tuple

elder grotto
#

So my goal is to be able to mark the attendance for each student in the database, and then take the corresponding student_id, attendance status(user input) and the date, and add it to a junction table.

#

To mark the attendance, I want to display all the student names in one column one under the other, and a entry box next to each name so the user can type whether the student is present or absent

amber roost
#

Wouldn't a checkbox do that job as well?

elder grotto
#

then when i press the submit button it saves to the Junction table along with the date.

elder grotto
#

The number of students can keep changing, hence so will the number of entry boxes

amber roost
#

you mean for the BooleanVars of the checkboxes?

#

i mean, if your only choices are "Present" or "Absent", a textbox seems like the wrong choice of input form

elder grotto
#

I agree with you, however when if i want to use say a radiobutton, the syntax is as follows(w = Radiobutton ( window, variable = ..))

#

I'm not sure what to out the variable as, as each student has a unique attendance status

#

and the number of students are unkown

sage rune
#

the radiobutton's variable is a tkinter Var not just a python variable iirc

#

also a checkbox and radiobutton are different, radiobutton is for multiple choice

elder grotto
elder grotto
# sage rune like

In this case 'var' would store the value only one value in R1 right? I'm not sure how I can code this in a way that its dynamic and can store unique vales for each student

amber roost
#

You don't need the variable I think. Even if you do, creating a list of BooleanVars and linking them to the student's row is possible

elder grotto
amber roost
#

Before I write any garbage, your entire thing should look like this, right?

elder grotto
#

Yes!

amber roost
#

Since I'm confused what the difference between students and studentnames is: Is students just going to end up as a simple string of a student's name?

elder grotto
#

you're referring to the for loop right?

#

studentnamesis a tuple with fetched data of all student names from the DB

#

I've used students as an iterator in the for loop (Forgive me if i've used the terminology incorrectly)

amber roost
#

Because then I'm really confused why you have a loop running over each students string with an unused variable name that actually creates the widgets

#

It's not an iterator, it's more of an "iteration variable"

#

I guess you could call the for loop itself the iterator

elder grotto
#

and then put it into a list or a tuple

amber roost
#

students is very misleading anyways, if you have something like

fruitlist = ["Apple", "Orange", "Lemon"]
for fruit in fruitlist:
    print(fruit)

is way more expressive of the fact fruit contains a single fruit over fruits

#

The loop you wrote will create a widget for every single character in a student's name and then grid those in the same place

elder grotto
elder grotto
#

so ideally, each student name would be one under the other as the column remains the same

amber roost
#

I understand that (also for that there is a trick in python):

#

!d enumerate

proven basinBOT
#
enumerate(iterable, start=0)```
Return an enumerate object. *iterable* must be a sequence, an [iterator](../glossary.html#term-iterator), or some other object which supports iteration. The [`__next__()`](stdtypes.html#iterator.__next__ "iterator.__next__") method of the iterator returned by [`enumerate()`](#enumerate "enumerate") returns a tuple containing a count (from *start* which defaults to 0) and the values obtained from iterating over *iterable*.

```py
>>> seasons = ['Spring', 'Summer', 'Fall', 'Winter']
>>> list(enumerate(seasons))
[(0, 'Spring'), (1, 'Summer'), (2, 'Fall'), (3, 'Winter')]
>>> list(enumerate(seasons, start=1))
[(1, 'Spring'), (2, 'Summer'), (3, 'Fall'), (4, 'Winter')]
```  Equivalent to:

```py
def enumerate(sequence, start=0):
    n = start
    for elem in sequence:
        yield n, elem
        n += 1
amber roost
#

But if students is "Bob" for example,

for students in studentnames:
        for j in range(len(students)):
                tk.Label(att, text= students).grid(row = i, column = 0)
                val = att_values.append(tk.Entry(att))
                val.grid(row = i, column = 1)
        i = i+1
```, `range(len(students))` will become `range(3)` and prompt 3 labels to be created just for Bob, all in the same place
elder grotto
elder grotto
#

So the second loop is redundant right?

#

I've confused myself with my own code now๐Ÿ˜…

amber roost
#

Not only redundant, also potentially breaking since it adds unneccessairly many entries into val

elder grotto
#

yes, you're right.

amber roost
#

so if you have three students and the first is named "Bob", then val will be longer than 3

#

And the first three of the entries were basically created for the individual letters B, o and b

elder grotto
#

Ahhhh

#

Thanks for clearing this up!

#

I am extremely confused on how to tackle this problem though - Being able to store the status(user input) of an unkown number of student

#

Do i use a list itself?

amber roost
#

I guess this is how i would do it:

attendance_vars = [tk.BooleanVar() for _ in student]

for i, student in enumerate(studentnames):
    label = tk.Label(att, text=student)
    checkbox = tk.Checkbutton(att, variable=attendance_vars[i])

    label.grid(row=i, column=0)
    checkbox.grid(row=i, column=1)
```, it will create a variable for every single student and have them accessible from the list `attendance_vars`
However I must admit my experience with SQL and databases is effectively zero, so I don't know how beneficial this list will be for feeding the values back
elder grotto
#

But how do i implement that, if the tkinter entry widget has no value before the user clicks on the submit button

#

**Thank you so much! **This seems like a very simple yet effective solution. I should be able to iterate through the list and store the values in the DB quite easily.

amber roost
#

No problem, feel free to ping me if you need any more help or if you notice something very weird with only the last variable being affected

elder grotto
#

tk.BooleanVar() for _ in student Could you explain the significance of this line of code?

#

I dont seem to understand it

amber roost
#

That's a listcomp

#

!listcomp

proven basinBOT
#

Do you ever find yourself writing something like this?

>>> squares = []
>>> for n in range(5):
...    squares.append(n ** 2)
[0, 1, 4, 9, 16]

Using list comprehensions can make this both shorter and more readable. As a list comprehension, the same code would look like this:

>>> [n ** 2 for n in range(5)]
[0, 1, 4, 9, 16]

List comprehensions also get an if statement:

>>> [n ** 2 for n in range(5) if n % 2 == 0]
[0, 4, 16]

For more info, see this pythonforbeginners.com post.

amber roost
#

and that is basically a compacted form of writing the code in the first embed

#

I called it _ instead of n or student to make it clear the student name is not needed (Only a BooleanVar is created for each student, but the variable does not need to know its student's name)

elder grotto
#

Ah, I see. Thank you!

#
    attendance_vars = [tk.BooleanVar() for _ in student]
UnboundLocalError: local variable 'student' referenced before assignment```I'm getting the following error, but I'm not sure why, student isnt referenced before?
digital rose
#

Hello, for my application in tkinter I am really struggling to create a label that pops up when the task is over says "task completed" Can anyone help?

elder grotto
#

You can use message boxes instead of labels

digital rose
#

Would you mind sending me the code for that?

#

Or a video linked to it

#

All I am trying to do is make a label update in real time

amber roost
elder grotto
elder grotto
amber roost
#

Yup, iteration over studentnames will occurr as many times as the amount of students in there

digital rose
#

Thanks

amber roost
#

The idea is having a queue that both the UI (in the main thread) and the thread are aware of; the thread populates the queue and the UI has a method that schedules itself over and over in a set interval (There it's 50 ms) to read from that queue and change UI elements

digital rose
#

Lol Vivaan helped me with exactly what I needed!

#

Thank you thoughh

weary path
#

not to intimidate you guys but.. yeah i think i win

peak cove
#

does anyone know how i could pull off asynchronous console input with the curses module, somehow?

#

or if it is even possible?

#

if it helps, i am trying to do something similar to Vim's key sequences, where you can press a sequence of characters to execute a given function. however, i also want to have a timeout of sorts, which i figure i need asynchronous programming for.

the basic idea is that if i press, say o for example, and there are multiple mappings to o, it would wait, say, one second before running the base functionality for o, but if you press, say, ot, it would run code for ot. this would normally not be a problem, but the getch function blocks, and so it is not like i can run one while loop that updates a variable storing the last pressed key, and another one that checks for the times between key presses..

#

maybe this is not the best place to ask, but i am using the Curses module, so if anyone could redirect me if it is not the best place to ask it would be appreciated.

dusty scarab
#

Is there an easy in Qt to translate a .UI file into a .PY file? Found it: pyuic5

elder grotto
#

Hey guys, ```def SubmitAtt(attendance_vars):
conn = sqlite3.connect('attendance_mgmt.db')
c = conn.cursor()
c.execute("SELECT student_id FROM student")
student_ids = c.fetchall()
print(student_ids)
current_date = date.today()
print(current_date)
print(attendance_vars)
l = len(attendance_vars)
i=0
studentid = 0
while i<l:
att_status = attendance_vars[i].get()
print (att_status)
studentid = student_ids[i][0]
print (studentid)
c.execute("INSERT INTO AttJunc(student_id,current_date,att_status) VALUES(?,?,?)",(studentid,current_date,att_status))
i += 1
conn.commit()
conn.close()

def markatt():
conn = sqlite3.connect('attendance_mgmt.db')
c = conn.cursor()
att = tk.Tk()
c.execute('SELECT student_name FROM student')
studentnames = c.fetchall()
i = 0
print(studentnames)
attendance_vars = [tk.BooleanVar() for _ in studentnames]
for i, student in enumerate(studentnames):
label = tk.Label(att, text=student)
checkbox = tk.Checkbutton(att, variable=attendance_vars[i])
label.grid(row=i, column=0)
checkbox.grid(row=i, column=1)
tk.Button(att, text = "Submit", command = lambda: SubmitAtt(attendance_vars)).grid(row = 0, column = 3)
conn.commit()
conn.close()
``` this is my code^, my problem is that how many every check boxes i tick the boolean value remain as false. Does anyone know why?

#

Thanks in advance!

meager spoke
#

how to use signal & slot mechanism in PySide6 in QThread?

unique forge
rain tangle
#

It's exciting to find another channel of people passionate about GUIs in Python

weary path
#

are there any examples of nice UIs using QT? Doesn't have to be made in python

ionic moat
#

I did this a while back

#

I also finished this recently

#

QT can make amazing UIs

weary path
#

alright, thanks

#

do you need to use QT designer (the gui app)? is there any advantage/disadvantage to using it?

ionic moat
#

It makes it much much much easier

#

and it saves a lot of time and testing

#

Both of those were made using that

torn oak
#

Are there any people that can help me smh with tkinter? GUIs are my underbelly... haha

I need 3 things:

  1. to change tk.Entry widget's border's color
  2. to display progress status: I'm iterating over websites so I need to display the accumulator like Progress 1/100, then Progress 2/100 etc... but everything in of course one label.
  3. to display 2 frames next to each other like:
    LOOOONG UPPER FRAME
    frame1 | frame 2
    LOOONG LOWER FRAME

I'm also open for DMs and thanks in advance ๐Ÿ™‚

modern marsh
#

what would be the best way to retain the configuration of widgets in a Qt app

#

as in , if i want to resize it, it has to retain a certain order of the widgets

#

like any other app

#

i already use layout managers

weary path
ivory ember
ivory ember
bright ravine
#

any place for learn pyqt5 rather than docs

modern marsh
#

other than that see wanderson's yt videos

#

idk about other sources

bright ravine
#

ok thanks

unborn sand
#

Hey, I've got a question about tkinter
Is there any "default" way of resizing parent's widget (ttk.Frame in this instance) after inserting a child?
I've got an issue when adding another ttk.Frame with tk.Text and ttk.Checkbutton inside - part of it stay hidden

#

I suppose i could just increase the minimal width so it'd always be visible, but I'd feel better with actual understanding why it's a thing

unborn sand
#

Oh, i forgot to mention i use grid as the geometry manager
and the fact I put the frames inside a tab of ttk.Notebook
the whole hierarchy is basically
.!frame2.!frame.!notebook.!eventbase.!eventfield2.!text
where eventbase and eventfield are subclasses of ttk.Frame

unborn sand
#

I'm playing with tabs' .columnconfigure()
Apparently what's set inside a Notebook, stays inside a Notebook (so it has zero influence on the size of the parent)
Seems I need to redesign this part of my project ๐Ÿ™ƒ

dusty scarab
dusty scarab
weary path
#

what is your guy's favorite messaging app in terms of UI?

#

doesnt have to be a real app, im just looking for inspo

ionic moat
#

Discord?

crude axle
weary path
#

i like slack

#

and signal

#

in terms of ui

#

think im going to try to do something like this

#

but with dark mode

crude axle
#

love me some dark mode

#

I wish every app had a dark mode

#

Concept looks nice!

weary path
#

i'll put it as one of the inital options you get to choose from, im guessing a lot of people dont know their app has dark mode available so i want to make it easy for the user to set up on the initial install

weary path
#

probably the best looking chat app ui I've seen

crude axle
weary path
#

never heard of it

#

will give it a look when done with my homework

#

So far I'm probably either going to do QT or Kivy, they seem like the easiest and cleanest options

unkempt hamlet
#

how can i use pyqt5 to recognize my gtk themes?

drowsy reef
#

hey how do I change the z index of objects in pyglet

rugged monolith
#

Hello, I would like to know, if it is possible to change the colors of the scroll bar in ComboBox in wxPython ?

digital rose
#

@crude axle I wish every application and website had a dark mode because otherwise, my eyes would go straight to a bath and sleep there forever. the dark mode is like an angel because it's beautiful.

mighty gull
#

Hey Hey, I am converting a python2 program to python3. The project that i am converting uses gtk and i dont really have experiance with gtk nor py 2. The project uses gtk, pygtk and gobject. I found online that i can replace gtk and gobject with ```python
from gi.repository import Gtk as gtk
from gi.repository import GObject as gobject

But i was wondering what the difference between ``gtk`` and ``pygtk`` is. Can anyone help me with this?
coral oyster
#

Hi! Is anyone has an idea why my pyqt GUI is freezing under long process? otherwise it is working fine if the process does not takes so long time....

weary path
stable glade
#

How would i make a gui that when you press a button it picks random heads or tales, can anyone help, thx

dusty scarab
#

with tkinter, it is as simple as defining a function to do the heads/tails thing, and then putting that function name into the command= section of the button definition.

stable glade
#

ok thx

unique forge
unique forge
weary path
#

deciding between qt and kivy

#

what would you recommend

unique forge
#

idk, python isnt the best for mobile

#

I LOVE pyqt5, but its not suited for your project

weary path
#

im gonna make it desktop and mobile

unique forge
#

you're better off with java

weary path
unique forge
#

or Kotlin or something

unique forge
dusty scarab
#

I posted a video about this awhile back on choosing the best GUI for different purposes. Scroll back a bit.

weary path
#

well i can do kivy for the mobile app and qt for the desktop

unique forge
#

you can deploy to android though

unique forge
weary path
weary path
unique forge
#

I would choose Java

weary path
#

why would python be bad for mobile and what are the advantages of java

#

i know jaxaFX exists but i know nothing about it

unique forge
#

I mean python isnt suited for mobile apps

#

it would be all weird

weary path
#

hm

unique forge
#

I am working on a mobile app with python, if it goes well, I will recommend python

weary path
#

kotlin is like java rooted right

unique forge
weary path
#

would it be practical to learn as my second language?

dusty scarab
weary path
#

and ive heard great things about rust as well

dusty scarab
#

I wish the moderators would pin that video in here.

red sapphire
#

@weary path Kivy is designed for mobile and packages straighy to .apk. Go for that

#

Jumping ship to Java would be bizarre

#

I'd probably go HTML5/JS environment before that. All depends on what you're trying to do, and for simple UI stuff Kivy is fine

#

(Kivy is a Python framework like Qt)

dusty scarab
#

^^ I think @red sapphire is one of the first people from here to review that video above.

red sapphire
#

Ha yeah, it's good, basically helped me realize that Tkinter makes glorified poweshell/vbscript prompts...

#

And PyQt is more complex than i thought

#

Kivy seems to work great and should definitely be the go-to for small mobile apps though I'd avoid it for more serious applications

#

It also takes like 10 seconds to load all its dependencies which is kind of lame

weary path
weary path
sullen thunder
#

Hello, does anyone have any insight into Pyside6 QScrollarea widgets?

I am trying to adjust my code so that the scroll area will dynamically fill the QFrame it is residing in. I can provide code.

sullen thunder
#

The answer was staring at the screen for long enough. Long story short

The QScrollArea was built inside a QFrame inside of a QVBoxLayout. Remove the QFrame and place into the QVBoxLayout directly and boom dynamic Scrolling area.

shadow acorn
weary path
#

react is JS, right? would i need to use electron or run it as a browser?

ionic moat
#

React is kinda JS

#

I think I've only used it once

#

It's really neat

ivory ember
#

does anyone know where to find a list of subcontrols for each widget in order to apply stylesheets specifically to those parts. This is for PyQt5. Thank you in advance.

eager beacon
weary halo
#

I cant find a reason to leave sublime but I also really like vscode like a lot someone push me over the edge

red sapphire
#

Hmm are there any advantages at all though other than cosmetics?

#

Could convince you to switch to PyCharm perhaps because it's a true IDE

#

If you like Sublime roll with it

gusty sedge
#
delete_profile_root = tkinter.Tk()



sbar = tkinter.Scrollbar(delete_profile_root, orient=VERTICAL)
sbar.pack(side=RIGHT, fill=Y)


c_1 = tkinter.Canvas(delete_profile_root, yscrollcommand=sbar.set)

for bot_account in data_dict["bot_accounts"]:
    row_num = data_dict['bot_accounts'].index(bot_account)
    tkinter.Label(c_1, text=str(row_num)+"-->").grid(row=row_num, column=0)
    tkinter.Label(c_1, text=bot_account["username"]).grid(row=row_num, column=1)
    tkinter.Label(c_1, text=bot_account["password"]).grid(row=row_num, column=2)
    tkinter.Label(c_1, text=bot_account["proxy"]).grid(row=row_num, column=3)
    tkinter.Label(c_1, text=bot_account["proxy_login"]).grid(row=row_num, column=4)
    tkinter.Label(c_1, text=bot_account["proxy_password"]).grid(row=row_num, column=5)
    tkinter.Button(c_1, text="DELETE", command=partial(delete_account, bot_account, data_dict) ).grid(row=row_num, column=6)

c_1.pack(side=LEFT, fill=BOTH)
sbar.config(command=c_1.yview)


delete_profile_root.mainloop()```
#

why is the scroll bar not wkoring

#

i need help please

waxen wadi
#

Is there a full documentation about pyQt5 widgets (how to use them)

#

?

#

Like args.

#

Thanks

#

-__-

weary halo
#

maybe its my pc

#

I used it for a few weeks and I do enjoy it, it just feels very slow

alpine cairn
#

Tkinter, is fine, it's just htat, we could be more efficent with a gui.

ivory ember
#

nvm, im dumb. Its at the very bottom, i was clicking on each widgets properties.

#

thx

earnest torrent
meager spoke
#

I have a pyside6 widget in which i have override the keyPressEvent. When the focus is on any QLineEdit & when I press "Shift+Enter" the registered KeyEvent is correct but when focus is on QPushButton and then I press "Shift+Enter" the registered event has "Shift Key with ShiftModifier" Why is that so?

sullen thunder
red sapphire
#

I just use it for venv

#

Otherwise I've got 300MB of useless conda packages in my program

unique forge
#

I'm recreating discord with Qt Designer, what do you guys think?

ivory ember
unique forge
#

anyone know where I can get the maximise and minimise buttons

#

icons

ivory ember
unique forge
#

yeah I guess

#

and remove the bg

ivory ember
#

dont forget to get them when they are active/red as well

unique forge
#

eh

#

is there a better way

ivory ember
ivory ember
unique forge
#

to get the icons

unique forge
#

not the frame

ivory ember
ivory ember
#

and for the icons, you can remove the background in the image/screenshot so you just have the lighter-colored part and technically no bg

unique forge
#

maybe I can recreate them in photoshop

#

or paint

ivory ember
#

most likely

ionic moat
#

btw looks really neat so far

unique forge
ionic moat
#

is it just the UI?

#

or like is it gonna be functional

unique forge
#

I think just a UI for now

digital rose
unique forge
#

idk how to use illustrator

digital rose
#

its easy to learn

unique forge
#

and I dont have it installed

digital rose
#

photoshop doesnt use vectors though

unique forge
#

true

hazy cosmos
#

hello

unique forge
#

I think I'll just use MS paint

#

its easiest

hazy cosmos
#

yes

#

ms is good

digital rose
#

it simple icons

#

you could probably use some online thing

ionic moat
#

it's literally just online photoshop

digital rose
#

bruh

#

just pirate it

ivory ember
ionic moat
#

If it's the same then what's the point

ivory ember
#

you don't need to be online and GIMP has a bit more things

#

doesnt really matter, just my opinion

unique forge
#

GIMP is quite good

nimble grotto
#

guys I have problems with PyQt5 installing

#

I am installing it with pip install PyQt5

#

it goes successfully

#

but then

#

when I try to import widgets and others

#

it raises import error*

#

from PyQt5.QtWidgets import QApplication, QWidget ImportError: DLL load failed: ะะต ะฝะฐะนะดะตะฝ ัƒะบะฐะทะฐะฝะฝั‹ะน ะผะพะดัƒะปัŒ.

#

I have python 3.7

ivory ember
#

if you have python2, pip probably installed it there

#

try it with py pip3 install PyQt5

modern marsh
#

hello

#

for some reason , QMenu doesnt show up in garuda linux

#

but it does so in windows

#

is there any fix for that??

#

Example:

#

the top bar is ruined due to the absence of the menu

nimble grotto
ivory ember
#
from PyQt5 import QtWidgets as qtw
nimble grotto
#

ill try

#

didn't help

#

same error

#

ma brain starts melting ๐Ÿ˜ฆ

ivory ember
#

lol

#

mine too, cause that should work

#

ur original one was fine too

nimble grotto
#

I just stuck at the first paragraph of the book

#

lmao

#

installing article lol

#

maybe it is some PATH thing

#

that I dont understand

nimble grotto
#

Martin Fitzpatrick

#

"Create GUI Applications with python and qt5"

ionic moat
#

also do you know where your Python folder is?

nimble grotto
#

python 3.7.6

#

I think

ionic moat
#

okay go to your Python37 folder

nimble grotto
#

I did

ionic moat
#

Do you see a python37.dll and python3.dll file??

nimble grotto
#

yep

ionic moat
#

it could be corrupted or gone

nimble grotto
#

they are here(

ionic moat
#

well then it's most likely corrupted

nimble grotto
#

I should reinstall my python?

#

is it making sense if I make it to 3.8 or 3.9?

ionic moat
#

Make it 3.8 this time

#

Let's see

nimble grotto
#

yessir

ionic moat
#

also make sure it's 64 bit

nimble grotto
#

ok

nimble grotto
#

wow that helped

#

I installed 3.8.7

#

but now I have another error

#

:((((

#

qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

ionic moat
digital rose
#

How do you guys like this? I'm not done with it, many things to add. I am currently making a web browser, and there is a system where it will detect a new user, when there is a user using it for the first time, it will automatically give it a set-up process so the user can fill in his/her preferences.

ivory ember
digital rose
#

@ivory ember Thank you, when I get my first sale, I promise that I will buy you a donut!

ivory ember
ionic moat
modern marsh
#

yes! put an option for dark mode

#

also , which module did you use?

abstract relic
#

Hello

#

So this is what happens when i try to run basic hello world example in kivy

humble parrot
#

Hi newbie here! Why there is a method (or function) inside of "dunder init"? Can anyone please help me to understand this because this is the first time I have encountered this and did some research but cant find the answer ๐Ÿ˜ฆ . Thank you in advance!

def __init__(self, parent = None): super().__init__(parent) self.setWindowTitle('QMainWindow') self.setCentralWidget(QLabel("I'm the central widget.")) self._createMenu() self._createToolBar() self._createStatusBar()

P.S. code is not mine

radiant dagger
#

Why y'll sending code in UI channel? or Am I wrong?

ivory ember
tribal path
#

its simply breaking it down into chunks of code rather than having it all in the init