diff options
| author | nic <ra@afu.re> | 2024-11-05 14:04:08 -0500 |
|---|---|---|
| committer | nic <ra@afu.re> | 2024-11-05 14:04:08 -0500 |
| commit | 29199b2c1b4d16ed16956d930c3eca389b9103f7 (patch) | |
| tree | 0ab64534ff549cac728f4f94e4ccba3b39558baf /Technology/Python.md | |
| parent | 2e596863768890e7c0121e103231a6753febfa12 (diff) | |
Auto from nzxt - Tue 05 Nov 2024 02:04:08 PM EST
Diffstat (limited to 'Technology/Python.md')
| -rw-r--r-- | Technology/Python.md | 7 |
1 files changed, 5 insertions, 2 deletions
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 |
