From 29199b2c1b4d16ed16956d930c3eca389b9103f7 Mon Sep 17 00:00:00 2001 From: nic Date: Tue, 5 Nov 2024 14:04:08 -0500 Subject: Auto from nzxt - Tue 05 Nov 2024 02:04:08 PM EST --- Technology/Python.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Technology') diff --git a/Technology/Python.md b/Technology/Python.md index 265abf3..3d3fdf3 100644 --- a/Technology/Python.md +++ b/Technology/Python.md @@ -23,7 +23,6 @@ with no arg show you all name in global namespace dir() == sorted(globals().keys()) -local namespace gloabls() == locals() super() - goes trought inheritance chain and return the class that is after the one passed as the function first argument. Can by used to bypass modification made by earlier classes. @@ -51,9 +50,13 @@ importlib if want to reload modules so run more than once When importing a module you can use it's defined functions, classes, constants etc... Access those thing by putting the module name as prefix before the function +import XX import XX as x from XX import x -from XX import * from XX import x as x when you run a modules as a script __ name__ becomes __ main__ + + +__ init__.py - required to tell python dir is a pkg (initialise a pkg) +used to set the __ all__ variable & import submodules -- cgit v1.2.3