#user-interfaces
1 messages · Page 59 of 1
this is question i was asking it here take a look on it :
the same
use .place method
then
from it
call rely=1
example: add_btn.place(x=8, rely=1, y=-40) # 40px from the bottom
the same this labels and another widgets \👍
where is a good place to make a game manual?
hey i was wondering what the best way to get a slider and entry box to both show the same value is
so they update live instead of having to press a button to update them
@digital rose try setting min-height/width also
oops
So I have some basic Tkinter Code, that displays this here and in that red box there basically I want to display a Chessboard with the pieces overlaying on the Chessboard but however you can click on the pieces that will then show the available moves and i was wondering what would be the best way to display these images without making 64 different variables?
hi, can someone help me?
can I get some help with displaying unicode on a curses window? when I try it I get ~V~H instead of the character
Does anyone know if there is any library that might override, for example, html keyboard shortcuts in a textarea on a webpage and make them behave closer to a python IDE? What this may be called, or perhaps where to find the JS behind something like vscode's python text editing keyboard shortcuts?
or jupyter notebook
I believe codemirror may be an option, for anyone who has this same question
@zealous abyss what was the unicode?
it was the block character \u2588
hm
can you post your code?
and have you tried using 32 bit instead?
like '\U00002588'
what do you guys think about this: https://hasteb.in/defexidi.rb
What would be the best framwork for me if I like to build a cli application that shows streaming data from an API?
@tidal loom why don't you just use something like click
you don't need a gui for cli
@eager beacon I have never had any need to do this before but is click the recommended framework for cli apps? What's the difference between it and ex Rich?
I've never used Rich but it looks like Rich doesn't do much other than make it look pretty where as click makes it easier to write the application
I have an issue with Kivy
It is leaving the application as my program tries to scrap data from python
hello
what is the command key of a function I can use in python Tkinter to refresh my GUI and allow the user to input another data and run it again,
For example,
I have implemented a Navigation system that find the shortest part, in my GUI, a user can input start and also input End, But i'm stuck at the implementation of refreshing the page and let the user enter new data and run it without running the programme its self.
Hey, I need to center two labels in a grid in the same row
Any ideas how?
Also my frame won’t stay within the confines of my window, even if I make my window stupidly big
I want upper frame to be centered like its in next screenshot
when I pack that graph canvas, upper frame become centered automatically
Are you packing the frame into root?
Hi
yes
welcome
center it by the .place func

Hi all. I'm working with Tkinter to develop this simple GUI. I'm having a small issue that I need your help for.
In short, I need to open a second frame when a certain condition is fulfilled. It's a GUI for login, so I have defined the Login function separately and it outputs a messagebox confirming the login. I am unable to redirect the user to the second frame however. I have tried using if statements in the Class part of the code and a 'check' variable with 0, 1 to get the login state, but to no avail. Any help on this would be much appreciated
I'm not sure if what I said makes enough sense, I am a beginner to Python and this is my first program with Tkinter. So, perhaps I could share my code or get on a VC channel to seek help?
hi, can someone help me pls?
Hi all guys
can you help me pls?
Are you made another window? if yes made new frame with -master option
it is difficult to explain, can I send you a "scheme" of how I want to do the ui?
Cheers no worries!
I have a MainWindow with 3 frames in it
Each frame has all the required widgets and it's function definitions cut out for it
But my only hiccup lies in the issue that anyone regardless of logging in correctly or incorrectly can proceed to all 3 frames
I'd like only users who have been 'verified' with my login function to be able to proceed to the next 2 frames
how can I put section 4 below 3 but at the same time to the right of 2? (with kivy)
so I'm not good at kivy sorry
oh, oke
hmmm I don't really know wdym sorry
are you mean
all the users can see the frames
but you want to only the verified user ?
Yes. Correct
The verification is done by a user defined function called 'login' that is implemented when you press submit
I'm not sure, but I think I want to do a show_frame in a function that's outside the class MainWindow
yeah
any name
and pack or gride or place the frames
and when
it's verified
call the func
I've tried to do this for a similar problem I saw on stack overflow, but it didn't work
i was telling you another thing
Yes, go on
so yeah
I was telling another solution
from tkinter import *
root = Tk()
frm1 = Frame()
frm2 = Frame()
frm3 = Frame()
def load_frames():
frm1.pack(side=LEFT)
frm2.pack(side=BOTTOM)
frm3.pack(side=RIGHT)
submit_btn = Button(master=root,text="submit",command=load_frames).pack()
root.mainloop()
run this out
Guys, how do I position two labels in the same grid row center to the frame
Also, my frame isn’t confined within the window? Is there a fix for this, it’s too big
why you use grid system? @alpine ember
sorry my bad
see the edited script up ^^
Okay, I've run it and I think I understand what you mean. But can you elaborate how this is a fix? I'm still slightly confused
So, this will clearly be outside the Class right?
I want to make sure I understand this correctly
yes
Also, is there any way I can just send my current code to you and you can maybe make more sense of it?
In a help channel or a DM? I assume the former?
Oh right
1 sec, uploading
Yup, done
So, if you can see here in the class LoginPage
I want button1 to be displayed/go to Criteria frame when loginSuccess is True in the login() function
@digital rose Are you busy now? Should I message at you at another time perhaps?
what's the best method to use for organising widgets
Is there a function command for tkinter that closes all canvas?
sorry I'm was busy
No , sorry
What's the best layout/geometry manager? pack, grid or place?
I'm trying to make a GUI for running scripts I have
Of course
I have it working and have been using grid
But I have widgets like a 'progress bar'
It really depends on how you want it to be
And then I want a label representing the % of that progress bar
I don't need the label of % to take up as much space as the progress bar
Just make it smaller
Also there's a big issue I'm having atm
Wdym - I have no size set for the label
The frame within my window is too big for the window size
Yet I'm not setting a frame size anywhere
I use the external padding for the pack method I use
but the elements inside squish and don't correctly format
Try all of them out
Im not the best at Tkinter
Only made a simple calculator, for which I used grid
place
because
place you can with it place it on spefic place and you can make with it Fixed position

yeah but it doesn't adapt to window resizing
no he is can
with
rely and relx
take a look at
Well I'm using the grid layout system
And I have the small issue of the frame not being within the window
This is so strange
sorry im not good at grid
The Tkinter library is the first GUI library for python I’ve used. It’s pretty easy to learn but it can be pretty confusing as to the…
Something I've written. Could be helpful, could be utter bollocks - if you think I could add anything, do say
Hi, so is any GUI expert around here?
I have something i would like to make but have no idea how to make,
very simple but to me i cant do it, and if i can get it made all right now
that would mean the world to me, i want to make a A/R transaction GUI with tkinter
i want it to have the following in excel or python file
- Customer Number
- Customer Name
- Invoice Number
- Invoice Date
- Invoice Amount
Not to sound rude mate, but I really don't think you can get people to just code for you for free at least over here
Also, this GUI seems fairly simple and wouldn't take more than a few hours of learning and a day or two of implementing using only Google and forums
its more i need help with logic then learning how to do it, what steps to take and what not
i can code
Hey @vale orchid!
It looks like you tried to attach file type(s) that we do not allow (.pdf). We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .mkv, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .svg, .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.
oop
Cheers man. I'm a beginner too, and I think it would be smarter to ask questions about GUI you don't understand rather than ask someone to teach you from scratch when there are multiple resources out there already
i kinda need it tonight so i was more hoping for someone who could guide me alittle
but no one in any server seems to either know how or something
ask specific questions
@tawdry idol i have a help ocupied if u dont mind checking out that questio
entry. get() doesnt return any string. What might be the error?
I need help in updating the GUI that's built in classes with 3 frames. It needs to refresh itself/ update when any variable in a separate function is updated
Oh thank you. What can I do for you @alpine ember
What are you stuck on
anyone knows how to impliment removeRow in QABstractTableModel to be used in QTableView ? PySide2 or pyqt5
This!
@alpine ember When would you be free so that I can seek your help?
anyone knows how to impliment removeRow in QABstractTableModel to be used in QTableView ? PySide2 or pyqt5
@remote ravine
I don't know about qtableview, but I have worked with qtablewidget and it follows the corresponding syntax
qtablewidget_variable.removeRow(index of row you want to remove)```
it somehwat works now
@remote ravine
Could you provide more clarity on what you want to delete?
i need to delete a single row in QTableView that is using QAbstractTableModel
Which row? The one user clicks on?
So in order to get the index of that currently clicked row, you will need to use '.currentIndex().row()' on qtablewidget
Then input that value in removeRow() function
i did ?
hello, can someone help me with kivy pls?
oke...
it is difficult to explain, can I send you a "scheme" of how I want to do the ui?
how can I put section 4 below 3 but at the same time to the right of 2?
@hollow shore try qt designer
its for Qt bit i think its very usefull. no matter the framework you use
oke thx 🙂
Could you describe how to delete row in your code?
Like what triggers row deletion?
@remote ravine
clicked signal (when the button is clicked) is connected to remRow.
remRow gets current model index, after that it calls self.model()...
self.model() == TableModel
so..
self.model().removeRow(model_index.row(), QtCore.QModelIndex()) calls removeRow in TableModel
also did u check comments in the reddit post ?
wrong link
it this one it removes the last row
if i pass currentIndex() to TableModel().removeRow() it doesn't remove any row
Does anyone know tkinter really well in here? I got a question i just cant solve.
@lunar kelp https://dontasktoask.com/
Well then. How do i completely reset a canvas? Cause everything ive tried isnt working. Just trying to keep images centered. But after zooming the images it takes a couple refreshes before it gets back to center again. Dont understand it at all.
import PIL
load = PIL.Image.open(filepath)
render = PIL.ImageTk.PhotoImage(load)
tk.Label(window, image=render).pack()
Could you share a code snippet or something?
Sure, one sec. Ill drop my class.
Theres actually 4 extra lines of code in there, was trying to flash reset it by filling the canvas before displaying the correct size
its not working
Are you giving it the correct path to image?
let me try again
That link i pasted deals with a way more in depth version of that tiny bit of code
Hey, I think the issue lies with qtableview since it controls the model. So when you delete a row, it automatically recalibrates other rows to fit the dataframe. In fact, when you delete the 1st row, the first row is definitely deleted. But now the labels of the 2nd row change to the labels of the first row. So it gives the effect that the last row is deleted instead of the row which was supposed to be deleted
it doesn't give the effect because i have values set in each row
its not working even after giving correct path
Maybe its because its not set to a class or global variable and is cleaned from the cache. Set it to self.render or global render
the error
bg_image = Image.open("password.png") photo=ImageTk.PhotoImage(bg_image)
bg=Label(root, image=photo)
bg.pack(padx=30, pady=30)
``` @median willow copy exactly that
Hold on
There copy that
Typing on a phone is incredibly difficult
Have you tried destroying the canvas widget and creating a new one? Also so how to run your code?
Can't without recalling the class. Other could possibly pack_forget, re pack it see if that fixes it. And im not sure what you mean by that last statement
What do I you call in order to run your application or to make the gui appear?
I call ID = ImageDisplay(widget instance, width of widget, height of widget) then when i display image its ID.open_image(filepath) can link it to a canvas or a label.
Sorry it's been sometime since I used tkinter, could you say which widget instance should be fed to it?
Ya. So canvas = tk.Canvas(). You pass the variable holding the canvas
So itd be ImageDisplay(canvas, canvas.winfo_width(), canvas.winfo_height())
Which i suppse could actually be simpler now that i think about it
You gonna be on in about 30 minutes? Ill go to an internet cafe and upload my whole program to github. Might make it easier.
wait up
I guess it would be better than way, upload in your own time, no hurry. I will try to reply asap
Ok, youll need pillow and send2trash modules if you dont have them
I have pillow, will need to install other
@rough fulcrum its at https://www.github.com/kendalk08/image_viewer
Tell me about it
fuck nvm
got it
1: i fixed a problem with my code when deleting an index from pandas DataFrame
2: its a problem with parent
Does it delete properly now?
not really
it deletes the last row
...
idk why
this is right ?
self.model().removeRow(self.curr_index_model.row(), self.curr_index_model.parent())
def removeRow(self, row, parent):
self.beginRemoveRows(parent, row, row)
self.data_frame.index.drop(row)
self.endRemoveRows()
0, 0 replace with row, row
it has to be a problem with parent since it has index -1, -1 so basically last row
hmmm. let me test something
I will check it out and let you know
i am gonna create an index
because it doesn't give a shit if i pass the parent of QModelIndex or QModelIndex()
it doesn't delete anything...
alright @rough fulcrum im headed home. im exhausted. but you have the full program now, so ill check back
Definitely
i still don't fully understand what parent is
parent is the widget which you are inheriting from
u sure thats the same for models ?
if its the same it makes much more sense
but still doesnt explain the issue
pm me
I guess it is the same. Because everything inherits from something. Every derived class inherits from the parent(base class).
I don't think that the solution to your issue should be much complex
There could be case that the widget might not have a parent at all
i am so sonfused rn
what would be a parent be of a QModelIndex be ?
a row or a column ?
None of that actually. Lets take an example, you used QtableView to derive TableView class. So the parent of TableView class is QTableView
So I think QModelIndex doesn't have a parent
still doesn't explain why it would delete the last row
hi
hi
Hi
@rough fulcrum you should also note, that program can be placed anywhere. You can navigate to your image directory inside the program. Its starting point though is os.getcwd()
And yes, i hand drew all the little icons. Thats how bored i get lol
Yes thanks @lunar kelp the program seems really big. Seems like you are developing some software
If you have Paint 3d on your setup, you could design the icons on it
I would feel the same, I really hate to make GUIs as well🤣
Lmao it is software. Just as functional if not more useful then the built in image viewer on windows. Cause you can navigate all the files on your pc while doing it.
hey if you py print(self.data_frame), you will see that nothing is getting deleted. What I interpret from that is that the program is deleting rows from the GUI, but nothing is getting deleted from the data_frame. Which points out that everytime you click the button, you are deleting a row from the GUI, but since the dataframe is same, it is only showing a shrunken list of numbers
let me test again
I get this result every time I press delete and print
ya i just noticed
Forgot to mention that I was trying in the range of 50 to 100
self.data_frame = self.data_frame.drop(self.data_frame.index[row])
bruh
and my day is ruined. i wasted more than 10 hours on this problem
idk if i should laugh of cry
ah, I tried py self.data_frame = self.data_frame.index.delete(row) and it was returning a blank object
🤣
lmao
at least it works now
i am making a gui for liqudictl btw
making it display a graph will take less time than making it display some data correctly
Man I will punch you for that silly mistake, at least the indexing part should have been right🥲
yea ik
but know i know why
.index returns the "index"
.drop() takes that index as an argument
Been there, done that. Totally worth it I would say if you have time to spare
yea i have a week to spare now
we have something called "practice" which has a different meaning in my language. basically u go to "work" to a company for 2 weeks
I actually tried with drop before delete, it deleted once and then gave an error so I reverted back to delete. In that time you already got the answer
well at least i learned something
So like an internship or training
That's nice. Are you in school?
rn ? no
or graduate school?
holy shit how many ppl are in vc
vc?
voice-chat
How many are you hearing?
Lmao
its quite quiet
In which year of highschool are you in?
second
I guess the highschool concept in my country is different from yours
what's the structure there?
lets go to dm
ah yeah
i dont want to spam this channel when ppl need help
you are right
hI
Guys my big problem it's who to delete background of a widget 😩
I know I can't do it but is there anyway right left ?😭
You will find tons of guidance material on youtube and google
already did a big chunk of it
almost done actually, i just have a dumb syntax error
i would use help channels to get it fixed but no one answers mine
If it is user interface related, you could ask here
c.execute('INSERT INTO transactions VALUES (:Customer_Numb, Customer_N, Invoice_Numb, Invoice_D,Invoice_Am)',
{
'Customer_Numb': Customer_Numb.get(),
'Customer_N': Customer_N.get(),
'Invoice_Numb': Invoice_Numb.get(),
'Invoice_D': Invoice_D.get(),
'Invoice_Am': Invoice_Am.get()
}
#commit changes
base.commit()
File "class.py", line 43
base.commit()
^
SyntaxError: invalid syntax```
idk where the syntax error probably really simple
Wait, let me dm you if that's okay since this issue is not related to GUI
oh ok sure and thanks
Hello there friendos
I am using tkinter at the moment,
Hello = Tk()
Hello.title('Hello!')
Hello.geometry('300x125')
box = Entry(text = 0)
name = Label(text = 'Enter name')
button = Button(text = 'Enter')
box.place(x =75, y =10, width =200, height =20)
name.place(x =10, y =10, width =60, height =20)
button.place(x =75, y =35, width =60, height =20)
Hello.mainloop()```
is it possible to make this look
less ugly
@green wind you might be able to store dimensions in a variable
Is there a way to make 2 windows open for one python script, for example im trying to have a menu on one then it opens up and has logs on the other all in one file
@green wind any specific reason why you're using place as opposed to grid or pack?
The guide I'm using uses place
@digital rose when you say windows, what do you mean? Explorer window? GUI window? Web broswer?
@green wind ah, okay. I do recommend you check our grid and pack at some point later
Does that come with tkinter
They sound smoother
Think you can give me a bit of a rundown on the commands? :) @static cove
So tkinter has 3 different ways you can organize the placement of objects, they're called grid managers:
- .place() - you give it an exact x, y, width, and height. It's easy to use but doesn't work if you want to resize or have something dynamically scale.
- .place() - This sort of does the work for you and assumes you either want things side by side or above/below. It's simple, but if you're looking for something quick for small projects, it's great
- .grid() - You specify a row and a column. You can get a lot of customization out of this since you can specify that an object span multiple rows and columns. It sometimes has odd behavior, but overall it's my favorite of the three.
.grid() + .place() can be used together and so can .pack() and .place(). BUT .grid() and .pack() CANNOT be used together in the same frame/window. You can use different frames to overcome that but that's getting a bit advanced.
class NumInput(TextInput):
def set_layout(self, layout):
kb = Window.request_keyboard(
self._keyboard_close, self)
if kb.widget:
vkeyboard = self._keyboard.widget
vkeyboard.layout = 'numeric.json'
def _keyboard_close(self, *args):
""" The active keyboard is being closed. """
if self._keyboard:
self._keyboard.unbind(on_key_down=self.key_down)
self._keyboard.unbind(on_key_up=self.key_up)
self._keyboard = None
Hello, I am a newbie in Kivy and trying to make a numerical input field, yet the called keyboard is still the default one, even though I am calling the 'numeric.json' as it is specified in the documentation.
Can anybody provide insight as to why? The json file is located in the folder with my main.py file
you guys know a DomainUpDown equivalent in PyQt5?
like this, you have a couple of String options to choose from and it drops down like that
nvm figured it out its QComboBox
How/where are you calling set_layout?
Oh.
OH
I am not
So theoretically I can now create a method for _on_focus event, that would call set_layout
Thx @tribal path
what is everyone's preferred GUI lib ?
im trying to start making GUi apps but dont know which lib to use
Hmm, thought this would work, but it doesn't, but I can feel Im on the right way
or pyqt5
class NumInput(TextInput):
def set_layout(self, layout):
kb = Window.request_keyboard(
self._keyboard_close, self)
if kb.widget:
vkeyboard = self._keyboard.widget
vkeyboard.layout = layout
def on_focus(self, instance, value):
if value:
vkeyboard = self._keyboard.widget
partial(self.set_layout, 'numeric.json')
else:
pass
def _keyboard_close(self, *args):
""" The active keyboard is being closed. """
if self._keyboard:
self._keyboard.unbind(on_key_down=self.key_down)
self._keyboard.unbind(on_key_up=self.key_up)
self._keyboard = None
not
no i think i will use html for python GUI
it won't work
I am a newbie my friend
karim, would you mind providing me info as to where im not assigning the layout right?
are you using kivy?
I feel like thats the issue, that I am clearly missing a point where Im supposed to bind the layout, but I dont know enough to pinpoint it
yes
i dont knwo much about kivy sorry i cant help you 😦
google doesnt help with vkeyboard too, theres basically only the official documentation, which is way too much info for me to understand how it works, without seeing a complex example other than "Heres a screen with keyboards"
making two types of vkeyboard inputs, one for text values like login and pass, other for numerical purposes + reading serial ports and appending a complex C library and my GUI would be done
Im stuck at the keyboard one atm
Alright, managed to unscramble some bits and figured out how using partial, wasnt doing anything for me
now I can call the numerical keyboard, but the layout remain set globally, so I have to figure out now for optimization'S sake if its easier to create a new textinput class which will call the default keyboard or if its just simpler to reset the layout somehow
here's the semi-working code, if anybody is interested
class NumInput(TextInput):
vkeyboard = None
def __init__(self, **kwargs):
super(NumInput, self).__init__(**kwargs)
def set_layout(self, layout):
kb = Window.request_keyboard(
self._keyboard_close, self)
if kb.widget:
vkeyboard = kb.widget
vkeyboard.layout = layout
def on_focus(self, instance, value):
if value:
self.set_layout('numeric.json')
else:
pass
def _keyboard_close(self, *args):
""" The active keyboard is being closed. """
if self._keyboard:
self._keyboard.unbind(on_key_down=self.key_down)
self._keyboard.unbind(on_key_up=self.key_up)
self._keyboard = None
How can I add a date and time input widget in tkinter?
Yup as in the entry
I want the entry field to be a calender pop up from which the user can select a date
oh
Similarly for time
I tried tkcalender
Not exactly, like a literal calender and selection
yeah ok
i dont know if there is a widget that looks like that
nop
😂👍🏻 no worries mate
can't it just be an entry
where user can write the actual day
c'mon make it a bit harder for them
they're litterally hooked telling devs they want everything that ez
for them
Nah 😂 it's for a uni assignment
No worries mate
ok
i know there is away to turn windows form app i into tkinter but i cant find out how
i did it before using an app, i had visual studios and opened a windows form app, and the gui made in windows form app could be turned into code for tkinter
hihi
can someone suggest a "ui" editor which allows me to upload my html files and edit it like wix??
Guys, is there any way in tkinter, to make an Entry text box such that a function is run whenever any change is made to the text inside it?
Is there anybody who could explain to me why TextInput in Kivy is delaying transitions and changing colors on the following screen? (moving from textinput screen to screen without it)
look can i help u differently
ok
# first make a function that takes the components of the entry and puts it in a variable
def function1():
global var1
var1 = entry.get()
#now put a mainloop
bool1 = True
while bool1:
var2 = entry.get()
if var2 =! var1:
print ("a change has been made to the entry")
this should work
but im not sure
let me try
but where do I add the code after or before "root.mainloop()"
from tkinter import *
root = Tk()
root.title("Ratio helper!!!")
D2 = Entry(root)
D2.pack()
root.mainloop()
Example code, not mine
why u cant send yours
You will get confused, its too messy and too many things are there
nothing happens, but text editor gives a warning, "var1 is unbound"
see, code is like this:
from tkinter import *
root = Tk()
root.title("Ratio helper!!!")
D2 = Entry(root)
D2.pack()
# first make a function that takes the components of the entry and puts it in a variable
def function1():
global var1
var1 = D2.get()
#now put a mainloop
bool1 = True
while bool1:
function1()
var2 = D2.get()
if var2 != var1:
print ("a change has been made to the entry")
function1()
root.mainloop()
Actually, nothing happens, no window shows up, I have to quit it by pressing Ctrl+C
no
yes
it gets stuck in while true loop
ok
I would use recursion as you can use the root.after() method
this post gives you some info https://stackoverflow.com/questions/459083/how-do-you-run-your-own-code-alongside-tkinters-event-loop
Ok, it works
Guys
How would I be able to run functions via tkinter gui and NOT have my damn gui freeze up until function is complete
There's a package (not working on windows) that seems to be able to combine tkinter and asyncio: https://github.com/fluentpython/asyncio-tkinter and there's this stackoverflow question: https://stackoverflow.com/questions/47895765/use-asyncio-and-tkinter-or-another-gui-lib-together-without-freezing-the-gui
But it seems to be starting a thread that then prints instead of interacting with the interface further, I don't think it's that easy getting past threads
What's asyncio
Since I'm a big dumdum and don't know how to use asyncio in the first place, I wrote up an example with a thread that interfaces with the UI via a queue as well once: https://gist.github.com/Square789/46b0fdf0905c229567798ff9f3ebc275
yeah good question, i'd describe it as a python library that allows for the parallel execution of IO-bound tasks
What are you doing to cause your UI to freeze?
Are you writing to a database or downloading something or is it a long running calculation?
Hello 👋. Is the Kivy package aimed to mobile app development? Or can I use Kivy to develop a desktop application with all possibilities (for Windows, Mac, Linux)
Because most titles I read are "Kivy for mobile development"
😄 good. Thank you @unique forge
hey is there a way to "hide window when not focused" on qt?
Hello! Having an error im unsure about with this part of the script im making.
if pyautogui.locateOnScreen('crate1.png' or 'crate2.png' or 'crate3.png' or 'crate4.png', grayscale=True, confidence=0.6) ==None:
pyautogui.keyDown('down')
time.sleep(np.random.uniform(0.005,0.01))
pyautogui.keyUp('down')
#if there's a gift available then sift thru the row
if pyautogui.locateOnScreen('man.png', grayscale=True, confidence=0.6) !=None:
pyautogui.click('crate1.png' or 'crate2.png' or 'crate3.png' or 'crate4.png')
Hello, I am trying to iterate through widgets using a the keys from a dictionary. I have a dictionary with the widget names and I am trying to do a .config() to change the fg and bg color
it gives me an error with the following
def change_all_colors():
for key, val in set_color.items():
set_color[key] = FastLED_color
key.lower().widget.config(bg=FastLED_color, fg=FastLED_color)
print(key.lower() + ' : ' + FastLED_color)
the error is: AttributeError: 'str' object has no attribute 'widget'
I have a very basic bot script, however i feel like it's lacking speed. Could someone review it and let me know what i can do to make the process go faster?
Currently it does down 1 layer in this clicker game, checks if there's a present and goes down again
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
key is just the name. Is val the widget?
the key is the widget. the val is the color value I am sending to the led. but the import is the key
key.lower() converts the uppercase key in the list to a lowercase which the widgets are. For example the list shows LED0, LED1 and the widget names are led0, led1, there are 453 of these widgets.
key is just a string though, is there another dict with the widgets or is it just them defined globally there...
In your snippet you are reassigning the value before even using it, is it being used/read elsewhere?
the widgets are defined globally
Ideally you could/should store them in a list/dict, would seem to make more sense than storing (just) the names.
In the interim you can get the widget from the string via globals()["key"]
getting this error with setting an ico file as the favicon of the tkinter window, only happening on my laptop and not on my main pc. was working yesterday on laptop as well but suddenly not working. ico file EXISTS on laptop and PC
help
someone come from Indonesia?
not me at least
@digital rose I reccomend PyQT
Also PyQT has a tool called qt designer, which is a drag and drop intergace to create a Python UI
I am having trouble with intergrating my Pyside2 UI I created with QTdesigner to run insider blender. anyone who has experience in this ? or would like to take a look and help me out ? I'd be forever grateful. The problem is with some multiple file reading and I cannot figure that part out
Hey anyone moderately experienced in PyQT?
I want to make a context menu in pyQt application's status icon get keystrokes. Like keyboard shorcuts
I know we can put those from qt designer in menustrip, but I need to make it on context menu
Hey @lucid trench!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
Hey @lucid trench!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
from tkinter import filedialog, Text
import os
root = tk.Tk()
apps = []
if os.path.isfile('save.txt'):
with open('save.txt','r') as f:
tempApps = f.read()
tempApps = tempApps.split(',')
apps =[x for x in tempApps if x.strip()]
print(apps)
def addApp():
for widjet in frame.winfo_children():
widjet.destroy()
filename = filedialog.askopenfilename(initialdir = "/", title= "Select File",
filetypes=(("executables","*.exe"),("all files","*.*")))
apps.append(filename)
print(filename)
for app in apps :
label = tk.Label(frame, text = app, bg ="gray")
label.pack()
def runApps():
for app in apps:
os.startfile(app)
canvas = tk.Canvas(root,height = 700, width = 700 , bg="#263D42")
canvas.pack()
frame = tk.Frame(root , bg="white")
frame.place(relwidth=0.8,relheight=0.8 , relx=0.1 , rely=0.1)
openFile = tk.Button(root , text = "Open File" , padx=10,
pady=5, fg="white", bg="#263D42" ,command=addApp)
openFile.pack()
runApps = tk.Button(root , text = "Run Apps" , padx=10,
pady=5, fg="white", bg="#263D42", command=runApps)
runApps.pack()
for app in apps :
label = tk.Label(frame, text=app)
label.pack()
root.mainloop()
with open("save.txt","w")as f:
for app in apps:
f.write(app + ',')
mY NEW GUI CODE PLS CHECK
I have this UI code and the blender addon also created. functionality wise it runs properly through blender but the UI doesnt show up properly. can someone help me on this please. blender doesnt ship with Pyside2 so you need PySide2 and Shiboken2 modules in your blender site packages,
You can embed matplotlib pyplot figures into tkinter windows, however I can only set the Figure size using inches and DPI, does that mean my window will appear differently depending on the monitor / screen size?
Hello guys! I would like to read some data from excel sheets and do some basic calculations. Dependent of the results, I would like to extract informations from another sheet and show the results in a spreadsheet like GUI. how can i do that in the easiest way?
Basically a GUI that almost looks like excel and maybe has some filtering function.
or is VBA just easier?
@oblique steeple its never wrong to use what you are used to using. VBA has tight integration into the Microsoft. Writing your own "excel" in Python is going to be a bunch of work.
hey guys
I was wondering if any of you knew how to draw a weekly course schedule with python
or if you guys knew of any apis that might help
how is this ui?
hi, I need some help with PyQt5
What do you need help with?
https://ibb.co/G56Ygrs This is my layout
Now I want when user selects one of the radio buttons, the current window should close and the corresponding window should open
`
class PdfApp(main.Ui_Dialog):
def init(self, MainWindow):
super().setupUi(MainWindow)
MainWindow.setWindowFlags(QtCore.Qt.WindowCloseButtonHint
| QtCore.Qt.WindowMinimizeButtonHint)
MainWindow.show()
self.radioButton.setChecked(False)
self.radioButton_2.setChecked(False)
self.radioButton.toggled.connect(self.radioSelect)
self.radioButton_2.toggled.connect(self.radioSelect)
def radioSelect(self):
pass
`
I saw SO https://stackoverflow.com/questions/48353398/pyqt5-how-to-open-a-new-window-and-close-the-current-window but self.close() gives me error of "Python is not Responding"
Hello anyone here
I made a button which shows cards , but I want that it should show card after 2 seconds from clicking the button
How should I do this
from time import sleep
And where in the code you want it to wait, you type:
sleep(2)
@digital rose
eh
i might be wrong
but using sleep for longer intervals of time is not advised
cuz you cant multitask if sleep is used
i have another issue here
Yes?
it says Image has no attribute named open
i imported Image from PIL
Because i want it in my GUI
should i send the code
?
Um sure
from PIL import Image,ImageTk
root=Tk()
img=ImageTk.PhotoImage(Image.open("space.jpg"))
l1=Label(root,image=img)
l1.pack()
root.mainloop()
module object not callable
How do I use a image as a button in Tkinter?
hello iam new hier
hellow , i am designing a gui with pyqt5,and i want to set a image as a button ,How do i do that?
Hi, I'm making a program that copies files and I want a progressbar, how can I do that?
ok
so iam new to phyton and iam using tkinter .what iam asking is can you use .pack and .grid in 1 window
and if i cannot how iam can use thos to thing at the same time ,or ther is another way
if its tkinter
from tkinter import ttk
ttk.Progressbar()
and then see the docs related to it
Yes, I know how to add the progress bar, but I do not know how to report back progress from the copying process and add to the progress bar
@torpid vessel You'd need some sort of parallel execution for that, otherwise the copying process will just hang the UI while it's running so the progress bar becomes useless
so like async?
Basically, but asyncio and tkinter don't play well with eachother
The way I've been doing this stuff boils down to a thread, a queue and a tkinter after routine that calls iself, checks the queue and if the thread isn't done yet, calls itself again
I've written up an example here, if you don't understand something about it, just ask: https://gist.github.com/Square789/46b0fdf0905c229567798ff9f3ebc275
oh sweet thanks!
i used django for backend and bootstrap and google charts for frontend
i tweaked it a bit
now:
@signal belfry
but ik that they use it for smth cool prolly
ir means original poster
@digital rose OP here means Over Powered ||Sorry for the ping though||
nvm
i regret what i said before
If anyone can explain/assist me how this isn't working that'd be awesome! Just trying to make a simple clicker for a game to select multiple types of rocks in as short as lines as possible preferably
if pyautogui.locateOnScreen('rock1.png' or 'rock2.png' or 'rock3.png' or 'rock4.png', grayscale=True, confidence=0.8, region=(161,174, 1300, 840)) !=None:
ore = pyautogui.locateCenterOnScreen('rock1.png' or 'rock2.png' or 'rock3.png' or 'rock4.png', grayscale=True, confidence=0.8, region=(161,174, 1300, 840))
print("I can see ore!")
pyautogui.click(ore)
time.sleep(.05)
pyautogui.click(ore)
time.sleep(.05)
pyautogui.click(ore)
time.sleep(.05)
pyautogui.click(ore)
time.sleep(.05)
pyautogui.click(ore)
time.sleep(.05)```
please ping me if you do know 🙂
Anyone familiar with wxpython?
just ask @grand mason
wait a minute
import numpy
import random
from tkinter import *
import keyboard
from PIL import Image, ImageTk
def roll():
chance=(1,2,3,4,5,6)
probability=(0.05,0.15,0.3,0.3,0.15,0.05)
result=str((random.choices(chance,probability)))
result=result[1:-1]
if result=='1':
dice_pic=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\one.png')
labelphoto= Label(root,image=dice_pic)
labelphoto.place(x=50,y=35)
print("1")
elif result=='2':
dice_pic=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\two.png')
labelphoto= Label(root,image=dice_pic)
labelphoto.place(x=50,y=35)
print("2")
elif result=='3':
dice_pic=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\three.png')
labelphoto= Label(root,image=dice_pic)
labelphoto.place(x=50,y=35)
print("3")
elif result=='4':
dice_pic=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\four.png')
labelphoto= Label(root,image=dice_pic)
labelphoto.place(x=50,y=35)
print("4")
elif result=='5':
dice_pic=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\five.png')
labelphoto= Label(root,image=dice_pic)
labelphoto.place(x=50,y=35)
print("5")
elif result=='6':
dice_pic=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\six.png')
labelphoto= Label(root,image=dice_pic)
labelphoto.place(x=50,y=35)
print("6")
root=Tk()
root.geometry("640x640")
root.title("Dice Rolling Simulator")
root.iconbitmap(root,r'C:\Users\amrik\Desktop\Dice Simulator\Dice\icon.ico')
roll_button=Button(root,text="Roll",font=('Arial',16,('bold')),height=2,width=10,command=roll)
roll_button.place(x=240,y=520)
root.mainloop()```
k so
yup
And that is?
Even if thats the case, it should display the 6th image right?
yeah
But it is displaying nothing
ah better
even better
lol
so first
ur only displaying the button
but you’re not displaying the label
also can you use .pack() instead cuz you’re just showing 2 widgets
@meager pilot
If I use pack, it will be displayed somewhere else
it’ll be displayed in the center no ?
hello
oui
ah
This is how it looks like
k use .place() instead
yup
hm
put :
labelphoto.place(x,y)
put it in the last line of roll()
and run your code
( and giv feedback ofc )
Its working
TypeError: place_configure() takes from 1 to 2 positional arguments but 3 were given
But I am given this error
where did u use place_configure()
I didn't
yes well cuz
labelphoto.place(x=150,y=20)
not labelphoto.place(150,20)
did it work now
For some reason, it stopped displaying the images
no error
k can u take another pic of the code
sorry but i have to see the code to guess the problem
Well its showing the error now... wait
which error
nevermind... I forgot to save the code
when I directly put the values instead of x and y, the images are being shown
I dont understand why
nope
SyntaxError: name 'labelphoto' is used prior to global declaration
ah k
ok
it should work this thing out
can u put global labelphoto in the function
at the top pf roll()
i think u were right
if it still doesnt work
we will try something different
Nope, didn't work
if else
?
nothing
wait i think it”s
well instead of
putting an image
can u change the label’s content to some text
which is 1,2,3,4,5,6
just to see
ok wait
done ?
When I try to declare a new label, my IDE says that it is not accessed by pylance
so basically if the numbers are being shown to the label, means the problem is with the image
pylance ?
yeah
It sort of means that "that line of code will not get executed'
why
IDK
import numpy
import random
from tkinter import *
import keyboard
from PIL import Image, ImageTk
def roll():
global labelphoto
chance=(1,2,3,4,5,6)
probability=(0.05,0.15,0.3,0.3,0.15,0.05)
result=str((random.choices(chance,probability)))
result=result[1:-1]
if result=='1':
#dice_pic1=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\one.png')
#labelphoto= Label(root,image=dice_pic1)
txtlabel=Label(root,text="1")
#labelphoto.place(x=50,y=35)
#print("1")
elif result=='2':
dice_pic2=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\two.png')
labelphoto= Label(root,image=dice_pic2)
#labelphoto.place(x=50,y=35)
print("2")
elif result=='3':
dice_pic3=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\three.png')
labelphoto= Label(root,image=dice_pic3)
#labelphoto.place(x=50,y=35)
print("3")
elif result=='4':
dice_pic4=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\four.png')
labelphoto= Label(root,image=dice_pic4)
#labelphoto.place(x=50,y=35)
print("4")
elif result=='5':
dice_pic5=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\five.png')
labelphoto= Label(root,image=dice_pic5)
#labelphoto.place(x=50,y=35)
print("5")
elif result=='6':
dice_pic6=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\six.png')
labelphoto= Label(root,image=dice_pic6)
#labelphoto.place(x=50,y=35)
print("6")
labelphoto.place(x=150,y=20)
root=Tk()
root.geometry("640x640")
root.title("Dice Rolling Simulator")
root.iconbitmap(root,r'C:\Users\amrik\Desktop\Dice Simulator\Dice\icon.ico')
roll_button=Button(root,text="Roll",font=('Arial',16,('bold')),height=2,width=10,command=roll)
roll_button.place(x=240,y=520)
root.mainloop()```
@meager pilot are u here
yup
and?
😦
Just a note: The global variable has not been defined before being used in the roll function
I tried that as well
u mean after the imports or after setting the Tk()
I don't know if I can help you, but can you post your full code? Let me have a look.
import numpy
import random
from tkinter import *
import keyboard
from PIL import Image, ImageTk
def roll():
global labelphoto
chance=(1,2,3,4,5,6)
probability=(0.05,0.15,0.3,0.3,0.15,0.05)
result=str((random.choices(chance,probability)))
result=result[1:-1]
if result=='1':
#dice_pic1=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\one.png')
#labelphoto= Label(root,image=dice_pic1)
txtlabel=Label(root,text="1")
#labelphoto.place(x=50,y=35)
#print("1")
elif result=='2':
dice_pic2=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\two.png')
labelphoto= Label(root,image=dice_pic2)
#labelphoto.place(x=50,y=35)
print("2")
elif result=='3':
dice_pic3=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\three.png')
labelphoto= Label(root,image=dice_pic3)
#labelphoto.place(x=50,y=35)
print("3")
elif result=='4':
dice_pic4=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\four.png')
labelphoto= Label(root,image=dice_pic4)
#labelphoto.place(x=50,y=35)
print("4")
elif result=='5':
dice_pic5=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\five.png')
labelphoto= Label(root,image=dice_pic5)
#labelphoto.place(x=50,y=35)
print("5")
elif result=='6':
dice_pic6=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\six.png')
labelphoto= Label(root,image=dice_pic6)
#labelphoto.place(x=50,y=35)
print("6")
labelphoto.place(x=150,y=20)
root=Tk()
root.geometry("640x640")
root.title("Dice Rolling Simulator")
root.iconbitmap(root,r'C:\Users\amrik\Desktop\Dice Simulator\Dice\icon.ico')
roll_button=Button(root,text="Roll",font=('Arial',16,('bold')),height=2,width=10,command=roll)
roll_button.place(x=240,y=520)
root.mainloop()
@meager pilot why are u importing keyboard,numpy, and ImageTk
if they arent needed
Oh yeah... I imported keyboard bcoz I thought I would require it and about ImageTk, I sort of was looking for a fix for the image thing... I removed them now
k
Is there no image for 1?
yeah
There is
I was just debugging with @keen path
Okay
import numpy
import random
from tkinter import *
def roll():
global labelphoto
chance=(1,2,3,4,5,6)
probability=(0.05,0.15,0.3,0.3,0.15,0.05)
result=str((random.choices(chance,probability)))
result=result[1:-1]
if result=='1':
dice_pic1=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\one.png')
labelphoto= Label(root,image=dice_pic1)
labelphoto.place(x=50,y=35)
print("1")
elif result=='2':
dice_pic2=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\two.png')
labelphoto= Label(root,image=dice_pic2)
labelphoto.place(x=50,y=35)
print("2")
elif result=='3':
dice_pic3=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\three.png')
labelphoto= Label(root,image=dice_pic3)
labelphoto.place(x=50,y=35)
print("3")
elif result=='4':
dice_pic4=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\four.png')
labelphoto= Label(root,image=dice_pic4)
labelphoto.place(x=50,y=35)
print("4")
elif result=='5':
dice_pic5=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\five.png')
labelphoto= Label(root,image=dice_pic5)
labelphoto.place(x=50,y=35)
print("5")
elif result=='6':
dice_pic6=PhotoImage(file=r'C:\Users\amrik\Desktop\Dice Simulator\Dice\six.png')
labelphoto= Label(root,image=dice_pic6)
labelphoto.place(x=50,y=35)
print("6")
labelphoto.place(x=150,y=20)
root=Tk()
root.geometry("640x640")
root.title("Dice Rolling Simulator")
root.iconbitmap(root,r'C:\Users\amrik\Desktop\Dice Simulator\Dice\icon.ico')
roll_button=Button(root,text="Roll",font=('Arial',16,('bold')),height=2,width=10,command=roll)
roll_button.place(x=240,y=520)
root.mainloop()```
This is the actual code
well i dont rlly know where to place labelphoto.place()
by being aware that it needs to be constantly updated @split ferry
Your suggestion is fine. Since it gets updates only once in the roll function, all you need to do is define it after all the changes are made
Yea
We tried it
but it’s already done no ?
Yeah, it didnt work
I'll go over the code. The problem might be something else
Yea, that is alright
@meager pilot wait was it showing the text
I wasnt able to try
Due to the pylance thing
pylance blabla
k @meager pilot
im on keyboard
the label is working
the problem is with the images
@meager pilot
The problem is with the images. They don't load inside the roll function
Just to define a label outside the roll function and insert an image.
It works fine. But it acts up when inside the roll function.
Yes exactly
Also, try using the PIL library. It's more consistent, I guess
Cool
@split ferry means that
the labels are constantly changing
the real problem is just displaying images
I solved it, but it's rather a tedious solution
Firstly I used, PIL library. And secondly, I defined all the global variables and updated them inside the roll function
I'll share the code
import numpy
import random
from tkinter import *
from PIL import Image,ImageTk
def roll():
global pilimage, dice_pic1, labelphoto
pilimage=Image.open("image name")
dice_pic1= ImageTk.PhotoImage(pilimage)
labelphoto= Label(root,image=dice_pic1)
labelphoto.place(x=0,y=0,)
print("1")
root=Tk()
root.geometry("640x640")
root.title("Dice Rolling Simulator")
#root.iconbitmap(root,r'C:\Users\amrik\Desktop\Dice Simulator\Dice\icon.ico')
roll_button=Button(root,text="Roll",font=('Arial',16,('bold')),height=2,width=10,command=roll)
roll_button.place(x=240,y=520)
pilimage=Image.open("image name")
dice_pic1= ImageTk.PhotoImage(pilimage)
labelphoto= Label(root,image=dice_pic1)
labelphoto.place(x=50,y=35)
print("1")
root.mainloop()
This is entirely my version of the code. Use the same logic and you should be fine
yeah
ok
yeah yeah
wait
Hey @keen path!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
!paste
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.
there @meager pilot
i fixed it to fit your image directories
tell me if there is any error with it
Hey @meager pilot!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
Whats this?
look at the buttons
well its vsc
but im just using it as an example
well you will understand the joke
when i finish
it
ok
Hey
What if I want to send my code to my friend?
Where the directories will vary?
he needs to change the directories
so the code can find the images where they have to be
I want to adjust such that he doesnt need to
I mean I have a folder named Dice Simulator where all the files are store..
Cant I made changes such that the code will check the folder whereever it is?
lol
def roll():
global pilimage, dice_pic, labelphoto
chance=(1,2,3,4,5,6)
probability=(0.05,0.15,0.3,0.3,0.15,0.05)
result=str((random.choices(chance,probability)))
result=result[1:-1]
if result == "1":
pilimage=Image.open(r"C:\Users\amrik\Desktop\Dice Simulator\Dice\one.png")
dice_pic= ImageTk.PhotoImage(pilimage)
labelphoto= Label(root,image=dice_pic)
labelphoto.place(x=270,y=70,)
print("1")
if result == "2":
pilimage=Image.open(r"C:\Users\amrik\Desktop\Dice Simulator\Dice\two.png")
dice_pic= ImageTk.PhotoImage(pilimage)
labelphoto= Label(root,image=dice_pic)
labelphoto.place(x=270,y=70,)
print("2")
if result == "3":
pilimage=Image.open(r"C:\Users\amrik\Desktop\Dice Simulator\Dice\three.png")
dice_pic= ImageTk.PhotoImage(pilimage)
labelphoto= Label(root,image=dice_pic)
labelphoto.place(x=270,y=70,)
print("3")
if result == "4":
pilimage=Image.open(r"C:\Users\amrik\Desktop\Dice Simulator\Dice\four.png")
dice_pic= ImageTk.PhotoImage(pilimage)
labelphoto= Label(root,image=dice_pic)
labelphoto.place(x=270,y=70,)
print("4")
if result == "5":
pilimage=Image.open(r"C:\Users\amrik\Desktop\Dice Simulator\Dice\five.png")
dice_pic= ImageTk.PhotoImage(pilimage)
labelphoto= Label(root,image=dice_pic)
labelphoto.place(x=270,y=70,)
print("5")
if result == "6":
pilimage=Image.open(r"C:\Users\amrik\Desktop\Dice Simulator\Dice\six.png")
dice_pic= ImageTk.PhotoImage(pilimage)
labelphoto= Label(root,image=dice_pic)
labelphoto.place(x=270,y=70,)
print("6")```
and if those lines are put
you'll just have to send the folder to someone
and itll automatically work
no the whole code
or wait
ill just take the one i sent you
yeah, i will send the whole folder
but before
can u show me a pic of the folder
or
is it
roll.py
assets folder --------- pic1.png
pic2.png
pic3.png
pic4.png
pic5.png
pic6.png
is it like this ^^^
ok it's that
hm
one.png
k
yeah