#user-interfaces
1 messages ยท Page 66 of 1
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
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.
@ivory ember it works niceley, thank you
๐
Minecraft Autominer is the directory or the workspace?
Remove the first slash (and potentially the folder)
yes I did
nice
Why?
What the problem?
Ah
Easy to fix second I will show you how.
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
take a help channel
also
you defined a function twice
you can't re-use functions?
oh
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()
defining it, does not call it
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?
I think QComboBox is your best call
just use stylesheets with it
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
yes
what is your preferred language
if it is not english, we can go to DMs
@digital rose
How do I make a gradient going from top to bottom
i prefer the french
in a stylesheet
ok, french
you speak to ?@unique forge
qlineargradient
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>)
just realized i was kinda lazy
quick search found the solution
self.anim = QPropertyAnimation(self.<widget>, b"size")
self.anim.setEndValue(QSize(250, 150))
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
What is the general consensus on Kivy, for beginners?
I think it's okay
@ionic moat copy and paste the underlined text
Wdym?
text-decoration: underlined;
I can use HTML in a Stylesheet window??
no
not in stylesheet
like this
actually
double click it
and go to this window
that will do the html for you
it doesn't have rich text
oh ok
I think you should still go with PySide and Qt Designer though
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
yeah , go for kivy then!
so is this for tkinter?
We can help here...most of the time
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)
I don't know anything about Qt, but is there some sort of alpha/gamma setting from 0 to 1 to set transparency?
Why don't you set the bg color to the same color as the widget that contains them?
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
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
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);}
Also: 3 questions
- 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
- How do I underline a specific character of a QPushButton, like the first letter
1 QProperty Animation
- 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)
2: add an & before the character you want to be underlined
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
So, do you understand what the underline indicates?
that it's a shortcut?
correct
Like underlined N on a button means Ctrl + N to activate this?
in tkinter it would be called an accellerator
you create shortcuts by setting text as &New
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
I've never done that in designer so I couldn't say
I'll try by code
why don't you run uic and find out
strange
doesn't work for me
can you send the code in text form
maybe other things in my GUI is messing it up
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?
wdym
The application style.. I assume that means its default.
probably
try app.setStyle('Fusion')
Oh Qt Designer has an option for Fusion style
I've seen that
it works for that
but not default
only fusion style
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
Okay I pressed the shortcut
it acted like it clicked the button
but my cursor wasn't there
okay, still no underline though?
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
try clicking it first in default, then pressing the shortcut key
On Windows, there is a setting to "Always" show underlined characters. Usually in accessibility IIRC
still nothing
It was something weird I figured out like that to get them to show before just tweaking the stylesheet after using Fusion
hmm, well...
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
I wouldn't suggest doing that but I'm sure you could do something hacky like that
hmm, you have the choice of using Fusion
Well as long as I can make it look windowsy style then sure
but transparent in fusion is dark
Again, why are you using transparent?
The border is whats causing the gradient effect your seeing
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
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
Why don't buttons have rich text???
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
do you know why editing the style sheet of css QCheckBox::indicator makes the check mark invisible?
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
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)
image: url(path/to...
oh
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 ?
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?
Is there a way to my QCheckBox::indicator:checked without having a url(image)?
C++?
QSS
QSS Stylesheets
QCheckBox::indicator:checked {
image: "symbol in a string"}``` something like that
it's gotta be QSS
QSS is much smaller than CSS
I wish they were the same thing lol
that'd be much easier
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
Ty
A lot of the good tkinter docs can be found at https://tkdocs.com/shipman/index-2.html
Describes the Tkinter widget set for constructing graphical user interfaces (GUIs) in the Python programming language. Created by the late John Shipman. Last updated in 2013.
How do I connect QScrollArea to QScrollBar in Qt Designer
check Wanderson
he has a video on QScrollBar and QScrollArea
Okay
@unique forge but is there a way to do this via Qt Designer
if not, that's okay
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
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
you should open a help channel and state what the problem is if you need help with something
Hi
@narrow fable this has nothing to do with GUIs
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
I believe you need to provide x/y values for the window
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
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
@digital rose I just cant get a straight response from you!
I found 2 good sources of tkinter documentation: https://tkdocs.com/shipman/index-2.html and https://www.youtube.com/c/Codemycom/videos
nice thanks dude
Works great for my project at https://github.com/ayourk/HostsManager/blob/main/hostsman.py
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())...
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)
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
https://www.youtube.com/watch?v=uMnkTtv0A7U
Also, watch some of the videos at https://www.youtube.com/c/Codemycom/videos since he uses lambda: all the time in his videos.
thanks
Granted, they aren't exactly OOP orientated, but you should get a general idea.
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
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.
Don't you have to do `lambda: getPath(self, self.Dirpath)?
i dont think you need to for calling a function?
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.
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
What about lambda: self.getPath(...)?
yea now it's outputting a blankspace
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.
same output
Sorry, I haven't messed with Python OOP enough to know what else to do.
thats ok, thanks for trying lol
its for an assignment. i would never for a personal project

anyone familiar with pyqt5?
I am
why dont you go ahead and ask your question
what is that
What is what?
how to set multiple shortcut to a single button in pyside6?
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.```
Free, secure and fast downloads from the largest Open Source applications and software directory - SourceForge.net
Hey does someone know how i can make a sliding menu bar in kivy without using kivymd?
you need to go to that folder and copy and paste pyuic5.exe into that folder
then, you need to rename the file to uic.exe
nope, just need to put the file in the folder
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
oh i see, thanks for correcting me :)
thanks
it doesnt work
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
thats not correct
enter on a voice channel to I share my screen
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?
no
try viewing code again
ok
here
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.
did you find it?
ok
hmm
the file has the python icon
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()
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
your file is not called file.ui
ok
ok
@modest tendon PyQt5 is great
also @modest tendon tkinter is not deprecated
I dont think it is
no need for the double ping
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
is this python?
why do you have a ;
after each line
@obsidian hare also I like your pfp ๐
igglepiggle
lol thanks
I used to watch that when I was a baby lol
haven't done python in a while - and i started learning langs which require ; so it became a habit ig
lol
haha same
file dialog?
No. At the moment im just asking the user to input the path for the directory
yea sure
this stackoverflow shows an example of a filedialog https://stackoverflow.com/questions/57394016/browsing-file-and-getting-filepath-in-entrybox-in-tkinter
creating a user interface is hard in python , or am i wrong?
tkinter makes it easy
check into pyinstaller for that
how would i make a html and css ui with python as backend?
@vague skiff no it isnt hard
but if you use tkinter it is VERY frsutrating
use PyQt5 and Qt Designer instead
It can be frustrating. You just have to think in a different way.
also @digital rose use EEL
yeah ig
My project is mostly finished. I think I was able to get some fairly advanced stuff in it as a text editor: https://github.com/ayourk/HostsManager/commits/main/hostsman.py
thankyou this looks like exactly what i was looking for
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
.
omg yes it is. i have this tkinter assignment and i feel like im pulling my hair out the ENTIRE time
at this point, im like eff it
idc if its partial credit, i refuse to do anymore
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
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?
should i use kivy to make mobile apps?
same question lmao
idk i think its the only option
but then some other ppl say they loved it
Try it
theres also pyqt5
i was considering to just learn a new language
yea i think learning java is faster
but idk
rn im tryna code in kivy
I don't think you can make mobile apps with PyQt5
im getting stuck every 5 mins
its been 20 mins im trying to find whats the problem with my script
hows ur progress so far
im also coding in kivy rn
im trying to code my first project
yea
im just doing it to create a mobile app
yup same
but i think learning another langage would be easier
What resources are you guys using to learn Kivy
@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.
yes please
@warm spire https://discord.gg/2fW9YjPe
tysm !!
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.
@unique forge Thank you ! will try those tools!
you are welcome!
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.
anyone know how to fix this kivy problem?
assert(rule not in self.rulectx)
AssertionError
Ther is no index what u typed in
Ther is no ; in python
yea ik. It's a habit from other langs
and anyway, the python interpreter allows ;
This is not good to make a window usually Tk() and for the other windows is Toplevel()
Example:
from tkinter import *
root = Tk()
My_btn = button(master=root ,text="GG" ,bd=0)
My_btn.pack()
root.mainloop()
If you want a file dialog in tkinter it's easy.
from tkinter import filedialog
.....i just said they already showed me how to do it lol
It's have usefull functions like askopenfilename()
XD
Sorry about that
lol np
๐
Is there any downside in using Python + Electron? Anyone have experience with this combo
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
Have you tried PyQtGraph?
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
I don't know in pyqt sorry
@ionic moat right click, click Layout at the bottom, select horizontal or vertical alignment
can anyone tell how do i wait for userinput in a textinput box ?
please ping me if u know
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
Which module is best for user interfaces?
it depends on your level of knowledge of python
if you are a beginner go with Tkinter
intermediate and above you can go with PyQt5 KiviMD etc.
i'd recommend PyQt5 for sure. The amount of content and things you can do is staggering. That being said, it is harder to learn.
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.
assuming your main class is inherited from QMainWindow(), code widgets in the statusBar() like so:
self.statusBar().addPermanentWidget(<widget_here>)
ok thanks will try it
np
i know tkinter would you say i should learn pyqt or something else
For some reason that completely messes up the GUI
It resized the Q scroll area to very small size
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
with QPixmap, QImage, or QMovie
you have to code that though
Qt Designer doesn't have those widgets
oh ok ty
what is the widget in qt to enter text in multiple lines?
like a editor kinda thing
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
i think you mean
QtWidgets.QTextEdit()
anyone here familiar with Micropython?
I need help with writing a GUI on an OLED display with a rotary encoder.
thanks :D
anyone that have experience with tkinter can help me lagging after using socket?
lag as in?
not responding?
if so, use threading
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
im not sure how to do that, i tried but failed
i will send you a threading tutorial by realpython
try that and if you still fail , i will help :D
great thank you:)
np
i got unexpected statement
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
it is supposed to update the label every minute
so what is the problem here?
i got error unexpected statement
full traceback?
i think i used threading in a wrong place
hmm
tem_label.after(60000, command=threading.Thread(target=dht_client).start())
TypeError: after() got an unexpected keyword argument 'command'
after doesnt have the argument command i guess
i dont remember
check the docs
yeah , im not sure where should i implement threading
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
thats pretty complicated
i'd suggest finding stylesheet for PyQt5 online that looks similar, then applying it
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!!
It would be useful to see the full error
tkinter + pygame = animated GUIs
@elder grotto
we need to see the line
?
the full error you get back
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๐
.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
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
That makes sense, however I'm not sure how to be able to get user input and store it into a DB, without using dynamic variables(As the length of student names can increase or decrease, and using variable variable names is a bad idea according to countless online sources)
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
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
yes it will
i could be very wrong, quite the beginner ๐
this method should work
also what is studentnames
why are you iterating students over studentnames, then an unused iterator for every element of students
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()
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
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.
I'm sorry i dont understand?
I think if i explain this function it will be easier for you to understand
well for each student, you add three Labels at the same position on the grid
if there are three elements in the tuple
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
Wouldn't a checkbox do that job as well?
then when i press the submit button it saves to the Junction table along with the date.
Yes, i considered that, but you have to specify the variable name when initializing it, and i didn't know how to do that without using dynamic variable names.
The number of students can keep changing, hence so will the number of entry boxes
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
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
the radiobutton's variable is a tkinter Var not just a python variable iirc
like
also a checkbox and radiobutton are different, radiobutton is for multiple choice
ah, i was confusing the two
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
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
How could i go about doing this?
Before I write any garbage, your entire thing should look like this, right?
Yes!
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?
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)
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
I think its because i need to store the user input into a variable right?
and then put it into a list or a tuple
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
Yes, I can see how studentscould be confusing, will change!
I have kept row=i, and i iterates with every new iteration of the tuple studentnames
so ideally, each student name would be one under the other as the column remains the same
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
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
Ah, I can see how this can help
Oh right, for some reason i assumed that len would be 1 as only the variable had only 1 string
So the second loop is redundant right?
I've confused myself with my own code now๐
Not only redundant, also potentially breaking since it adds unneccessairly many entries into val
yes, you're right.
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
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?
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
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.
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
tk.BooleanVar() for _ in student Could you explain the significance of this line of code?
I dont seem to understand it
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.
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)
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?
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?
Can you show your code?
You can use message boxes instead of labels
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
yeah my fault, you'd need studentnames for that
So i change the student to studentnames right
https://www.geeksforgeeks.org/python-tkinter-messagebox-widget/ this could be applicable to you
Yup, iteration over studentnames will occurr as many times as the amount of students in there
Thanks
having a background task and updating a label based on that task is not as easy as it sounds; you won't get around threading.
I've written this: https://gist.github.com/Square789/46b0fdf0905c229567798ff9f3ebc275
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
not to intimidate you guys but.. yeah i think i win
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.
Is there an easy in Qt to translate a .UI file into a .PY file? Found it: pyuic5
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!
how to use signal & slot mechanism in PySide6 in QThread?
let me send you a good set of docs for QThread
It's exciting to find another channel of people passionate about GUIs in Python
are there any examples of nice UIs using QT? Doesn't have to be made in python
alright, thanks
do you need to use QT designer (the gui app)? is there any advantage/disadvantage to using it?
It makes it much much much easier
and it saves a lot of time and testing
Both of those were made using that
Are there any people that can help me smh with tkinter? GUIs are my underbelly... haha
I need 3 things:
- to change tk.Entry widget's border's color
- 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.
- 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 ๐
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
alright i think i will use QT designer then
thats really nice, good job
cool
any place for learn pyqt5 rather than docs
realpython has a short series on pyqt5
other than that see wanderson's yt videos
idk about other sources
ok thanks
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
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
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 ๐
The order in which you add widgets to the layout matters. The last one added has the opportunity to be resized in both directions.
I've found that it is best to use the pack layout for the main window, and grid within those packed items.
what is your guy's favorite messaging app in terms of UI?
doesnt have to be a real app, im just looking for inspo
Discord?
Not really my favourites but just throwing a few of the most popular ones out there for you to have a look at (although I'm sure you already know most of these):
WhatsApp, Telegram, Signal, Slack, Viber, Messenger, Twitter & Instagram DMs
i like slack
and signal
in terms of ui
think im going to try to do something like this
but with dark mode
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
ikr, its not mine, i just found it online
probably the best looking chat app ui I've seen
Have you had a look at Figma for designing the ui? seems like it'd be a good tool for design work
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
how can i use pyqt5 to recognize my gtk themes?
hey how do I change the z index of objects in pyglet
Hello, I would like to know, if it is possible to change the colors of the scroll bar in ComboBox in wxPython ?
@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.
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?
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....
How would i make a gui that when you press a button it picks random heads or tales, can anyone help, thx
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.
Take a look through the videos here: https://www.youtube.com/c/Codemycom/videos He has several videos that cover this.
ok thx
nice.
QThreads
what module would you make that with
idk, python isnt the best for mobile
I LOVE pyqt5, but its not suited for your project
im gonna make it desktop and mobile
you're better off with java
what would be for it?
or Kotlin or something
Desktop apps only
I posted a video about this awhile back on choosing the best GUI for different purposes. Scroll back a bit.
well i can do kivy for the mobile app and qt for the desktop
you can deploy to android though
I wouldnt, I would stick with one
can you send it again i dont see it
hmm. how about C?
I would choose Java
why would python be bad for mobile and what are the advantages of java
i know jaxaFX exists but i know nothing about it
hm
I am working on a mobile app with python, if it goes well, I will recommend python
kotlin is like java rooted right
I believe so
would it be practical to learn as my second language?
and ive heard great things about rust as well
thank you
I wish the moderators would pin that video in here.
@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)
^^ I think @red sapphire is one of the first people from here to review that video above.
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
yeah i wanted to do something like that but i want to stray away from electron
And yeah. My plan is a client for lots of different apps, sort of like Rambox, but with a unified UI for all the apps. The UI should be fairly simple, I just want it to look like a nice and simple Whatsapp clone, with a lot of customization options
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.
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.
Maybe learn react native
react is JS, right? would i need to use electron or run it as a browser?
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.
@ivory ember Everything you could ever want to know about using stylesheets in Qt https://doc.qt.io/qt-5/stylesheet-reference.html
I cant find a reason to leave sublime but I also really like vscode like a lot someone push me over the edge
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
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
Is there a full documentation about pyQt5 widgets (how to use them)
?
Like args.
Thanks
-__-
pycharm just feels very sluggish
maybe its my pc
I used it for a few weeks and I do enjoy it, it just feels very slow
Tkinter, is fine, it's just htat, we could be more efficent with a gui.
I already checked there. Sorry, but I'm probably just being dumb.
nvm, im dumb. Its at the very bottom, i was clicking on each widgets properties.
thx
yeah it is.
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?
It can be a very resource intensive program. It is the cost of the breadth of tools it offers.
I just use it for venv
Otherwise I've got 300MB of useless conda packages in my program
pretty neat
just screenshot them
dont forget to get them when they are active/red as well
self.setWindowFlag(qtc.Qt.FramelessWindowHint)
for what
to get the icons
I meant remove the bg of the icons
not the frame
ah, me dumb
probably, but im not aware of it
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
most likely
sure, why not
I think just a UI for now
use illustrator
idk how to use illustrator
its easy to learn
and I dont have it installed
photoshop doesnt use vectors though
true
hello
I use https://photopea.com
Photopea Online Photo Editor lets you edit photos, apply effects, filters, add text, crop or resize pictures. Do Online Photo Editing in your browser for free!
it's literally just online photoshop
just get GIMP, legit the same thing
If it's the same then what's the point
you don't need to be online and GIMP has a bit more things
doesnt really matter, just my opinion
GIMP is quite good
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
are you installing to the right python version
if you have python2, pip probably installed it there
try it with py pip3 install PyQt5
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
didn't help
try importing like this
from PyQt5 import QtWidgets as qtw
I just stuck at the first paragraph of the book
lmao
installing article lol
maybe it is some PATH thing
that I dont understand
Packt?
What version of Python?
also do you know where your Python folder is?
yep
python 3.7.6
I think
okay go to your Python37 folder
I did
Do you see a python37.dll and python3.dll file??
yep
it could be corrupted or gone
they are here(
well then it's most likely corrupted
yessir
also make sure it's 64 bit
ok
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.
can you try pip install pyqt5-tools
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.
bro, be PROUD of yourself. That's amazing, keep going an you'll have a great app.
@ivory ember Thank you, when I get my first sale, I promise that I will buy you a donut!
nah its good, all for the knowledge in my book
maybe make the background just a little bit darker, but other than that, it's great
Hello
So this is what happens when i try to run basic hello world example in kivy
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
Why y'll sending code in UI channel? or Am I wrong?
what method are you referring to inside py __init__()
its simply breaking it down into chunks of code rather than having it all in the init
