Autosave: 2024-11-04 14:07:03

This commit is contained in:
thomasabishop 2024-11-04 14:07:03 +00:00
parent 2f3489d897
commit f280a9b52b
760 changed files with 645 additions and 71 deletions

View file

@ -28,7 +28,10 @@
body blockquote {
border-left-width: 3px !important;
border-left-color: #458588 !important;
background-color: #f2e5bc !important;
}
.headerFont,
.ui.header,
body h1,
@ -37,20 +40,284 @@
h4,
h5,
h6 {
font-family: "IBM Plex Sans Condensed" !important;
font-family: "IBM Plex Sans" !important;
}
body p {
line-height: 1.4;
/* line-height: 1.3; */
}
.monoFont,
body code,
pre,
tt {
font-family: "IBM Plex Mono" !important;
font-size: 12px !important;
line-height: 1.4 !important;
/* line-height: 1.3 !important; */
}
img[alt~="not-by-ai-badge"] {
width: 100px;
}
#neuron-nav-bar {
background-color: #458588;
}
#neuron-nav-bar a.right {
display: none;
}
.ui .center img {
display: none;
}
body {
background-color: #ebdbb2 !important;
color: #282828;
}
.zettel-view article.zettel-content {
background-color: #f9f5d7 !important;
}
a,
body span.zettel-link-container span.zettel-link a,
body .deemphasized:not(:hover) a {
color: #458588 !important;
}
.deemphasized:not(:hover) a {
color: #458588 !important;
}
body .zettel-content h1#title-h1 {
background-color: #458588;
color: #f9f5d7;
}
.ui.raised.raised.segment,
.ui.raised.raised.segments {
box-shadow: none;
}
.ui.raised.attached.segment.zettel-content {
border: none;
}
#neuron-backlinks-pane,
#neuron-tags-pane {
background-color: #3c3836;
border: none;
}
#neuron-backlinks-pane h3.ui.header,
#neuron-backlinks-pane p,
#neuron-backlinks-pane > ul > li > ul > li > div {
color: #ebdbb2 !important;
}
#neuron-backlinks-pane ul li::marker {
color: #ebdbb2 !important;
}
#neuron-backlinks-pane > ul > li > ul > li > div > p > a,
#neuron-backlinks-pane ul li span.zettel-link a {
color: #83a598 !important;
}
body .deemphasized:not(:hover),
body .deemphasized:hover {
opacity: 1;
}
#neuron-nav-bar {
border-radius: 0;
}
.ui.basic.label.zettel-tag {
background-color: #458588;
border-radius: 0;
border: none;
color: #f9f5c7;
}
body div.zettel-view .zettel-content p code,
li code,
ol code {
padding: 0;
font-size: 13px !important;
background: transparent;
}
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
.ui table {
background-color: #f9f5d7 !important;
border-radius: 0 !important;
border-color: #3c3836 !important;
}
.ui.table > thead > tr > th {
background-color: #3c3836 !important;
border-radius: 0 !important;
color: #f9f5d7 !important;
}
body span.zettel-link-container.errors {
border-color: #cc241d;
}
body span.zettel-link-container.errors span.zettel-link a {
color: #cc241d !important;
}
body span.zettel-link-container.errors span.zettel-link a:hover {
background-color: #fb483460 !important;
}
/**
* Gruvbox light theme
*
* Based on Gruvbox: https://github.com/morhetz/gruvbox
* Adapted from PrismJS gruvbox-dark theme: https://github.com/schnerring/prism-themes/blob/master/themes/prism-gruvbox-dark.css
*
* @author Michael Schnerring (https://schnerring.net)
* @version 1.0
*/
code[class*="language-"],
pre[class*="language-"] {
color: #3c3836; /* fg1 / fg */
font-family: Consolas, Monaco, "Andale Mono", monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
color: #282828; /* fg0 */
background: #fbf1c7; /* bg4 */
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
color: #282828; /* fg0 */
background: #fbf1c7; /* bg4 */
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: 0.5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f9f5d7; /* bg4 */
border: 1px solid #a89984;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: 0.1em;
border-radius: 0.3em;
}
.token.comment,
.token.prolog,
.token.cdata {
color: #7c6f64; /* fg4 / gray1 */
}
.token.delimiter,
.token.boolean,
.token.keyword,
.token.selector,
.token.important,
.token.atrule {
color: #9d0006; /* red2 */
}
.token.operator,
.token.punctuation,
.token.attr-name {
color: #7c6f64; /* fg4 / gray1 */
background: transparent;
}
.token.tag,
.token.tag .punctuation,
.token.doctype,
.token.builtin {
color: #b57614; /* yellow2 */
}
.token.entity,
.token.number,
.token.symbol {
color: #8f3f71; /* purple2 */
}
.token.property,
.token.constant,
.token.variable {
color: #9d0006; /* red2 */
}
.token.string,
.token.char {
color: #797403; /* green2 */
}
.token.attr-value,
.token.attr-value .punctuation {
color: #7c6f64; /* fg4 / gray1 */
}
.token.url {
color: #797403; /* green2 */
text-decoration: underline;
}
.token.function {
color: #b57614; /* yellow2 */
}
.token.regex {
background: #797403; /* green2 */
}
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.inserted {
background: #7c6f64; /* fg4 / gray1 */
}
.token.deleted {
background: #9d0006; /* red2 */
}
</style>

View file

@ -1,56 +0,0 @@
<script
async=""
id="MathJax-script"
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
></script>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/themes/prism.min.css"
rel="stylesheet"
/><link rel="preconnect" href="https://fonts.googleapis.com" /><link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin
/><link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Serif:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/components/prism-core.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<style>
body .ui.container,
body ul {
font-family: "IBM Plex Sans" !important;
}
body h2,
body div.zettel-view .zettel-content h2 {
border-bottom: none !important;
}
body blockquote {
border-left-width: 3px !important;
}
.headerFont,
.ui.header,
body h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "IBM Plex Sans Condensed" !important;
}
body p {
line-height: 1.4;
}
.monoFont,
body code,
pre,
tt {
font-family: "IBM Plex Mono" !important;
font-size: 12px !important;
line-height: 1.4 !important;
}
img[alt~="not-by-ai-badge"] {
width: 100px;
}
</style>

View file

@ -16,6 +16,18 @@ tags: [python, OOP]
constructor. As long as they are defined in the constructor they are
accessible.
## Class properties
In contrast to other languages, you do not need to declare any properties you
wish to use in the class at the top before you can assign to them. This is true
whether you define them in the constructor or not.
Instead, you can create properties just by invoking `self.some_property_name` in
the course of your code and Python will create the variable implicitly.
For continuity with other languages you may however define them at the top of
the class if you wish.
## Basic syntax
```py
@ -82,8 +94,8 @@ class Person:
## Object references
When you log a class you get a reference to its hexadecimal
[memory](Memory.md) reference.
When you log a class you get a reference to its hexadecimal [memory](Memory.md)
reference.
```py
p1 = Person('John', 36)
@ -109,8 +121,7 @@ print(id(p2))
## Copying objects
The same principle that applies to
[copying functions](Functions_in_Python.md)
The same principle that applies to [copying functions](Functions_in_Python.md)
applies to copying objects created through classes: redeclaration results in a
duplicate entity. Thus changes to the duplicate will affect the original.

View file

@ -22,3 +22,12 @@ os.rename('original-file-name.txt', 'new-file-name.txt')
import os
os.remove('file-name.txt')
```
## Check file exists
```python
import os
file_exists = os.exists('/file/path')
```

View file

@ -0,0 +1,323 @@
<script
async=""
id="MathJax-script"
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
></script>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/themes/prism.min.css"
rel="stylesheet"
/><link rel="preconnect" href="https://fonts.googleapis.com" /><link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin
/><link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Serif:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/components/prism-core.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<style>
body .ui.container,
body ul {
font-family: "IBM Plex Sans" !important;
}
body h2,
body div.zettel-view .zettel-content h2 {
border-bottom: none !important;
}
body blockquote {
border-left-width: 3px !important;
border-left-color: #458588 !important;
background-color: #f2e5bc !important;
}
.headerFont,
.ui.header,
body h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "IBM Plex Sans" !important;
}
body p {
/* line-height: 1.3; */
}
.monoFont,
body code,
pre,
tt {
font-family: "IBM Plex Mono" !important;
font-size: 12px !important;
/* line-height: 1.3 !important; */
}
img[alt~="not-by-ai-badge"] {
width: 100px;
}
#neuron-nav-bar {
background-color: #458588;
}
#neuron-nav-bar a.right {
display: none;
}
.ui .center img {
display: none;
}
body {
background-color: #ebdbb2 !important;
color: #282828;
}
.zettel-view article.zettel-content {
background-color: #f9f5d7 !important;
}
a,
body span.zettel-link-container span.zettel-link a,
body .deemphasized:not(:hover) a {
color: #458588 !important;
}
.deemphasized:not(:hover) a {
color: #458588 !important;
}
body .zettel-content h1#title-h1 {
background-color: #458588;
color: #f9f5d7;
}
.ui.raised.raised.segment,
.ui.raised.raised.segments {
box-shadow: none;
}
.ui.raised.attached.segment.zettel-content {
border: none;
}
#neuron-backlinks-pane,
#neuron-tags-pane {
background-color: #3c3836;
border: none;
}
#neuron-backlinks-pane h3.ui.header,
#neuron-backlinks-pane p,
#neuron-backlinks-pane > ul > li > ul > li > div {
color: #ebdbb2 !important;
}
#neuron-backlinks-pane ul li::marker {
color: #ebdbb2 !important;
}
#neuron-backlinks-pane > ul > li > ul > li > div > p > a,
#neuron-backlinks-pane ul li span.zettel-link a {
color: #83a598 !important;
}
body .deemphasized:not(:hover),
body .deemphasized:hover {
opacity: 1;
}
#neuron-nav-bar {
border-radius: 0;
}
.ui.basic.label.zettel-tag {
background-color: #458588;
border-radius: 0;
border: none;
color: #f9f5c7;
}
body div.zettel-view .zettel-content p code,
li code,
ol code {
padding: 0;
font-size: 13px !important;
background: transparent;
}
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
.ui table {
background-color: #f9f5d7 !important;
border-radius: 0 !important;
border-color: #3c3836 !important;
}
.ui.table > thead > tr > th {
background-color: #3c3836 !important;
border-radius: 0 !important;
color: #f9f5d7 !important;
}
body span.zettel-link-container.errors {
border-color: #cc241d;
}
body span.zettel-link-container.errors span.zettel-link a {
color: #cc241d !important;
}
body span.zettel-link-container.errors span.zettel-link a:hover {
background-color: #fb483460 !important;
}
/**
* Gruvbox light theme
*
* Based on Gruvbox: https://github.com/morhetz/gruvbox
* Adapted from PrismJS gruvbox-dark theme: https://github.com/schnerring/prism-themes/blob/master/themes/prism-gruvbox-dark.css
*
* @author Michael Schnerring (https://schnerring.net)
* @version 1.0
*/
code[class*="language-"],
pre[class*="language-"] {
color: #3c3836; /* fg1 / fg */
font-family: Consolas, Monaco, "Andale Mono", monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
color: #282828; /* fg0 */
background: #fbf1c7; /* bg4 */
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
color: #282828; /* fg0 */
background: #fbf1c7; /* bg4 */
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: 0.5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f9f5d7; /* bg4 */
border: 1px solid #a89984;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: 0.1em;
border-radius: 0.3em;
}
.token.comment,
.token.prolog,
.token.cdata {
color: #7c6f64; /* fg4 / gray1 */
}
.token.delimiter,
.token.boolean,
.token.keyword,
.token.selector,
.token.important,
.token.atrule {
color: #9d0006; /* red2 */
}
.token.operator,
.token.punctuation,
.token.attr-name {
color: #7c6f64; /* fg4 / gray1 */
background: transparent;
}
.token.tag,
.token.tag .punctuation,
.token.doctype,
.token.builtin {
color: #b57614; /* yellow2 */
}
.token.entity,
.token.number,
.token.symbol {
color: #8f3f71; /* purple2 */
}
.token.property,
.token.constant,
.token.variable {
color: #9d0006; /* red2 */
}
.token.string,
.token.char {
color: #797403; /* green2 */
}
.token.attr-value,
.token.attr-value .punctuation {
color: #7c6f64; /* fg4 / gray1 */
}
.token.url {
color: #797403; /* green2 */
text-decoration: underline;
}
.token.function {
color: #b57614; /* yellow2 */
}
.token.regex {
background: #797403; /* green2 */
}
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.inserted {
background: #7c6f64; /* fg4 / gray1 */
}
.token.deleted {
background: #9d0006; /* red2 */
}
</style>

View file

@ -13,20 +13,20 @@ computer science.
![not-by-ai-badge](static/not-by-ai-alternative--light.svg)
**Build ID:** 3e9c8244-6ff9-4b0e-85f5-e82db8665849
**Build ID:** cd6bdaba-031a-4daf-adf2-ef3b075243e6
**Published:** Fri 01 Nov 2024 16:51:34
**Published:** Mon 04 Nov 2024 14:07:02
### Recent edits
- [[Classes_in_Python]]
- [[File_operations_in_Python]]
- [[Lists_in_Python]]
- [[Dictionaries_in_Python]]
- [[Bell_System]]
- [[Bolt_Beranek_and_Newman]]
- [[4da22434_from_ARPANET_to_Internet]]
- [[3f1b9fe5_motivation_Berners_Lee]]
- [[4a3dc316_key_figures_ARPANET]]
- [[82f9c228_dissolution_of_ARPANET]]
### All notes (481)

View file

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View file

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 145 KiB

View file

Before

Width:  |  Height:  |  Size: 289 KiB

After

Width:  |  Height:  |  Size: 289 KiB

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

Before

Width:  |  Height:  |  Size: 6.9 MiB

After

Width:  |  Height:  |  Size: 6.9 MiB

View file

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 224 KiB

View file

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View file

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View file

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View file

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View file

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 204 KiB

View file

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View file

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 165 KiB

View file

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 133 KiB

View file

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View file

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View file

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 4 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View file

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View file

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View file

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View file

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View file

Before

Width:  |  Height:  |  Size: 470 KiB

After

Width:  |  Height:  |  Size: 470 KiB

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View file

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

View file

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View file

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View file

Before

Width:  |  Height:  |  Size: 848 KiB

After

Width:  |  Height:  |  Size: 848 KiB

View file

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 194 KiB

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View file

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

View file

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 171 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View file

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

View file

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View file

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View file

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 157 KiB

View file

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View file

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 153 KiB

View file

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View file

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 87 KiB

View file

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View file

Before

Width:  |  Height:  |  Size: 414 KiB

After

Width:  |  Height:  |  Size: 414 KiB

View file

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View file

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 167 KiB

After

Width:  |  Height:  |  Size: 167 KiB

View file

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 150 KiB

View file

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 140 KiB

View file

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 190 KiB

View file

Before

Width:  |  Height:  |  Size: 374 KiB

After

Width:  |  Height:  |  Size: 374 KiB

View file

Before

Width:  |  Height:  |  Size: 9 KiB

After

Width:  |  Height:  |  Size: 9 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View file

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View file

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

View file

Before

Width:  |  Height:  |  Size: 668 KiB

After

Width:  |  Height:  |  Size: 668 KiB

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View file

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View file

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View file

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View file

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View file

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View file

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View file

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View file

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View file

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View file

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 146 KiB

View file

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View file

@ -16,6 +16,18 @@ tags: [python, OOP]
constructor. As long as they are defined in the constructor they are
accessible.
## Class properties
In contrast to other languages, you do not need to declare any properties you
wish to use in the class at the top before you can assign to them. This is true
whether you define them in the constructor or not.
Instead, you can create properties just by invoking `self.some_property_name` in
the course of your code and Python will create the variable implicitly.
For continuity with other languages you may however define them at the top of
the class if you wish.
## Basic syntax
```py
@ -82,8 +94,8 @@ class Person:
## Object references
When you log a class you get a reference to its hexadecimal
[memory](Memory.md) reference.
When you log a class you get a reference to its hexadecimal [memory](Memory.md)
reference.
```py
p1 = Person('John', 36)
@ -109,8 +121,7 @@ print(id(p2))
## Copying objects
The same principle that applies to
[copying functions](Functions_in_Python.md)
The same principle that applies to [copying functions](Functions_in_Python.md)
applies to copying objects created through classes: redeclaration results in a
duplicate entity. Thus changes to the duplicate will affect the original.

View file

@ -22,3 +22,12 @@ os.rename('original-file-name.txt', 'new-file-name.txt')
import os
os.remove('file-name.txt')
```
## Check file exists
```python
import os
file_exists = os.exists('/file/path')
```