Replies: 1 comment 1 reply
-
@Onir123 Your source codes are too long to get the problem quickly. Could you please have sample reproducible code for the same? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on a system where appointments can be scheduled. Each appointment is represented on the screen as a canvas rectangle, which contains the client's first and last name. I store the appointment information in my database, and when I access a specific date in my calendar, the system creates all the appointments scheduled for that date.
My problem is the following: I use a for loop to iterate through a list that I retrieve from my database based on the date, and I create the appointments one by one as I go through the list. However, when I have a lot of appointments scheduled on a given day, it takes a very long time to load that day—approximately 16 seconds. I tried applying multithreading to divide the creation of each appointment into separate threads, but it didn’t work.
im using customtkinter and sql.
im running the script in vscode
my python version is Python 3.11.9
my CustomTkinter version is 5.2.2
this its my code to appointments load https://dpaste.org/fKzeC
This is my code for the object that represents the quote (The colored rectangles that are in the clip)https://dpaste.org/85PPK
i measured the time, and the problem is when it creates the canvas object, it takes tkinter 0.18 seconds to create each appointment, and as it creates one by one until the for loop is completed, it does not load on the screen.
https://www.flexclip.com/es/share/7932873597ca78f2e4a1e4e2cc949088ce2150b.html
in this clip you can see the problem. To load a day with 80 or 90 appointments takes 16 seconds. Ma
Beta Was this translation helpful? Give feedback.
All reactions