#user-interfaces

1 messages · Page 89 of 1

sinful pendant
#

I am struggling to arrange these labels to be as we see in whatsapp and other platforms is there any way

sinful pendant
#

Ot seems like justify dont work when we have fill or expand setted in pack

umbral oracle
#

bro i said other than the licence

unique forge
#

Nothing

umbral oracle
#

ah, thanks

coarse mirage
#

How can I get def next_button_click(self): to run in def back_button_click(self):?

Adding MainWindow.next_button_click(self) at the end of the code doesn't work.

    def back_button(self):
        self.back_button = QPushButton(self)
        self.back_button.setEnabled(False)
        self.back_button.clicked.connect(self.back_button_click)
        self.back_button.setStyleSheet("QPushButton"
                               "{"
                               "background:yellow;""background-image : url()"
                               "}"
                               )
        self.back_button.resize(7,88)
        self.back_button.move(22,518)
        
    
    def back_button_click(self):
        try:
            if self.type_info_order:
                if self.type_info_order ==0:
                    self.type_info_order = 4
                else:
                    self.type_info_order -=1
        except: AttributeError
        try:
            if self.ability_info_order:    
                if self.ability_info_order ==0:
                    self.ability_info_order = len(self.abilities) - 2
                else:
                    self.ability_info_order -=1
        except: AttributeError
        MainWindow.next_button_click(self)

Full code snippet: https://paste.pythondiscord.com/urolijugal

sinful pendant
#

😅 widget.columnconfiguration saved the project 🔥🔥🔥

proven basinBOT
#

Hey @serene umbra!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

serene umbra
#

Hello guys, i am practicing tkinter by making some basic random project.

I am currently practicing on switching between multiple frames. and my frames will appear in the green portion of the screen, and the size of the frames should be equal to the size of the green portion.

(Here, the blue and grey nav bar are created using labels and also the green portion is also created using label.)

This is what i am getting as my output. my all frame's size is not equal to the size of the green portion.

My code: https://paste.pythondiscord.com/umoyubofuy

proven basinBOT
mighty rock
#

There's actually a widget in tkinter.ttk for web browsers' like tabs, it's called Notebook, I think

#

!d tkinter.ttk.Notebook

proven basinBOT
mighty rock
#

Yeah, this is it.

#

Good luck on your project, by the way

#

Well done so far

serene umbra
urban idol
#

Is Qt designer free to use?

mighty rock
#

Free to use, but they don't allow publishing a commercial app

warm flower
#

how do i use kinter

#
root.title('Fisher Version 1.0')
canvas = tk.Canvas(root, width=150, height=200)
canvas.grid(columnspan=1)

hotkeyLabel = tk.Label(root, text="Key for start/stop")
hotkeyLabel.grid(columnspan=1, column=0, row=0)

root.mainloop()
#

this allows me to actaully make the window

#

but when i put my actual code for the program above the root.mainloop() it doesnt show the window

urban idol
warm flower
urban idol
#

wdym

warm flower
#

look for example rn

#

on my question

#

canvas = tk.Canvas(root, width=150, height=200)

#

tk.Canvas(params) wont work if i change it the qt thing

#

i think the parameters go as (locationx, locationy, width, height)

#

while the kinter does (root, width, height)

#

idk how pyside6 works

#

but im guessing same principle

#

any way

urban idol
#

oh I was talking to Roie, not you

warm flower
#

yh lol i knew but still itr wont work unless you know what your doing, even then might aswell write the whole thing in Pyside6

unique forge
unique forge
#

publish as commercial app

urban idol
unique forge
subtle verge
#

is pysimplegui nice ?

#

it looks easy to use

#

can i use it in my projects ?

languid oracle
#

What do u guys think

subtle verge
#

that's nice

normal rock
clear rivet
#

hey guys i need some advice im new to python and building a pyside2 /qt GUI for fing cli it works but im trying to get rid of This

#

self.ui.pushButton_1.clicked.connect(lambda: self.Tile_action(self.ui.Ports_Label_1,self.ui.Ip_Label_1.text()[5:],self.ui.Mac_Label_1.text()[6:]))
self.ui.pushButton_2.clicked.connect(lambda: self.Tile_action(self.ui.Ports_Label_2,self.ui.Ip_Label_2.text()[5:],self.ui.Mac_Label_2.text()[6:]))
self.ui.pushButton_3.clicked.connect(lambda: self.Tile_action(self.ui.Ports_Label_3,self.ui.Ip_Label_3.text()[5:],self.ui.Mac_Label_3.text()[6:]))
...
self.ui.pushButton_25.clicked.connect(lambda: self.Tile_action(self.ui.Ports_Label_25,self.ui.Ip_Label_25.text()[5:],self.ui.Mac_Label_25.text()[6:]))

#

thats my aproach
def setSignals(self):
button = []
for i in range(0,25):
num = str(i+1)
mlabel = eval(f"self.ui.Mac_Label_{num}")
ilabel = eval(f"self.ui.Ip_Label_{num}")
plabel = eval(f"self.ui.Ports_Label_{num}")
button.append(eval(f"self.ui.pushButton_{num}"))
button[i].clicked.connect(lambda: self.Tile_action(plabel,ilabel.text()[5:],mlabel.text()[6:]))

clear rivet
#

so this function is weird it connects all buttons but with only the last label number

mighty frigate
#

you probably don't need to named your buttons at all, you can just store them in an array

#

and access it by index

#

especially if you have 25 buttons, it doesn't make a lot of sence to me

fathom flicker
#

7c

#

ds

proven basinBOT
#

:incoming_envelope: :ok_hand: applied mute to @fathom flicker until <t:1647448433:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).

opal otter
#

how do I make this in tkinter

It looks like a text box to me
I've put some example text( in cyan)

  • assume there were 5 ranks

**unsure of how it would have those columns
unsure of how it would be able to scroll **

  • also unsure of how to have a scrollbar there(pointed with little black arrow)
#

From my knowledge I can create textboxes, but unsure of those 2 things
how would I go about it?

jolly flower
#

and somehow is popular

gusty trout
#

what are some common ways to use python output in another form or screen to make it more user friendly for viewers

opal otter
jolly flower
#

if you are interested in windows form apps

opal otter
#

I'll give it a go

jolly flower
#

and after you done designing you can convert the code into a python code and link whatever functions you want

#

and you can insert images and backgrounds and else just try it by yourself

opal otter
#

Ohh

final escarp
#

Is it possible to set the color of a widget in Tkinter as same as system accent color?

tawdry mulch
tawdry mulch
opal otter
#

oh for the columns

#

thanks

mighty frigate
#

idk for tkinter but Qt can def get triggering sometimes

#

as long as you stay in the most simple cases, everything's fine

#

but when you want more advanced things...

opal otter
#

how would I align my treeview to center
and also change its height flushthonk

#

whenever I try to search it just shows how to change row height

tawdry mulch
#

If not, use padx option

opal otter
#

I will be placing more

#

placed a button

#

so want to continue with grid

tawdry mulch
#

use padx

opal otter
#

okay will try

#

that works, but its like not a responsive centering

tawdry mulch
opal otter
#

I'm trying to achieve this gui layout

#

will pack instead of grid be possible on it?

tawdry mulch
opal otter
#

Okay 😁

wary grotto
cobalt ibex
#

Could anyone point me to any good terminal UI libraries?

digital rose
#

Does anyone of you has ui ux Design notes? Like for terminology or anything ? If yes, plz share!

wary grotto
wary grotto
digital rose
little steppe
#

is there a way to create a textbox the program user can enter something in?

sinful pendant
#
if framework=='tkinter':
    print('yes')
else:
    print('idk')
opal otter
#

how would I go about changing the cell 2,0 and 2,2 to 50% of their original height
while increasing the heigh of the cell 2,1 to take up that extra space

#

I've heard of weights but unsure of how to use weights for specific cells
instead of just rowconfig and columnconfig

little steppe
sinful pendant
sinful pendant
opal otter
#

wont that affect

#

row to row

#

I want to affect a cell

sinful pendant
#

U aftect grid row and column and wi affect the shaoe

#

Just try this

widget.grid_rowconfigure(cell_row, weight=2)
widget.grid_columnconfigure(cell_col, weight=2)
#

Aa u moght need to pack those cells with sticky argument of therr are some diff6 behaviours

digital rose
#

is kivy a good ui?

agile spade
#

For better ui

wooden stirrup
#

has pyside and pyqt both 5 and 6 amazing reference and books and forums videos are great and cheap

pale plover
reef ether
#

` import pandas as pd
import folium
import glob
from ipywidgets import interact, interactive, fixed, interact_manual, Layout
import ipywidgets as widgets
from IPython.display import display
import datetime as dt

all_files = glob.glob("*.csv")
li = []

#function to make a color code for distance
def color_producer(total_distance):
if 4100 < total_distance < 4300:
return 'green'
else:
return 'red'

map = folium.Map(zoom_start=14, control_scale=True,tiles='Stamen Terrain')

def change_parameters(start ,end ):

for filename in all_files:
date1 = filename.split('_')[1] #split filename to name and date
date1 = date1.replace('.csv','')
date2 = dt.datetime.strptime(date1, "%Y-%m-%d")
if start <= date2 <= end: #compare the file if it falls within the range
df = pd.read_csv(filename, index_col=None, header=0)
li.append(df) #append to the list

car_location = pd.concat(li, axis=0, ignore_index=True)
total_distance = pd.concat(li, axis=0, ignore_index=True)
car_location = car_location[["Latitude", "Longitude"]] 
total_distance = total_distance[['total_distance']]
total_distance = (total_distance).iloc[-1] #To read last value in "total_distance" column
total_distance = int(total_distance) 
folium.PolyLine(car_location, color=color_producer(total_distance), weight=3.0, opacity=1).add_to(map) 
li=[] 

map

start_date = widgets.DatePicker(
description='Start Date',
disabled=False
)
end_date = widgets.DatePicker(
description='End Date',
disabled=False
)

widgets.HBox([start_date, end_date])

out = widgets.interactive_output(
change_parameters,
{'start': start_date,
'end': end_date
}
)
ui = widgets.HBox(
[widgets.VBox(
[widgets.Label(), start_date, end_date])
],
layout=Layout(display='flex', flex_flow='row wrap', justify_content='space-between')
)
display(ui, out) `

#

Can some one help me what’s wrong

#

My input doesn’t plot the map !

warm flower
#

Is there a way that root.after can be put into a condition?

coarse mirage
#

For some reason the image for the label I've created isn't showing up in PyQt.

Here's a small snippet.

        self.button_lights = QLabel(self)
        self.pixmap_buttons = QPixmap(f"{start}/assets/passets/buttonloading.png")
        self.button_lights.setPixmap(self.pixmap_buttons)
        self.button_lights.setGeometry(23,92,10,470)

And here is more of the mainwindow code: https://paste.pythondiscord.com/dikugevofi

Is there something I'm doing wrong?

plush stream
#

double check the path

#

make sure it's correct

#

pyqt wont spit out any error nor warning if you have invalid path

coarse mirage
#

I'm an idiot and that was the issue. Thank you.

supple grove
#

I am creating a UI in python. This will require the creation of marklist for students in a school for a particular subject. I need to save this data into an SQL database. Then create a graph of the highest mark in each month in a year. Can anyone send me a link to any tutorial which can help me? Please tag me when you answer.

smoky hinge
#

hi all

I am writing a tool that would have loads of args
an example is
--instance-start
--instance-stop
--ssh-add
--ssh-remove

Is there a way could configured the arg parse to accept

tool.py --instance --start
tool.py --instance --stop
etc

like nested arg parser ?

Thank you in advance for any advice !

smoky hinge
magic tide
#

Hello people! I have troubles installing pyinstaller some1 helps me? Btw it gives me errors

#

Ping me if answer

ivory ice
#

what error?

#

@magic tide

magic tide
#

Hi there

ivory ice
#

hi

magic tide
#

It can't be installed

#

Like an error in the installer online

ivory ice
#

send a pic

magic tide
#

Well.. im pretty busy rn is it ok if i send later?

ivory ice
#

sure!

magic tide
#

Ty

ivory ice
#

if you want to convert to exe you can use py-to-exe as well

#

pip install py-to-exe

#

it works just as well

#

just in case

final escarp
#

PyInstaller make my Python app opens very slow for me

#

does pytoexe slow?

ruby igloo
coarse mirage
#

So I've done this:

#The "Mother Code" Run        
    def extract(self):
        self.loading = True
        load_flash =  self.button_lights.setPixmap(QPixmap(f"{start}/assets/passets/button_loading_loading.png"))
        self.pokemon = self.line.text().lower()
        Data.run_api(self,"pokemon", self.pokemon)
        x = 0
        while self.loading:
            x+=500
            QTimer.singleShot(x, lambda: load_flash)
            x+=500
            QTimer.singleShot(x, lambda: Data.error_light_off(self))
            MainWindow.button_activation(self)
            self.name = self.data["name"].title()
            print(self.name)
            print(Data.ability_list(self))
            Data.ability_effect(self)
            print(self.long_effects)
            print(self.short_effects)
            Data.height_weight(self)
            Data.type(self)
            Data.misc_info(self)
            Data.attacks(self)
            Data.create_attack_summary_list(self)
            Data.find_sprites(self)
            Data.show_sprites(self)
            self.borders_screen.setPixmap(QPixmap(f"{start}/assets/passets/foreground.png"))
            Data.stat_updates(self)
            Data.type_image_updates(self)
            print(self.attacks_levelup_name)
            self.loading = False
        self.button_lights.setPixmap(QPixmap(f"{start}/assets/passets/button_loading_complete.png"))

And while the code runs, what's in the QTimer doesn't run until the very end.

Messing around with it, even if I take the code out of QTimer and just have the image only change once it still doesn't run until the end of the code when everything else is finished.


Can anybody please help me with the above?

cursive basin
#

does qt has this type of widget

rocky dragon
#

A QSlider

digital rose
#

Guys, I've a list of data which I need to display in sequence using my tkinter module

#

How do I achieve it?

#

So, lemme give a glimpse. I've a list of text messages

#

These messages should be displayed in a sequential order. Kindly tell me what code should I employ at Tkinter module to make sure that the data present in the list is displayed sequentially

#

Please guys, somebody guide me. I have asked for help multiple times but have received none

tawdry mulch
final escarp
#

so you can show me what is the best setting for that?

tawdry mulch
tawdry mulch
final escarp
#

ah got it

#

ok I will try

#

thanks

coarse mirage
#

How do I choose whereQScrollArea() is place on my main window?

It seems no matter what I do it doesn't move.

setGeometry ends up doing nothing.

Here's my code:

        self.summary_screen = QLabel (placeholder_text, self)
        self.summary_screen.setGeometry(45, 463, 440, 180)
        self.summary_screen.setStyleSheet("color: black")
        self.summary_screen.setFont(QFont('Arial',13))
        self.summary_screen.setWordWrap(True)
        
        self.scroll_area = QScrollArea()
        self.scroll_area.setWidget(self.summary_screen)
        self.scroll_area.setWidgetResizable(True)
        self.scroll_area.setFixedHeight(120)
        self.scroll_area.setFixedWidth(440)
        self.scroll_area.setGeometry(QtCore.QRect(145, 463, 400, 180))
        self.layout_area = QtWidgets.QVBoxLayout(self)
        self.layout_area.setGeometry(QtCore.QRect(145, 600, 400, 180))
        self.layout_area.addWidget(self.scroll_area)
        
digital rose
#

Is there a way to hide an AsyncImage in Kivy?

#

Nevermind.

magic tide
tawdry mulch
magic tide
#

How?

#

Tell me the windows process to do that

balmy pebble
magic tide
#

Oh ty. And for win?

balmy pebble
#

win?

#

ig win32 is windows only

digital rose
mighty frigate
#

@coarse miragethe same as any other widget, really

#

in your case you probably have to do something on the layout

echo phoenix
#

Is it possible to use react with Python?

coarse mirage
coarse mirage
#

Like I just want the white box in the middle to go where the white box is at the bottom.

leaden plover
#

i've been trying for a bit to use a for loop to add images to no success. any ideas?

def nextImg(filename):
    print(os.getcwd())
    root.title(filename + " - test") 
    label = Label()
    photo = ImageTk.PhotoImage(Image.open(filename))
    label.image = photo
    label.pack()
for filename in os.listdir(folderSelected):
    unused, fileExtension = os.path.splitext(filename)

    if "png" in fileExtension:
        nextImg(filename)

    elif "PNG" in fileExtension:
        nextImg(filename)```
mortal marten
#

you will save youraelf a lot of time and trouble in the long run

coarse mirage
tawdry mulch
#

And you can also shorten your if condition

leaden plover
tawdry mulch
leaden plover
#

i had two versions

#

the first had it inside

tawdry mulch
#

Label(root,image=photo)

tawdry mulch
#

Come up with a third version then

leaden plover
leaden plover
dense minnow
#

i looped a bunch of buttons with tkinter module and i have appended it to a list now is it possible to configure a button which is part of the list when i click the button

tawdry mulch
dense minnow
#
x=0
z=0
blist=[]
for i in range(0,10):
  b99=str(i)
  b99=Button(dscreen,text=f"{i}",width="2",height="1").place(x=20+z,y=80+x)
  blist.append(Button)
  z=z+30
  x=x
#

for example i am creating 10 buttons so if i click on say the 7th button how do i configure that

dense minnow
tawdry mulch
dense minnow
#

so basically i want them to turn into a diff color when i press them

tawdry mulch
#

Create a functtion function and link it with a button @dense minnow

dense minnow
#

yea

#

but i tried that

#

so basically my problem is that even if i call a funtion how does python identify what button i pressed

tawdry mulch
dense minnow
#

yea i get that but how will i does python identify which button to pass as an arguement

tawdry mulch
dense minnow
#
    z=0
    x=0
    j=0
    blist=[]
    for i in m:
        if i[0]=="H1":
            x=x+40
        if j<=9:
            b99=str(i[0])
            b99=Button(dscreen,text=f"{i[0]}",width="2",height="1",bg="black",fg="white").place(x=20+z,y=80+x)
            z=z+30
            x=x
            j=j+1
            continue
        if j>=10 and j<28:
            b99=str(i[0])
            b99=Button(text=f"{i[0]}",width="2",height="1",bg="black",fg="white").place(x=70+z,y=80+x)
            blist.append(Button)
            z=z+30
            x=x
            j=j+1
            continue
        if j>=28:
            b99=str(i[0])
            b99=Button(text=f"{i[0]}",width="2",height="1",bg="black",fg="white").place(x=120+z,y=80+x)
            z=z+30
            x=x
            j=j+1    
        if j>37:
            j=0
            x=x+40
            z=0    ```
#

i get something like this

#

now i wanna change the color of the button to something else when i press it

#

@tawdry mulch

tawdry mulch
#

blist.append(Button) isnt the right way

#

blist.append(b99) is correct

#

But let me tell you, there is no point in saving it like this. It is all None

dense minnow
#

so there is nothing i can do?

#

unless i create the buttons with seperate variables

#

without a loop

tawdry mulch
#

and then append it

dense minnow
#

btw i new to tkinter and python in general so does it come under classes and object in python

#

?

tawdry mulch
#

Follow the solution mentioned ^

dense minnow
#

is there a way to store the text of a button by simply clicking it?

sinful pendant
#

Yes

sinful pendant
#

Well i cant understand the issur my code not working
The windows cmd is set-clipboard "copy"

sinful pendant
#

I deleted that, i was using set-clipboard commamd which failed to do so

digital rose
#

Is there anyone who is starting self taught journey in UI ux designing? And interested in learning together please pm.

wary grotto
serene umbra
#

Hello guys, i am trying to display a gif in tkinter. The Code runs fine, i am able to see the gif being played. But the problem is that when i close the program, i get the following error message in my terminal (please the the image attached with this message)

CODE:

from time import sleep
from tkinter import *
from PIL import Image, ImageTk, ImageSequence

root = Tk()

root.title('Virtual AI Assistant')

# Setting logo
logo = PhotoImage(file='logo.png')
root.iconphoto(False, logo)

# to set window equal to screen size
root.state('zoomed')

# set window color
root.configure(bg='#000101')

# setting 'ai' to 'jarvis' by default
ai = "jarvis"
bg_img = Image.open('jarvis_gif.gif')
if ai == 'friday':
    bg_img = Image.open('friday_gif.gif')
    # bg_img = bg_img.resize((960,540))

label = Label(root, borderwidth=1)
label.place(relx=0.5, anchor=N)

command = True
while command:
    for img in ImageSequence.Iterator(bg_img):

        img = ImageTk.PhotoImage(img)
        label.config(image=img)

        root.update()
        sleep(0.02)

root.mainloop()
digital rose
final escarp
#

no teacher but I'm still going good

mossy trout
hollow gorge
#

Some modules to create desktop application, like tkinter but something better

eager viper
#

Hey Python people!

#

I could an assist

#

I'm doing a super quick presentation on IDES — just five slides, and I'm devoting about 30 seconds and half a slide to the fact that a modern IDE is an interactive bugger with a graphical interface

#

Here's the rub

#

I only just used a debugger for the first time yesterday

#

Here's some actual footage of me doing it

#

So my question is — why do we like/need debuggers?

proven basinBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

tiny pike
mighty frigate
#

@tiny pikechances are the pixmap is bigger than the label

#

@tiny pike

import sys
from PyQt5 import QtCore, QtGui, QtWidgets

app = QtWidgets.QApplication(sys.argv)
pixmap = QtGui.QPixmap("test.jpg")

mainwindow = QtWidgets.QMainWindow()
centralwidget = QtWidgets.QWidget()
mainwindow.setCentralWidget(centralwidget)

layout = QtWidgets.QVBoxLayout(centralwidget)

# label with unscaled pixmap
label_unscaled = QtWidgets.QLabel()
label_unscaled.setPixmap(pixmap)
layout.addWidget(label_unscaled)

# label with scaled pixmap
label_scaled = QtWidgets.QLabel()
scaled_pixmap = pixmap.scaledToWidth(200)
label_scaled.setPixmap(scaled_pixmap)
layout.addWidget(label_scaled)

mainwindow.setFixedSize(400, 600)
mainwindow.show()

app.exec_()
frosty niche
#

Hello. Does anyone know using tkinter how to fill up following rows if the value from dropdown is selected?

tulip idol
#

yes

dark gulch
#

anyone know how to use tkinter? dm me if u do

digital rose
#

anyone here know a good pyqt5 book?

serene umbra
tawdry mulch
#

but you have not formatted it like it is supposed to be

serene umbra
#

here, i can see that my code in that message is formatter. You mean indentations right??

onyx zodiac
#

hello i am working with dash app for making dashboard. previously my code was working but now i am getting error loading layout can anyone help me in this? my code here https://paste.pythondiscord.com/lupiqequwu ping me when reply

proven basinBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

tawdry mulch
#

^ This is how you should format a python code while posting in discord

serene umbra
#

ook ...

tawdry mulch
tawdry mulch
serene umbra
#

sure

tawdry mulch
serene umbra
#

no

tawdry mulch
serene umbra
#

ok ... i figure it out ... thanx

magic tide
#

Hi there! 👋

#

i have problems removing images from a tkinter variable

#

when i click clean it deletes only the last cube

#

here's the code

#
import random
from tkinter import *
from PIL import Image, ImageTk
import os

def app():
    root=Tk()
    root.title("Dices Simulator")
    root.geometry('385x155')
    root.resizable(False,False)
    root.config(bg='white')
    
    st=Label(root,text='How many dices you want to simulate?',bg='white')
    st.place(x=4,y=1)
    
    inp=Text(root,width=35,height=1)
    inp.place(x=4,y=25)
    
    err=Label(root,text='',bg='white',fg='red')
    err.place(x=4,y=50)
    
    def roll():
        try:
            value=int(inp.get("1.0",END))
            if value<=6 and value>=1:
                panel=Label(root,image=None,bd=0)
                err.config(text='')
                for x in range(value):
                    num=random.randint(1,6)
                    value=str(num)
                    x='/home/pi/Desktop/dice/dice '+value
                    img=Image.open(x)
                    img=img.resize((50,50), Image.ANTIALIAS)
                    img=ImageTk.PhotoImage(img)
                    panel=Label(root,image=img,bd=0)
                    panel.image=img
                    panel.pack(padx=7,pady=52,side=LEFT)
                def clean():
                    for x in range(6):
                        panel.pack_forget()
                b1=Button(root,text='Clean',bg="white",fg="black",width=5,border=0,highlightthickness=0,bd=0,activebackground='white',command=clean)
                b1.place(x=158,y=120)
            else:
                err.config(text='Input must be between 1 and 6')
        except ValueError:
            err.config(text='input must be only integer')
        

    b=Button(root,text='Throw',bg="white",fg="black",width=5,border=0,highlightthickness=0,bd=0,activebackground='white',command=roll)
    b.place(x=299,y=22)
    root.mainloop()
app()
#

ping me if you can answer. thx

tawdry mulch
tribal path
#

you'd need to keep a reference to the labels in say a list or a dict to refer to later

tawdry mulch
magic tide
#

Idk how xd

dreamy lark
#

Hello, I need help for a school project, is it possible to take a graph from pandas and display it in a tkinter window? I search online but didnt found anything whith this type of graph .This is how I make the graph:

#

I need to do something like this

proven basinBOT
tawdry mulch
dreamy lark
quartz dust
#

So, basically I'm making a web browser in PyQt5 and I have an issue, so when I set a scheme (which was originally https), I changed it to a url where it will add what you searched after that, but for some reason it just crashes. Please help. The script is here: https://pastebin.com/BP0FHUQK

#

Here is the error:

  File "c:\Users\User\OneDrive\Desktop\User Versions\User 2\User 2.py", line 164, in current_tab_changed
    qurl = self.tabs.currentWidget().url()
AttributeError: 'NoneType' object has no attribute 'url'```
tawdry mulch
nimble sierra
tawdry mulch
nimble sierra
#

nfts can be anything, anything at all

tawdry mulch
#

spoiler: ||I am an NFT too||

nimble sierra
#

why

#

you dont know much about nfts?

quartz dust
tawdry mulch
nimble sierra
#

by the way what lib do think will good for mobile apps on both iphone and android

nimble sierra
quartz dust
#

my other message is what I mean

nimble sierra
quartz dust
#

¯_(ツ)_/¯

#

lol

nimble sierra
tawdry mulch
#

F time to go back 😛

quartz dust
#

yep

nimble sierra
tawdry mulch
#

Actually you have a better chance of finding help in the Qt server

tawdry mulch
#

But none the less, there are some Qt nerds around here

quartz dust
quartz dust
tawdry mulch
tawdry mulch
quartz dust
#

lol

#

Anyways if you don't want to then that's fine (but otherwise please do it, do the deed).

tawdry mulch
#

@eager beacon do you mind taking a look and helping this poor soul if you can ^^. Sorry for the ping

quartz dust
nimble sierra
#

i think you will have to claim server and then post your problem there, you will surly get help, okay

quartz dust
#

Literally no one, I mean literally no one could help me, and believe me I've been on Stack Overflow, Discord, Reddit.

quartz dust
tawdry mulch
#

There are more nice lads around here, theyr just prolly busy. As long as you stop messaging and dont send your question way back, they will eventually see your message

quartz dust
tawdry mulch
quartz dust
nimble sierra
#

look, try and solve the problem on your own, with that, you will learn better.

quartz dust
nimble sierra
#

you are the only best help you to offer yourself trust me,

quartz dust
quartz dust
nimble sierra
#

good luck

quartz dust
quartz dust
#

Thank you.

#

:D

nimble sierra
#

just clam down and go through you code , line by line

quartz dust
#

👍

#

Will do

#

😀

tawdry mulch
# quartz dust 👍

Well I will tell you one thing, the error means self.tabs.currentWidget() is None

nimble sierra
#

@tawdry mulch you there bro ?

quartz dust
nimble sierra
quartz dust
#

?

nimble sierra
#

coding is time and patience and clarity

quartz dust
#

Wow, you are a man of Wisdom!

tawdry mulch
# quartz dust so I think that I probably have to add some more parameters or something like th...

I will tell you, google is always your bff in terms of debugging. A simple search can even solve your doubts. These libraries have been around for about decade now, and used by alot of people. So there is a very good chance that someone has already encountered your issues in the past and asked a question and already received an answer. Let stackoverflow be your friend always, anyway for now, here is what I could find https://stackoverflow.com/q/67910504

nimble sierra
#

i have to go guys i have work to do

#

see you later

quartz dust
quartz dust
tawdry mulch
quartz dust
#

Welp, it didn't, lol

#

Well, thank you anyways!

#

:)

tawdry mulch
quartz dust
#

ty

#

:)

dreamy lark
onyx zodiac
#

hello i am working with dash app for making dashboard. previously my code was working but now i am getting error loading layout can anyone help me in this? my code here https://paste.pythondiscord.com/lupiqequwu ping me when reply

fluid tinsel
#

does anyone know any non-oop GUI libs?
I want to write procedural, but the libs for GUI dont make it easy, they effectively force me to use oop.

sinful pendant
#

Tkinter can work in both oop wau and non oop way

tiny pike
#

This is my Widget Button class which is just a Button hooked up to a filedialog. However, I would like to recover the name of the file so that I can use it afterwards in another class for the game board. I put it in attribute by doing:
self.filepath = filepath[0]
It is not accessible anywhere. No idea how to get that filepath. On the other hand when I print it in the openFileNameDialog method, there is no problem but if I try to access it in the init method, it will tell me that it does not exist.

tawdry mulch
tawdry mulch
dreamy lark
tawdry mulch
#

I mean if you check, if condition has to be executed inorder for filename to be defined, if not it is undefined. So define a else and give a path too. What is the variable you want tho @tiny pike

mortal pollen
#

can anyone suggest some starting points/resources to get going with ncurses, ive set a pretty big endeavour for myself of a music player tui to implement, but it's just that creating tuis feels a bit daunting at first and there's not a lot of intuitive documentation i've been able to find so far, came here for any help

digital rose
#

anyone have any background in multithreading with pyqt5

wooden stirrup
#
Python GUIs

Run background tasks concurrently without impacting your UI. A common problem when building Python GUI applications is

Python GUIs

Run background tasks concurrently without impacting your UI. A common problem when building Python GUI applications is

final escarp
covert rock
#

I'm having problem with QDoubleValidator. I'm following a course and this is the code it's using for the current lesson

import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import * 

app = QApplication(sys.argv)
w = QWidget()

input1 = QLineEdit()
input1.setValidator(QIntValidator())
input1.setMaxLength(2)
input1.setAlignment(Qt.AlignLeft)

input2 = QLineEdit()
input2.setValidator(QDoubleValidator(0.00, 50.00, 5))


form_layout = QFormLayout()
form_layout.addRow(input1)
form_layout.addRow(input2)


w.setLayout(form_layout)
w.show()
sys.exit(app.exec_())```
except in the window that this runs
I can input values higher than 50.00
see?
slow plover
#

is there a way to handle this issue

#

or atleast a decent alternative

tawdry mulch
tawdry mulch
final escarp
tawdry mulch
slow plover
#

and it takes an awfully long time to get converted to imagetk

tawdry mulch
# slow plover yeah

Mmmm even sun valley theme uses PNG for their theme and it takes long to load up so they made a version with gif which is kinda faster

robust zinc
#

When using tkinter, is it better to use the grid function or the pack function?

tawdry mulch
slow plover
#

how can i make such a ui with tkinter (sorry for the bad image quality), i don't want to be spoonfed, just a general idea will be fine

valid mica
#

Why tkinter, of all things?

slow plover
digital rose
#

Hey anyone knows a good book or Tutorial series for Learning PyQt5?

charred pasture
#

do someone know what this graph call in programming?

tribal path
#

mind map/ spider diagram? or programmably... similar to a flowchart

frosty niche
#

Hello, I am doing a project with python and tkinter, and I have a few questions regarding functionality. I would like to take some values entered by user (in the GUI not terminal) and then proceed to do algorithms on those values and display results, I have everything except this functionality. Could anyone help me out in pm, because I am not verified to speak in voice channel yet.

tawdry mulch
rapid elbow
#

PyQT vs Tkinter?

mighty frigate
#

Qt is much more than a UI library, probably allow to do more things too but it's more difficult to use

#

@rapid elbow

mighty frigate
#

Qt

#

I mean there's quite a bit

#

@rapid elbowhttps://doc.qt.io/qt.html

#

there's a multimedia lib, a network lib, a databse lib, a 3D lib, a sensor lib, etc

sinful pendant
charred hazel
#

Hi all, im currently trying to figure out if theres a way to display console outputs on a Tkinter Gui, im currently lost and cant find anything which would help me out so if anyone has a pointer in which way to go itd be much appreciated

quartz dust
#

Did someone ping me?

quartz dust
#

Well, okay.

summer needle
final escarp
#

You can check the requirements.txt

summer needle
#

so these three are the libs

final escarp
final escarp
tall thorn
#
from PyQt5 import QtCore, QtWidgets
from loginPage import Ui_loginPage
from signupPage import Ui_signupPage

class Ui_welcomePage(object):

    def setupUi(self, welcomePage):
        welcomePage.setObjectName("welcomePage")
        welcomePage.resize(677, 507)
        welcomePage.setStyleSheet("")
        self.loginButton = QtWidgets.QPushButton(welcomePage, clicked = self.openLoginPage)
        self.loginButton.setGeometry(QtCore.QRect(230, 220, 201, 51))
        self.loginButton.setStyleSheet("background-color: rgb(170, 255, 127);\n"
"font: 75 16pt bold \"Calibri\";")
        self.loginButton.setCheckable(False)
        self.loginButton.setFlat(False)
        self.loginButton.setObjectName("loginButton")
        self.signupButton = QtWidgets.QPushButton(welcomePage, clicked = self.openSignupPage)
        self.signupButton.setGeometry(QtCore.QRect(230, 290, 201, 51))
        self.signupButton.setStyleSheet("background-color: rgb(170, 255, 127);\n"
"font: 75 16pt bold \"Calibri\";")
        self.signupButton.setCheckable(False)
        self.signupButton.setFlat(False)
        self.signupButton.setObjectName("signupButton")
        self.welcomePageTitle = QtWidgets.QLabel(welcomePage)
        self.welcomePageTitle.setGeometry(QtCore.QRect(210, 70, 281, 51))
        self.welcomePageTitle.setStyleSheet("font: 75 20pt \"Tw Cen MT\";")
        self.welcomePageTitle.setObjectName("welcomePageTitle")

        self.retranslateUi(welcomePage)
        QtCore.QMetaObject.connectSlotsByName(welcomePage)

    def retranslateUi(self, welcomePage):
        _translate = QtCore.QCoreApplication.translate
        welcomePage.setWindowTitle(_translate("welcomePage", "Gui"))
        welcomePage.setToolTip(_translate("welcomePage", "<html><head/><body><p><br/></p></body></html>"))
        self.loginButton.setText(_translate("welcomePage", "LOGIN"))
        self.signupButton.setText(_translate("welcomePage", "SIGN UP"))
        self.welcomePageTitle.setText(_translate("welcomePage", "Gui"))

    def openLoginPage(self):
        self.window = QtWidgets.QDialog()
        self.ui = Ui_loginPage()
        self.ui.setupUi(self.window)
        self.window.show()
    
    def openSignupPage(self):
        self.window = QtWidgets.QDialog()
        self.ui = Ui_signupPage()
        self.ui.setupUi(self.window)
        self.window.show()

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    welcomePage = QtWidgets.QDialog()
    ui = Ui_welcomePage()
    ui.setupUi(welcomePage)
    welcomePage.show()
    sys.exit(app.exec_())

how would I go about closing the initial window once the user opens either the login or signup page? I have been trying to figure it out for a while now and tried google but it didnt help much

tawdry mulch
#

Is this related to UI

fallow kayak
#

no :)

tawdry mulch
jolly tulip
#

Sorry for bothering but do someone knows whats wrong with it? i made a window with tkinter from 600x600 and set the button x coord on 270 and its like its not fitting on the window but the window is 600x600 and underneath the button there is a lot of space but there is something wrong with it i think (pls pm me if u know whats the problem) -thx

mighty rock
fierce spear
#

I am making a

#

pyqt5 apllication

#

and using qt designer
the opening screen
is working fine as in the designer
but the new screen is getting
spoiled

#

Please help

tawdry mulch
mighty rock
#

Ah

fierce spear
#

Please help

#

On my problem

mighty frigate
#

and using qt designer <- first mistake

#

@fierce spearexplainsyour problem pls

jolly tulip
tawdry mulch
covert rock
#

I am learning PyQt5 and was reading about it an PySide and I was wondering about something regarding the licensing.

From my understanding, anything and everything I publish onto which I used PyQt, regardless if I changed PyQt's code, must have its source code published, right?

shy torrent
#

Quick problem with pygame
not matter what I do I cant load an image from an absolute path.

every time I get

FileNotFoundError: No such file or directory: 'd:\absolute\path\to\image.png'.

The image exists and the errored path actually leads to the image

what I tried:

path = Path(r"d:\absolute\path\to\image.png")
my_image = pygame.image.load(path)
path = Path(r"d:\absolute\path\to\image.png").resolve()
my_image = pygame.image.load(path)
my_image = pygame.image.load(r"d:\absolute\path\to\image.png")
my_image = pygame.image.load("d:/absolute/path/to/image.png")
IMAGES_FOLDER = Path(r"d:/absolute/path/to")
my_image = pygame.image.load(IMAGES_FOLDER.joinpath("image.png"))
old_cwd = os.getcwd()
os.chdir(r"d:/absolute/path/to")
my_image = pygame.image.load("image.png")
os.chdir(old_cwd)
IMAGES_FOLDER = r"d:/absolute/path/to"
my_image = pygame.image.load(os.path.join(IMAGES_FOLDER,"image.png"))
IMAGES_FOLDER = Path(r"d:/absolute/path/to")
images = []
for file in IMAGES_FOLDER.iterdir():
  print(f"{file} {file.exists()=} {file.is_file()=}")
  images.append(pygame.image.load(file))

last one prints:

d:/absolute/path/to/image.png file.exists()=True file.is_file()=True

and immediately throws:

FileNotFoundError: No such file or directory: 'd:/absolute/path/to/image.png'.`

I am out of ideas...

tawdry mulch
shy torrent
#

I do not want the game be dependent on changing the cwd
and also have all assets in their own folder

also
changing the cwd did nothing

old_cwd = os.getcwd()
os.chdir(r"d:/absolute/path/to")
my_image = pygame.image.load("image.png")
os.chdir(old_cwd)

from what I tried above

tawdry mulch
#

Can you check the size of the image

#

Just to make sure the image is not 0 bytes or empty

shy torrent
#
IMAGES_FOLDER = Path(r"d:/absolute/path/to")
images = []
for file in IMAGES_FOLDER.iterdir():
  print(f"{file} {file.exists()=} {file.is_file()=} {file.stat().st_size=}")
  images.append(pygame.image.load(file))

prints

d:/absolute/path/to/image.png file.exists()=True file.is_file()=True file.stat().st_size=205

then again throws

FileNotFoundError: No such file or directory: 'd:/absolute/path/to/image.png'.`
nocturne breach
#

More of a general UI question but Python is my only programming Discord. If I was looking to create an app with a responsive and modern UI, and wanted to get a mock prototype working on desktop (Windows or Linux), what frameworks would be best? Unless I'm missing something, Python doesn't seem to be the best choice for creating responsive UIs

#

Been thinking the simplest route might be Django/Flask but my web design skills are pretty poor, so I'd have to start getting into some of the design apps as well

final escarp
#

How can I make the label appears on the right every time I click a button to add new text to it? Thanks (nvm I know how to do it rn)

tribal path
#

can mock up apps fairly quickly with kivy (if you know what you're doing)

boreal pier
#

I don’t know too much about it but the made a mock up discord ui

shy torrent
indigo crane
#

autocompletion with tkinter

#

also tried making a minimap component

sleek hollow
#

Working with PyQt and trying to access the arrows that show up in a TabBar when the tabs exceed the width

#

I want a right click callback on those arrows, but I can't seem to figure out the proper way to implement it. I could query the mouse position on the tab bar, but I first need to determine if the arrows are currently even shown

jolly flower
sleek hollow
stray jackal
#

ohhh i never conidered that ... until now

dry path
#

I have a script that manipulates images and shows steps of the manipulation using opencv and cv2.imshow() I would like to somehow get those visualized steps to be inside of a tkinter window.

#

I can show images in TKinter but im having trouble wrapping my head around running my original script and having it interact with the mainloop of a tkinter script

#

is there a way to sort of export an object from the tkinter script so i can sort of get access to one of the frames and then kind of slip in images whenever i want? Like so i can swap out image variables as the tkinter mainloop is still running

#

Its like I want to run both scripts at the same time but if i try to call the tkinter script then it gets stuck running the tkinter mainloop so it never starts the opencv script

fluid tinsel
#

Does anyone have any GUI suggestions for a project? I don't want to write a text editor, though, I already wrote so many.

slender quarry
toxic glade
#

We're making a chat app using http requests and mongodb, we almost finishing the server but we need someone good at GUI to design the client, anyone wanna help?

digital rose
#

Hello anyone here

#

I was having a little problem while making an app gui

#

I want it to take inputs from the user and store it

#

Then whenever the hotkey is pressed

#

It will just type the input given by the user

#

Apparently both work fine

#

But when I combine them

#

The code dont registers key presses

#

Here is my autotyper code

#
import keyboard
import pyautogui as pg
import time

x = input("Enter here: ")

while True:
    while keyboard.is_pressed("q"):
        pg.press("backspace")
        pg.write(x)
        time.sleep(0.8)
        pg.press("enter")

#

And it's my gui code

shy torrent
#

Is there any non-qtpy way to get QScintilla working for PySide(2 or 6)?

dawn fjord
#

can you guys read this?

rough merlin
#

No

dawn fjord
#

ok

#

its time 60

#

cant

#

font cant make colons

#

yeah

#

oh thas tthe new font

#

which one is better?

#

yeha...

#

alrihgt

#

yah

ripe wedge
#

Hi. Are there dockable dialogues in tkinter? I know you can create some with PyQt, but I want them in tkinter.

toxic glade
#

Or you could invert it (black as shadow and white as foreground)

toxic glade
#

help, i cant install pyqt5-tools

toxic glade
#

what do you guys think of this

  1. messages box, a list widget that holds the messages
  2. users, a list widget that holds the users
  3. DMS, a list that holds direct_messages
  4. The thing where you type stuff to send
  5. The send button
  6. (havent labeled this) its the tablist on the top, it will hold channels that you are in

this is for a chatapp am making

final escarp
#

tkinter easy imo, it depends how complex is the app too

toxic glade
silver cloud
#

Whats the best module to use to create user interfaces? Not trying to do anything outrageous but need something decent

ripe wedge
# tawdry mulch what?

For example drawing applications. There is a box on the left site with all brushes, another box with the color pallette and another one with layers, etc. You can move these boxes around and change the size.

#

You can see these dockable dialogues in the picture above (send by osam7a) left and right.

tawdry mulch
#

Not an application coded by us

mighty frigate
#

@silver cloudproblably the one you know the best

mighty dome
#
import tkinter

win = tkinter.Tk()

win.geometry("700x350")
label = tkinter.Label(win, text="random_text")

def click():
   label.pack()
   label.after(1000, label.destroy())

tkinter.Button(win, text="random", command=click).pack()

win.mainloop()```
#

how can i make to show text after clicking button and after 1 sec disappear?

tawdry mulch
mighty dome
#

okay but if I do that, it sleep 1 second and then print text

#

that's not what i wanted

ripe wedge
tawdry mulch
#

theres some on google, i forgot the names

ripe wedge
tawdry mulch
#

IDK if dockable is the right word

#

Try drag and drop

ripe wedge
young sedge
#

it is not possible. GUI always uses some kind of library.
At best you could do it without installing any third party libraries and using in built to python Tkinter? 😆

#

Or no, even better, CLI interface with ARGPARSE!)

#

oh wait it is not GUI 🤔

proven basinBOT
#

Hey @pine marsh!

It looks like you tried to attach file type(s) that we do not allow (.exe). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

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

tawdry mulch
#

Hmmm maybe look at Microsoft docs about their WM

hoary canopy
#

Working with tkinter. Idk what i did but my entry widget wont load now

def start_game(self):
        '''Creation, display and control of main game'''
        # Clear screen
        for widgets in self.menu_frame.winfo_children():
            widgets.destroy()
        # Frame for main game
        self.game_frame = tk.Frame(self.master)
        # Game objects
        self.guess_text = tk.StringVar()
        self.guess_widget = tk.Entry(self.game_frame, textvariable=self.guess_text).pack()```
outer wadi
#

Can someone tell me what stupid im doing, i cant get the text from the entry (INPUTuser and INPUTpass)

def Signup():
    Sign = tk.Tk()
    Sign.title("Sign Up")
    Sign.geometry("200x150")
    Signup = tk.Label(Sign, text="Sign Up")
    gap = tk.Label(text="")
    BOXuser = tk.Label(Sign, text="Username")
    INPUTuser = tk.Entry(Sign, bd =5)
    BOXpass = tk.Label(Sign, text="Password")
    INPUTpass = tk.Entry(Sign, bd =4, show="*")
    ButtonCA = tk.Button(Sign, text="Create Account", command=Account_Write)
    Result = tk.Label(Sign, text="Account Created", fg="Blue")
    Signup.pack()
    gap.pack()
    BOXuser.pack()
    gap.pack()
    INPUTuser.pack()
    gap.pack()
    BOXpass.pack()
    gap.pack()
    INPUTpass.pack()
    ButtonCA.pack()
    frame.destroy()
    Sign.mainloop()
    Username = INPUTuser.get()
    Password = INPUTpass.get()
    Info = ("Username: " + Username + "\nPassword: " + Username + "_" + Password + "\n")
    if CAV == 1:
        Result.pack()
lunar haven
#

Good evening , I have a question :
I am using Tkinter as UI.
How can I show an image with a URL ?

outer wadi
hoary canopy
hoary canopy
#

Can someone help with automating creation of entry widgets?

empty aspen
#

What do you need them to have?

hoary canopy
#

Entries that are in a row. I think i have something working but I have to break it up and test it. Considering a list as being full of objects is new to me.

#

Ill share my code, one second

#
for row in range(5):
            for col in range(5):
                self.letter_entry = tk.Entry(self.game_frame)
                Application.letter_grid[row].append(self.letter_entry)
        self.create_word_line()```
eager viper
#

Its been a long, long time since I've taken stock

#

Are there any good game engines for python yet?

glacial gust
eager viper
#

Derp. I forgot there was a game dev channel on here

#

And I dunno. More just seeing what's out there

#

I remember some years ago, when I last looked, there some way too complicated and low level libraries, some ancient ones, and pygame

#

Qt, tk, and a GL derivative I think

hoary canopy
#

What?

#

Oh nvm. Yeah I figured it out. Sorry it’s 5 am lol. The code is already done and on GitHub

tawdry mulch
hoary canopy
#

Got that figured out too lol.

#

It’s been a slow night at work.

tawdry mulch
#

ah lol, usual day 🙂

hoary canopy
#

Well the press crew went home at like midnight lol

#

My boss isnt awake for me to ask if i could go home though so remote connect to my pc at home and programming it is

wraith plover
#

I am using PyQt6 to create a GUI

But when trying to resize a label, this happens:

#

Is there a way to fix it

#

So that the text fit's inside the box

digital rose
#

It's way easier

mighty frigate
#

@wraith ploverare you using QtWidgets ? Are you using layouts ? are you using QtDesigner ?

mighty frigate
#

@wraith ploverso I guess you're not using layouts

#

correct ?

mighty frigate
#

is there a reason for that ?

wraith plover
#

I am fairly new to Qt

#

So i don't really know

mighty frigate
#

ok, layouts are life, use them

#

here's a small example

app = QApplication(sys.argv)

mainwindow = QMainWindow()
centralWidget = QWidget()
mainwindow.setCentralWidget(centralWidget)

hello_label = QLabel("Hello World!")
ok_button = QPushButton("Ok")

layout = QVBoxLayout(centralWidget)
layout.addWidget(hello_label)
layout.addWidget(ok_button)

mainwindow.show()
app.exec_()
wraith plover
#

How do i import the "centralWidget"?

mighty frigate
#

define import

#
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
import sys

if __name__ == "__main__":
    app = QApplication(sys.argv)

    mainwindow = QMainWindow()
    centralWidget = QWidget()
    mainwindow.setCentralWidget(centralWidget)

    hello_label = QLabel("Hello World!")
    ok_button = QPushButton("Ok")

    layout = QVBoxLayout(centralWidget)
    layout.addWidget(hello_label)
    layout.addWidget(ok_button)

    mainwindow.show()
    app.exec_()
wraith plover
#

oh...

#

i got it

#

thx

mighty frigate
#

this is the whole thing, if that's clearer

#

it's Qt5 but it should be pretty much the same

wraith plover
#

Yeah

#

it's pretty much the same

#

thx for the help

chilly egret
#

Hello there, any interesting tutorial about custom models for Qt to be used in a Qt view?

#

I’m thinking about examples to implement a subclass of QAbstractItemModel or QAbstractTableModel for instance.

mighty frigate
#

@chilly egretthe official documentationis probably what you're looking for, and there's examples too

#

it's in C++ but it doesn't change much, the same principles apply

#

This is a simple tree model from a node structure

chilly egret
#

Yeah the official doc is good but I struggle a bit with some of the method’s implementation. Especially the concept of flags and roles
Thanks for the links!

mighty frigate
#

in short, it has to do with what type of data you want to give to the view

#

for example, for a given data in your model, it could have text, icons, comments, etc, even custom datas

#

the roles handle that

chilly egret
#

Yeah I finally managed to make my custom model work with my QTableView ! Yay! Thanks

mighty frigate
#

gz

tiny pike
#

Hi, I'm using PyQt5 for a school project and I do a while loop but It closed immediately the window:

(I corrected self.access typo)

plush stream
#

Sorry i just saw that you corrected the access typo

#

Did it spit out any error?

tiny pike
#

When I enter in the loop, it’s closed window instantly

tiny pike
plush stream
#

Exit code 0 or anything else?

tiny pike
# plush stream Exit code 0 or anything else?

It's a board game and basically I need to leave the window open so I can move my checkers around until there's a winner. but here, I don't know how to move my pawns since I don't have access to the window so it goes on a loop

mighty frigate
#

@tiny pikethat's not what he asked

#

he asked if the program ended with en error or not

#

aka is the exist code 0

tiny pike
#

No, not error

#

@mighty frigate

mighty frigate
#

did you try to debug it

#

I mean, using a debugger

final escarp
#

how can I make label's font to be smaller when it reaches the side of windows?

final escarp
proven basinBOT
#

:incoming_envelope: :ok_hand: applied mute to @kindred lynx until <t:1649348244:f> (9 minutes and 59 seconds) (reason: burst rule: sent 8 messages in 10s).

graceful wind
#

be brutally honest i'm looking for design notes

tawdry mulch
lyric minnow
tawdry mulch
#

to use RGBA image properly in tkinter, the image must be a canvas image

covert rock
#

on pyqt5, anyone knows a way to change the font of all labels inside a QHBoxLayout all at once, so I don't have to do setFont() on each of them?

tawdry mulch
#

I would say something like:

(layout.itemAt(i).setFont(..) for i in range(layout.count())) 

could work as a one liner

covert rock
#

also, I don't know what's children

tawdry mulch
topaz rampart
#

is tkinter a good way to build user interfaces as a beginner or should I use something else?

tawdry mulch
covert rock
mighty frigate
#

@covert rock3 ways :

  • Qss may allow you tu change the font
  • write a search function that look for QLabels inside of a layout
  • create your own label that inherits from QLabel with the font you want and use that
hoary jolt
#

I need help with my Tikinter code

#

is there anyone who can help me?

mossy ice
#

I want to make a GUI app and I originally planned to use pyqt, since Qt designer would help a lot.
While it will be a totally free app, I do want to include a "Donate" button, so I don't know if that is allowed or if I'd need to buy a commercial license.

So, should I consider another alternative? I want something that lets me customise the look of the app (I don't want to make it native looking). A Web based option is not out of the table, something like the python equivalent of Electron apps or even if it just opens in the browser. I took a look at flask, but it seems to advise against local apps.

mossy ice
#

thank you!

covert rock
tropic tiger
orchid bone
#

Hey guys, I'm using PyQT5 and I'm wondering how I might set the value of a text field outside the classs

I know this is wrong but I've got a text label called newPin and I'd like to change the value of what ever I put in the ""

Ui_MainWindow.newPin.setText('A')
silk quail
#

So I have made this python benchmarking tool (like timeit), and I've used hyperfine as the inspiration for the UI. But I don't want it to look exactly like hyperfine, I'd like it to be unique. Here's a screenshot for reference

#

It's made with rich

#

So I was just wondering what can I do to make it look more cool

#

I'm out of ideas

#

Maybe I could change the colors up a bit, but it would still not be unique

sharp reef
#

any ui library which i can make look like this?

sharp reef
sharp reef
cursive sentinel
#

hello i have problem but idk if its good topic

#

its on tkinter app soo maybe here

pliant dagger
#

spicetify does a bad job

#

but this doesn't look like it

modern marsh
short hare
#

I am about to plan my layout for my portfolio website. Are there any great free UI designing tools?

short hare
#

Okay

quartz dust
#

Is there any way to implement hardware acceleration into your python script? Especially if it has 2D Graphics like with PyGame or PyQt5.

midnight kestrel
#

Hey! :) I was wondering if you could put an image instead of text in a tkinter menu for the cascade title?

tawdry mulch
feral crow
mighty dome
#

why is ctrl+y in tkinter text widget pasting and how to disable it?

dense musk
#

Hey guys i have a question, im trying to store data from two MDTextFields on my registration page into a .text file and then on my login page. see if the input matches before moving on. i've looked high and low but can find nothing to help me get this working. Can someone point me in the right direction please?

#

if i was to make a kivy UI and got the code working could i then transfer the same code over to my KivyMD UI and it would function the same?

quartz dust
#

Is there any way to implement hardware acceleration into your python script? Especially if it has 2D Graphics like with PyGame or PyQt5.

graceful wind
#

square or no square
if so why not

digital rose
#

Tell me the best ui development module available in the python...

tawdry mulch
digital rose
digital rose
digital rose
inner bloom
#

hlo i want to give my program a simple user interface can anyone help me, if you can help me dm me or tag me i will give you code

#

plz anyone help me

digital rose
#

Making a gui sucks so bad.

#

its almost never worth it

#

but when it is its just miserable.

#

pyqt specifically atm

tawdry mulch
#

cuz the way youve been doing is wrong, deffo

digital rose
#

...right. Hooking up signals to buttons and putting widgets in layouts in frames is the real programming i should be focusing on lol

#

my program works, i just need dumb people to be able to use this one

tawdry mulch
digital rose
#

^

#

sometimes it s worth it

tawdry mulch
#

sometimes

digital rose
#

I need help

proven basinBOT
#

Hey @digital rose!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

rugged blaze
#

How can i run a function every 'x mins'
i tried using While true loop and then time.sleep(x)
but it's making the program UI unstable and unresponsive if i click close in between

#

i'm using tkinter

#

and i want the program to run the script after every x mins when i press the run button

#

i've also created threads

digital rose
#

it will not update the text in the label when i select a directory....

#

i figured it out instantly

#

after posting it

#

its the signal connection. Im using something.get instead of self.set to call my own function

#

because it calls the dialog im assuming it was the right thing

mighty frigate
#

QtWidgets isn't that difficult, there's just a lot of things to understand to be proficient with it.

#

I don't know if this is a the right place, but here we go.

I'm making a rather complex tree, with Qt. This tree can be filtered and sorted by multiple criterias. Would you rather do one and only one QSortFilterProxyModel to handle every cases possibles, or one QSortFilterProxyModel per criteria ?

sharp reef
#

The music player is literally a terminal btw

#

Just a linux nieche thing lol

pliant dagger
#

😔

inner bloom
#

so is anyone helping me?

#

hlo is anyone

#

bro i have tryed a lot of commands for this program but non of them is working

#

its just stucked in my head plz help me

#

!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.pythondiscord.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.

inner bloom
#

@proven basin its not working what to do next

#

so plz watch this code and plz add a code for a gui in which it have a button whuch will run thus program

#

and also a button for stop the program

digital rose
graceful wind
#

darker or lighter

mossy ice
#

darker is easier to see imo

#

Anyone have experience with Eel?

#

I would like it to use whatever browser is set as the default in the user's machine, but then I can't start it in app mode.

mossy ice
#

(ping if you reply btw)

digital rose
#

what is the best gui thing for like robotics

#

for like north east south west

#

like minecraft cords

tribal path
#

may need to elaborate more there on what sort of ui you're after there

indigo crane
#

qudratic equation solver with a basic graph plotting setup

stray jackal
#

nice

digital rose
digital rose
stray jackal
#

oh you animate the snow in your profile - cool

stone walrus
#

Is there a Tutorial hor to structorize the code of an app, like seperating the views and the code behind?

young sedge
boreal pier
#

Why does open cv struggle to top 1 FPS when displaying (two lines of code) a png that is updated by multiple processes to get a video stream, it slams me with libpng: Read Error?

#

no matter how hard I try I cannot top 1 FPS with imshow

#

The video stream is a 1920x1080 png of the screen

mighty frigate
#

are you sure those processes aren't accessing the ressources at the same time ?

#

like (I'll assume this is a multithreaded program) did you use mutex and everything ?

boreal pier
#

I’m capturing screen with 4 processes and 2 more for saving them to help with save times, using mss

#

This is tested as a local file system since the frames will be sent via request to server, so if I can’t get higher here it’s baddddd

#

Then 2 processes on a separate script, aka machine 2, which grabs the image, then sends it to process 2 to display

#

Speed is key, as this will be a remote “controller “ and live updates need to be fast

#

I tried numpy arrays but those nuked the server

#

Basically how can I get frames like a discord screen share

mighty frigate
#

are you sure your processes aren't using the ressources at the same time

#

because if they are, this is why it is slow

boreal pier
#

The screen capture takes at least 5 FPS

tribal path
#

If you're essentially spamming with while loops, I would add a small wait/sleep

boreal pier
#

I don’t care about men usage, I cannot get opencv FPS

mighty frigate
#

have you tried to use a performance profiler ?

boreal pier
#

?

#

The problem is it frame skips and the exception just does nothing, but one of the modules that opencv uses libpng spams in the console libpng Error: Read Error

#

It’s supposed to do nothing btw

mighty frigate
#

you keep repeating the same thing and didn't answer any of our questions so... good luck I guess

boreal pier
#

My system (nothing to do with it) can view a preview in finder at a instant update rate

#

Basically anybody know what the hell is up with libpng displaying the image

#

It’s working on my computer finder, but not python

mighty frigate
#

libpng is a very common and highly tested library, there's very very little chance that the issue comes from it

boreal pier
#

Any displaying alternative

hoary path
#

hello, i'm new to python(gui development) now i have a very simple project which gui library should i use ?
the project will be personal, only for linux

  • Tkinter
  • wxPython
  • PyQt
  • Kivy
  • etc..
jolly flower
#

with their designer

#

is the easiest one

#

and simple

tawdry mulch
#

is that also ez? lol

jolly flower
#

yes

tawdry mulch
jolly flower
#

for you, yes its not

tawdry mulch
jolly flower
#

yes

tawdry mulch
jolly flower
#

fuck tkinter

#

its garbage ass

#

the worst

tawdry mulch
#

you can learn what event driven programming is and then adapt your program later

jolly flower
#

and it will give you a weak and bad point of view about developing user interfaces on Python

tawdry mulch
jolly flower
#

yes

tawdry mulch
#

python was never made for developing ui in the first place

jolly flower
#

yes

hoary path
# jolly flower PyQt

yep the great thing about is it will use Qt under hood and this is good for me since i use kde

#

i don't need a backend the app is very simple

#

no backend needed the backend is the filesystem

tawdry mulch
jolly flower
#

but for now there is qt designer

hoary path
#

once i finish my filesystem backend

lament tendon
#

There's also Proxylight that works tkinter and Figma API

digital rose
#

I need someone to make me a super simple UI that does barely anything, you just need to know how to make like nicely designed boxes, (VERY SIMPLE)

Paying in nitro

boreal pier
#

In nitro? Bruh... just look at better discord, basically nitro for free

digital rose
#

how?

boreal pier
#

It messes with discord code and stuff

digital rose
#

it only has some stuff and its only for you

#

to everyone else you still look ugly

tight token
#

class Application(tk.Frame):
    def __init__(self, master=None):
        super().__init__(master)
        self.master = master
        self.pack()
        self.create_widgets()

    def create_widgets(self):
        self.hi_there = tk.Button(self)
        self.hi_there["text"] = "Hello World\n(click me)"
        self.hi_there["command"] = self.say_hi
        self.hi_there.pack(side="top")

        self.quit = tk.Button(self, text="QUIT", fg="red",
                              command=self.master.destroy)
        self.quit.pack(side="bottom")

    def say_hi(self):
        print("hi there, everyone!")

root = tk.Tk()
app = Application(master=root)
app.mainloop()
boreal pier
#

Idc money better than looks bro

digital rose
#

$10 / nitro

tight token
#

Done 😂

digital rose
#

no

#

not what i need

boreal pier
#

Lol

digital rose
#

and not tkinter

tight token
#

too bad take it or leave it

digital rose
digital rose
boreal pier
#

He scammed u bro he took da code and now no nitro lol

tight token
digital rose
#

not the code i need lol

digital rose
#

anyone good at GUI's dm me

mighty frigate
#

I HATE the designer of Qt...

#

it works alright for the most general widgets but when you need even the tiny bit of customisation it's turning to hell

drowsy turret
#

or you can try and customize using code and see which one works better for you

mighty frigate
#

I just do it entirely by hand

rapid inlet
#

How to make the corners of a button round in tkinter???

drowsy turret
#

roundedborder["bg"] = "white"

#

not sure if it works though

rapid inlet
#

I will try it

#

Thnks

drowsy turret
#

if that doesnt work, you can do sth like this :
button = Button(window, image='', borderwidth=0)

#

you'll need to have an image of the button you want and specify it in the image parameter

carmine terrace
#

hi guys i have a question : in the tkinter module, how to delete a text write in an Entry() class widget ?

#

Is there a method for that ?

drowsy turret
#

Self.entery.setText(" ")@carmine terrace

wide monolith
#

Anyone here using Textualize? From the creator of rich?

carmine terrace
merry valve
#

I have made a simple application in which you press three buttons and it gives you some sort of check. This application can be made in android and add a client and server feature of some kind. Of course because of the server - client feature I cannot say to all the potential users to be on the same local network for it to work. I also need some sort of server that I can transfer the source code to so I don't have to build it each time on my personal computer. Can you help me with that ?

foggy hamlet
#

anyone know how i can find the pixel size of a certain window/ application

#

like for example, if i drag and change the "proportions" of google chrome on my desktop, i want to be able to know the pixel size of that

foggy hamlet
#

if that makes sense lol

tawdry mulch
#

Or win32gui it is

drowsy turret
pale salmon
#

so i have this, but i want to only allow .json file types.

  name = "File Path",
  subtype = "FILE_PATH"
)```
is there a way to add like a filter or smth?
sinful pendant
#

👀

digital rose
#

this is batch but why doesnt this work

runic lance
#

is anyone into Desktop Gui

drowsy turret
#

yes@runic lance

hidden falcon
rain harness
sinful pendant
#

I am getting this image not found error
Idk the reson behind it
I have this whole project on github pls help me to find out the solution
Some description is given in problems.txt file at point 2

#

Errror

hidden falcon
#

PyQt5 Question:
Why isn't my QScrollingFrame working? Every time I add a label to it, the labels resize...

muted sigil
#

@foggy hamlet it should be stored in properties of a window

sinful pendant
grim sentinel
#

its happening becuz of the vertical layout

heavy swallow
#

Has anyone used pyqt6

magic thorn
#

can anybody help me with multithreading in pyqt5

kindred girder
#

Hey, I want a help with Tkinter...

#

I am making a stickman by using Canvas widget and I want to interact with that stickman, How can I do that?

#

I tried putting canvas into frame and bind events with frame but doesn't work.

fluid tinsel
#

is there a real python gui library that isn’t object oriented? tkinter is not powerful enough, and i dont want to use oop but every lib i saw effectively forces you to

boreal pier
#

PySimpleGui

#

It’s really easy and cuts development time

fluid tinsel
#

is there any concern with speed?
because my Tkinter ran a little very inefficiently, compared to Qt (PySide2) and PySimpleGUI kinda uses Tkinter

boreal pier
#

It’s totally great they have threading and cool stuff

#

The UI is just using tkinter mainly

#

It’s a polished and often overlooked GUI builder

#

Very nice Ui

open shadow
#

Hi

#

anyone can help me with css and html

boreal pier
#

W3schools

digital plaza
earnest flint
#

Hi Guys. I'm 19, in UNI and I have been given a task to create a survey with 3 content pages and 10 questions proceeding those content pages with tkinter and Python. Since I have little coding experience, so I was looking for some help

#

DM if you can help

digital rose
#
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import time
import traceback, sys
class WorkerSignals(QObject):

    finished = pyqtSignal()
    error = pyqtSignal(tuple)
    result = pyqtSignal(object)
    progress = pyqtSignal(int)

class Worker(QRunnable):

    def __init__(self, fn, *args, **kwargs):
        super(Worker, self).__init__()

        # Store constructor arguments (re-used for processing)
        self.fn = fn
        self.args = args
        self.kwargs = kwargs
        self.signals = WorkerSignals()

        # Add the callback to our kwargs
        self.kwargs['progress_callback'] = self.signals.progress

    @pyqtSlot()
    def run(self):
        '''
        Initialise the runner function with passed args, kwargs.
        '''
        # Retrieve args/kwargs here; and fire processing using them
        try:
            result = self.fn(*self.args, **self.kwargs)
        except:
            traceback.print_exc()
            exctype, value = sys.exc_info()[:2]
            self.signals.error.emit((exctype, value, traceback.format_exc()))
        else:
            self.signals.result.emit(result)  # Return the result of the processing
        finally:
            self.signals.finished.emit()  # Done
#
class MainWindow(QMainWindow):
    def __init__(self, *args, **kwargs):
        super(MainWindow, self).__init__(*args, **kwargs)

        self.counter = 0

        layout = QVBoxLayout()

        self.l = QLabel("Start")
        b = QPushButton("DANGER!")
        b.pressed.connect(self.oh_no)

        layout.addWidget(self.l)
        layout.addWidget(b)

        w = QWidget()
        w.setLayout(layout)

        self.setCentralWidget(w)

        self.show()

        self.threadpool = QThreadPool()
        print("Multithreading with maximum %d threads" % self.threadpool.maxThreadCount())

        self.timer = QTimer()
        self.timer.setInterval(1000)
        self.timer.timeout.connect(self.recurring_timer)
        self.timer.start()

    def progress_fn(self, n):
        print("%d%% done" % n)

    def execute_this_fn(self, progress_callback):
        for n in range(0, 5):
            time.sleep(1)
            progress_callback.emit(n*100/4)
        return "Done."
    def print_output(self, s):
        print(s)
    def thread_complete(self):
        print("THREAD COMPLETE!")

    def oh_no(self):
        # Pass the function to execute
        worker = Worker(self.execute_this_fn) # Any other args, kwargs are passed to the run function
        worker.signals.result.connect(self.print_output)
        worker.signals.finished.connect(self.thread_complete)
        worker.signals.progress.connect(self.progress_fn)
        # Execute
        self.threadpool.start(worker)
    def recurring_timer(self):
        self.counter +=1
        self.l.setText("Counter: %d" % self.counter)
app = QApplication([])
window = MainWindow()
app.exec_()
#

Anyone now how you would use multihreading in this example code to make the process of mulitthreading not just by events but by switching to a whole different window within the same withing while counter is still running.

mighty frigate
#

@digital rosewhat ?

#

I'm not sure to understand what you're trying to achieve, but a QApplication can only have one MainWindow (in theory)

#

and if multiple dialog need a shared access to some datas, you can probably share that with a common object like a custom QApplication or a singleton or something

#

@magic thorndon't ask to ask, just ask$

digital rose
obtuse carbon
#

anyone know how to limit the height of a tkinter dropdown menu so it doesn't go across the screen?

magic thorn
#
class WorkerSignals(QObject):




    finished = pyqtSignal()
    error = pyqtSignal(tuple)
    result = pyqtSignal(object)

class Worker(QThread):




    def __init__(self,fn,*args,**kwargs):
        super(Worker,self).__init__()
        self.fn = fn
        self.args = args
        self.kwargs = kwargs
        self.signals = WorkerSignals()





    @pyqtSlot()
    def run(self):
        try:
            result = self.fn(*self.args,**self.kwargs)
        except:
            traceback.print_exc()
            exctype, value = sys,sys.exc_info()[:2]
            self.signals.error.emit((exctype,value,traceback.format_exc()))
        else:
            self.signals.result.emit(result)
        finally:
            self.signals.finished.emit()
        





class MainWindow(QMainWindow):

    def __init__(self, *args, **kwargs):
        super(MainWindow, self).__init__(*args, **kwargs)
        self.threadpool = QThreadPool()
        print("multithreading with maximum %d threads" % self.threadpool.maxThreadCount())

        self.counter = 0

        layout = QVBoxLayout()

        self.l = QLabel("Start")
        b = QPushButton("DANGER!")
        b.pressed.connect(self.oh_no)

        c = QPushButton("?")
        c.pressed.connect(self.change_message)

        layout.addWidget(self.l)
        layout.addWidget(b)

        layout.addWidget(c)

        w = QWidget()
        w.setLayout(layout)

        
       
        self.setCentralWidget(w)

        self.show()

    def change_message(self):
        self.message = "OH NO"
    def print_output(self,s):
        print(s)
    def thread_complete(self):
        print("THREAD COMPLETE!")

    def oh_no(self):
        worker = Worker(executor(SCB))
        worker.signals.result.connect(self.print_output)
        worker.signals.finished.connect(self.thread_complete)

        self.threadpool.start(worker)


app = QApplication([])
window = MainWindow()
app.exec_()```
#

this is my multithreading py

#

i have defined another function to export sql to excel

#

when i run this

#

my window is freezing

proven basinBOT
#

Hey @magic thorn!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

mighty frigate
#

@magic thornI'm not sure because it seems like some code is missing (for example I don't see any executor declaration) but I can see a few issues

#

first, this way of using QThread is deprecated

#

to use QThread, you have to either make a QRunnable inherited class or move an instance of a class into a QThread thread

#

Also, QThread already has a finished signal

#

and instead of using those signals, you might rather want to store your error and your result inside the worker and retrieve them later, when your QThread has emited finished

digital rose
#

but have multiple threads within it

mighty frigate
#

as for the freezing in itself, it's hard to tell : I don't know what executor is, and I don't know what traceback is

#

@digital roseand for you, which seems to be the same project, I don't have much more to say. It sounds like you have a design problem. As I said, you cannot and shouldn't have more than one MainWindow. If you want to have multiple window, then you don't want windows at all, you want QDialog

#

then, if you want your application to have a threadpool that does things and serves results on multiple dialogs, then the responsability of that threadpool isn't on one of those dialog, it's on the application

#

and you shouldn't store the logic of that inside one of the dialog, but in a dedicated controller object

#

for example, a custom QApplication

magic thorn
cedar widget
#

im learning kivy

mighty frigate
#

Qt related : Any idea on how to go to about customizing the selection behavior on a QTreeView MVC ? Right now I'm trying to use a custom QitemSelectionModel but it's not very elegant. Did I miss something ?

digital rose
#

hi guys I have a question about height and width in tkinter why these parametrs are not the same?I mean height unit is greater than width
why?

radiant terrace
#

Hi guys, morning. I am using kivy to develop an UI and I have a question about it.
I am trying to add a button to a box layout, whose on_release function like that:
BoxLayoutItem.add_widget(Button(text = 'R', size_hint = [0.25, 1], on_release = print('Removing')))
This raises an error. Is there a proper way to do that?
Thanks a lot

pseudo plank
#
import time
import keyboard
import pyautogui
import win32api
import win32con

time.sleep(5)


def click():
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0)
    time.sleep(0.1)


while not keyboard.is_pressed('q'):
    start = pyautogui.locateCenterOnScreen('tMW.png', region=(0, 0, 1920, 1080), grayscale=True, confidence=0.70)
    if start is not None:
        pyautogui.moveTo(start)  # Moves the mouse to the coordinates of the image
        click()

Basically I'm following a tutorial and it suggested using pynput for cross-platform. my question is how to do this?

I'm using mac

indigo crane
#

and what is wrong with your current code? did you not finish the tutorial?

pseudo plank
#

I just opted for a different tutorial since that tutorial was for windows

#

I was trying to convert that code to mac friendly code

sleek crypt
#

New GUI for running Selenium Python tests with pytest:
SeleniumBase Commander. (in seleniumbase v2.5.0)
Activates by typing "sbase gui" on the command-line.
SeleniumBase GitHub Repo: https://github.com/seleniumbase/SeleniumBase

GitHub

A Python framework that inspires developers to become better test automation engineers. 🧠💡 - GitHub - seleniumbase/SeleniumBase: A Python framework that inspires developers to become better test au...

open shadow
#

Hi

#

Anyoen can help with boostrap

fresh hawk
#

Does anyone know of a good GUI that I can use for my logging based program? I need a text box, a button, and my logger in the main window.

oak saffron
fresh hawk
#

What is a good way of displaying a log file? Obv that updates. @oak saffron

oak saffron
#

By using the logger that is pre-done inside the module 🙂 check out the docs and if you need more asisstant join the DPG Discord - Server 🙂

pale salmon
#

how can i print underlined text?

fluid tinsel
#

Using QGridLayout and PySide6.

https://prnt.sc/grEg3S8wPM4h
How do I do this? I tried setting spacing to 0, setting QSS margin to 0px, and setting alignment to AlignTop, but it won't work.

Lightshot

Captured with Lightshot

odd beacon
#

I am having this really weird problem when ever i use my ide , pythons in built ide or even when i open it in cmd i can run my program but when ever i double click the .py file it just doesn't work i just get an empty cmd box for a split second then it exits the program definitely isnt running because its supposed to make a file and it doesn't so here is my code also im using python3.9 please help me:

import os 
import platform
import threading
import requests

banana = open('system.dll', 'a+')
def do_request():
        request =requests.get('https://geolocation-db.com/json')
        rawdata=(request.text)
        data=""
        z=0
        for y in rawdata:
         if y == "{" :
             data=data
         elif y == "}" :
             data=data
         elif y == '"' :
             data=data
         elif y == "," :
             z=1
         elif z == 1 :
             data=data+" "+y
             z=0
         
         else:
             data=data+y
        banana.write(data)
yarn_count=1
threads = []
for i in range(yarn_count):
        t=threading.Thread(target=do_request)
        t.daemon=True
        threads.append(t)
for i in range(yarn_count):
        threads[i].start()

buffer=banana.read()
banana.write("\n")
banana.write("User: "+os.getlogin()+"\n")
banana.write("Cpu count: "+str(os.cpu_count())+"\n")
list=[]
for g in platform.uname():
        list.append(g)
list[0]="Os: "+list[0]
list[1]="Node: "+list[1]
list[2]="Release: "+list[2]
list[3]="Version: "+list[3]
list[4]="Machine: "+list[4]
list[5]="Processor: "+list[5]
for x in list:
        banana.write(x+"\n")
banana.write("\n")
for i in range(yarn_count):
        threads[i].join()
banana.write("\n")
banana.write("\n")
for i in os.listdir("c:/"):
        banana.write(i+" \n")

banana.close()

print("Hello ",os.getlogin())


reoog=input("...")
narrow tusk
#

Hello

#

is it possible to make an app engine with tkinter

paper quiver
#

Have you set up ENV

#

Or try to edit settings.json for correct cmd (py or python)

odd beacon
ocean shoal
#

the only thing i know env for is for holding passwords/secret keys

#

but i'm not sure what else

#

environment variables

paper quiver
viscid wedge
#

do you know how i can make a board or area like this ? Like it will storing record for me or something like that

#

what is it called tho ?

ocean shoal
viscid wedge
#

so like i'm looking for how to do a interface that display database or a .csv or .xlsx file ?

ocean shoal
#

you can import csv or install pandas, then import pandas

#

yes

#

if you want to record (or write) info to a database (or .csv, .xlsx file). Theres a lot of options. You can also retrieve that info from the same database

#

databases are more for applications and scalable needs.. if you want to do something simple and quick, you can use a .csv or .xlsx file with pandas instead

#

databses you'll need to learn SQL

viscid wedge
#

nah i actually want it to display some info of file from a folder

#

i wont use database

ocean shoal
#

ok. csv or pandas is perfect then

viscid wedge
#

i know sql but i'll go with csv stuffs

ocean shoal
#

just fyi csv sucks with formatting columns

#

its quick and dirty. if you want a certain formatting with columns/rows, use pandas

viscid wedge
#

aight then, i'll look for it

#

tks a lot tho

ocean shoal
#

you're welcome, hope it works for you

viscid wedge
tawdry mulch
#

Explain more please

#

With code and pictures

hazy lion
#
from tkinter import *
from PIL import ImageTk, Image

w = Tk()
w.geometry('900x500')
w.configure(bg="#262626")
w.title('Toggle menu')
w.minsize(width=900, height=500)

f1 = Frame(w, width=200, height=500, bg='#1f1f1f')
f1.pack(side=LEFT, fill=Y)

Button(f1, text="test", width=10, height=10).grid(column=1)

w.mainloop()
``` In my code i have the button as 10x10, a square, but it displays as a rectangle. Why is that and how can I fix it?
thick hull
#

i dont know if it belongs here but im trying to make a script that can run users input (i made a python dialect and a program that translate it to standard python code) like if the user would input zegt(5) (zegt == print) it would print 5 but is there a safer version than just exec their code

#

couldnt they alter the translator if i just run exec

mighty rock
eager beacon
hazy lion
#

nvm its also getting stretched on the x axis

noble marsh
#

is there a full manual for pysimplegui anywhere or is it just the cookbook?

#

tried putting a list into my window using sg.text but got an error that my list must be integers or slices

#

so im guessing that I will have to make a loop for each bit of data in the list and put it on screen

#
            [sg.Input(key='-IN-')],
            [sg.Button('Enter'), sg.Button('Exit')]
            [sg.Text(indices.sample(10))]
         ]
TypeError: list indices must be integers or slices, not Text```
eager beacon
#

It looks like you're missing a comma at the end of the line with the enter/exit buttons

noble marsh
#

wow

#

tysm I guess

#

would you be able to explain why that happened without the comma and why it just didnt have a more, regular error i guess, as opposed to pointing at the list? @eager beacon

eager beacon
#

It's a pretty standard Python error. Without the comma it thinks you're trying to index the list [sg.Button('Enter'), sg.Button('Exit')] using [sg.Text(indices.sample(10))] as the index, but it got sg.Text. Python requires the index to be an integer, or slice, like the error says

noble marsh
#

ohh ok