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
# The SMTP server runs in a separate thread and stores sent messages in a list | |
# | |
# Usage: | |
# | |
# def test_fn(smtpd): | |
# host = smtpd.host | |
# port = smtpd.port | |
# | |
# # Run code that send email using an smtp server at host:port | |
# |
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
# -*- coding: utf-8 -*- | |
from shapely.geometry import LineString | |
from shapely import wkt | |
line = LineString([(0, 0, 5), (1, 1, 5)]) | |
# memo for 3D | |
wkt3D = line.wkt | |
# 2D |
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 zipfile | |
import sys | |
from pathlib import Path | |
def unzip(f, encoding, v): | |
with zipfile.ZipFile(f) as z: | |
for i in z.namelist(): | |
n = Path(i.encode('cp437').decode(encoding)) | |
if v: |