-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelements.py
More file actions
28 lines (23 loc) · 926 Bytes
/
elements.py
File metadata and controls
28 lines (23 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from tkinter import *
import tkinter as tk
from tkinter import ttk
from datetime import datetime
class cbutton:
def __init__(self, master, image, background,command):
self.master=master
self.background = background
self.image = image
self.relief = "flat"
self.command = command
def create(self):
self.btn = tk.Button(self.master, image=self.image,
background = self.background,
relief=self.relief,
highlightthickness=0,
border=0,command=self.command)
return self.btn
def clear_frame(frame_base):
for widgets in frame_base.winfo_children():
widgets.destroy()
def sort_by_date(data):
return sorted(data, key=lambda x: datetime.strptime(x[1], '%d/%m/%Y'))