from dataclasses import dataclass, field
@dataclass
class iSort:
imports: str = field(default=None)
def _imports(self):
imports = self.imports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http.server | |
import socketserver | |
import webbrowser | |
import os | |
os.chdir('/') | |
Handler = http.server.SimpleHTTPRequestHandler | |
httpd = socketserver.TCPServer(("", 0), Handler) | |
port = httpd.server_address[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File Transfer for Pythonista | |
# ============================ | |
# This script allows you to transfer Python files from | |
# and to Pythonista via local Wifi. | |
# It starts a basic HTTP server that you can access | |
# as a web page from your browser. | |
# When you upload a file that already exists, it is | |
# renamed automatically. | |
# From Pythonista's settings, you can add this script | |
# to the actions menu of the editor for quick access. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML Entity GLYPH NAME | |
 Apple | |
⌘ ⌘ Command, Cmd, Clover, (formerly) Apple | |
⌃ ⌃ Control, Ctl, Ctrl | |
⌥ ⌥ Option, Opt, (Windows) Alt | |
⇧ ⇧ Shift | |
⇪ ⇪ Caps lock | |
⏏ ⏏ Eject | |
↩ ↩ Return, Carriage Return | |
↵ ↵ ↵ Return, Carriage Return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Docker Machine Version: 0.12.0, build 45c69ad | |
Found binary path at /usr/local/bin/docker-machine | |
Launching plugin server for driver amazonec2 | |
Plugin server listening at address 127.0.0.1:63494 | |
() Calling .GetVersion | |
Using API Version 1 | |
() Calling .SetConfigRaw | |
() Calling .GetMachineName | |
(flag-lookup) Calling .GetMachineName | |
(flag-lookup) Calling .DriverName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
import json | |
p = Path() # assuming .json files are located in the current working directory | |
data = [json.loads(line) for file in p.glob('*.json') for line in file.read_text().splitlines()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from fractions import Fraction | |
from itertools import product | |
import statistics | |
import random | |
import logging | |
from matplotlib import pyplot as plt, style | |
logging.basicConfig(level=logging.DEBUG) |
title | author | date |
---|---|---|
assignment expression use case |
Zachary Wilson |
2022-09-01 |
Nicknamed the Walrus Operator for its resemblance to the face of a Walrus: :=
, the [Assignment Expression][assignment_expression] allows one to assign a value to a variable if and only if it returns a result.
Since its inception, the [Assignment Expression][assignment_expression] has been a highly debated topic within the PSF.