You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some constant values are being used across multiple parts of the application. A good example is the size of an entry in our UI .
5
-
If we wouldn't have this Consts.py file, every time we will want to change the size of an entry, we will need to do it in more than 10 different places.
6
-
a good practice is to define such constans once inside a file, and consume it from your different application parts
4
+
Some constant values are being used across multiple parts of the application.
5
+
A good example is the size of an entry in our UI.
6
+
If we wouldn't have this Consts.py file,
7
+
every time we will want to change the size of an entry,
8
+
we will need to do it in more than 10 different places.
9
+
a good practice is to define such constants once inside a file,
10
+
and consume it from your different application parts
def_cleanErrorMessage(): # We could have been doing this without a function, but it is more neat that way
61
60
Error.set("")
62
61
63
-
64
62
def_getReport():
65
63
# the _ notation before a function means that this function is internal to the class only. As python cannot really prevent you from using it outside the class (as C# for example) the notation is being used to warn other developers not to call this function outside the class
66
64
try:
67
-
_cleanErrorMessage() # Starting with cleaning the error message bar
65
+
_cleanErrorMessage() # Starting with cleaning the error message bar
68
66
ifnotipEntry.get():
69
67
errMessage='Please enter an IP address'
70
68
print(errMessage)
@@ -76,12 +74,9 @@ def _getReport():
76
74
print(response)
77
75
Country.set(response["country"])
78
76
Owner.set(response["as_owner"])
79
-
numberOfDetectedUrls.set(len(response["detected_urls"])) # len helps us count the amount of items inside the list
77
+
numberOfDetectedUrls.set(len(response["detected_urls"])) # len helps us count the amount of items inside the list
ttk.Label(self.mainVTURLframe, text="URL:").grid(column=0, row=0, sticky='W') #What does sticky does? Sticky sayes where to stick the label to : N,S,E,W
ttk.Label(self.mainVTURLframe, text="URL:").grid(column=0, row=0, sticky='W') #What does sticky does? Sticky sayes where to stick the label to : N,S,E,W
def_cleanErrorMessage(): # We could have been doing this without a function, but it is more neat that way
47
46
Error.set("")
48
47
49
-
50
48
def_getReport():
51
49
# the _ notation before a function means that this function is internal to the class only. As python cannot really prevent you from using it outside the class (as C# for example) the notation is being used to warn other developers not to call this function outside the class
52
50
try:
53
-
_cleanErrorMessage() # Starting with cleaning the error message bar
51
+
_cleanErrorMessage() # Starting with cleaning the error message bar
0 commit comments