C# のコードを読む機会があったので、調べたことを記録しておく。
MS の日本語ドキュメントは機械翻訳なので時々意味不明。英語で読んだ方がいいかも?
#!/usr/bin/env python3 | |
""" | |
zip ファイル内に含まれる特定の CSV ファイルを明示して読み取る例 | |
""" | |
import argparse | |
import csv | |
import io | |
import zipfile |
#!/usr/bin/env python3 | |
import argparse | |
import logging | |
from pathlib import Path | |
import boto3 | |
logger = logging.getLogger(__name__) |
#!/usr/bin/env python3 | |
import logging | |
import socket | |
import struct | |
import time | |
logger = logging.getLogger(__name__) | |
logging.basicConfig(level=logging.INFO, format="[%(levelname)s] %(message)s") | |
s = socket.socket(socket.AF_INET6) | |
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) |
class ItemOrdering: | |
regular_items = { | |
'爪': 10, | |
'心臓': 20, | |
'逆鱗': 30, | |
'根': 40, | |
} | |
# TODO 実際にはここは動的に設定することになるだろう | |
event_items = { | |
'チップ': 10010, |
% python ./manage.py shell | |
Python 3.7.6 (default, Dec 19 2019, 17:29:22) | |
[GCC 7.4.0] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
(InteractiveConsole) | |
>>> from django.db import models | |
>>> | |
>>> class FooChoices(models.TextChoices): | |
... Apple = 'A', 'りんご' | |
... Banana = 'B', 'バナナ' |
#!/usr/bin/env python3 | |
""" | |
概要 | |
""" | |
import argparse | |
import logging | |
logging.basicConfig(level=logging.INFO) |
FROM centos:7 | |
ARG PYTHON_VERSION=3.6.4 | |
ARG BUILD_DIR=/usr/local/src | |
RUN yum -y update && \ | |
yum -y install vim wget xz make gcc zlib-devel bzip2 bzip2-devel \ | |
xz-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel \ | |
libffi-devel ncurses-devel gdbm-devel | |
WORKDIR ${BUILD_DIR} |