Python Forum
[Tkinter] optimalization of code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] optimalization of code
#5
(Aug-07-2019, 05:42 AM)Yoriz Wrote: If you want access by row and column make a list of lists
https://python-forum.io/Thread-Basic-Lists Wrote:Matrices
You can represent matrices (in C: multidimensional arrays) with lists also, by nesting lists inside of lists.
>>> matrix = [[1,2,3], [4,5,6], [7,8,9]]
>>> matrix
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
>>> matrix[0]
[1, 2, 3]
>>> matrix[0][0]
1
>>> matrix[-1]
[7, 8, 9]
>>> matrix[-1][0]
7

yes is different option: how to store data, but biggest problem is in disabled and normal status- i focus on that. - how to make in nice easy way than that:
   def confirm(self):
        s[:] = [1 if v.get() else 0 for v in self.checkvars]
 
        if s[0] == 1:
            s[5]=0
            self.chk11.config(state=DISABLED)
        if s[0] == 0:
            self.chk11.config(state=NORMAL)
Reply


Messages In This Thread
optimalization of code - by storzo - Aug-06-2019, 10:07 PM
RE: optimalization of code - by Yoriz - Aug-07-2019, 05:18 AM
RE: optimalization of code - by storzo - Aug-07-2019, 05:35 AM
RE: optimalization of code - by Yoriz - Aug-07-2019, 05:42 AM
RE: optimalization of code - by storzo - Aug-07-2019, 05:50 AM
RE: optimalization of code - by storzo - Aug-07-2019, 07:15 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020