-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTEST.py
53 lines (27 loc) · 789 Bytes
/
TEST.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""Funksjoner for testing av applikasjon"""
import os
import psutil
import math
import mast
import matplotlib.pyplot as plt
def memory_info():
process = psutil.Process(os.getpid())
return process.memory_info().rss/10**6
def print_memory_info():
print()
print("************************")
print("Minnebruk: {} MB".format(memory_info()))
print("************************")
print()
if __name__ == "__main__":
from tkinter import *
root = Tk()
sv = StringVar()
def callback():
print(sv.get())
return False
e = Entry(root, textvariable=sv, validate="focusout", validatecommand=callback)
e.grid()
e = Entry(root)
e.grid()
root.mainloop()