From 06ec17c5e65d03ffd14a60ce89fe71234eb81c8a Mon Sep 17 00:00:00 2001 From: jwansek Date: Mon, 17 Jan 2022 19:47:01 +0000 Subject: added getting class inheritance tree, getting method args nicely, fixed bug with importing too many modules --- ExampleSubmission/example.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ExampleSubmission/example.py') diff --git a/ExampleSubmission/example.py b/ExampleSubmission/example.py index b64c98d..a226adb 100644 --- a/ExampleSubmission/example.py +++ b/ExampleSubmission/example.py @@ -1,3 +1,6 @@ +# Eden Attenborough +# 12-01-21 + import tkinter as tk class Application(tk.Tk): @@ -8,7 +11,7 @@ class Application(tk.Tk): self.title("Hello World!") - def a_method_with_defaults(self, arg_1 = "hello", arg_2 = "world"): + def a_method_with_defaults(self, n:str, arg_1 = "hello", arg_2 = "world", count:int = 3): """Adds two strings together with a space between them. Args: @@ -32,6 +35,7 @@ class Application(tk.Tk): """ return num1 + num2 +# hello world! def hello_world(times): """Prints 'hello world!' to stdout. Prints it out `times` times. @@ -46,6 +50,11 @@ def hello_world(times): def an_undocumented_function(): return 3.14156 +# kwonlyargs demo +def greet(*names, greeting="Hello"): + for name in names: + print(greeting, name) + if __name__ == "__main__": app = Application() app.mainloop() \ No newline at end of file -- cgit v1.2.3