Python mini Hack-a-thon Conference 2023-06-17 https://pyhack.connpass.com/event/282942/
100回を記念して、3年3ヶ月前に開催予定だった Python mini Hack-a-thon Conference での発表のために、 自分と Python と Python mini Hack-a-thon に関連した年表を作成した。
| import io | |
| import zipfile | |
| # Create and extract zip file example | |
| # to file | |
| with zipfile.ZipFile("test.zip", 'w') as z: | |
| z.writestr('aaa/bbb/1.txt', b'aaa') | |
| z.writestr('aaa/ccc/2.txt', b'ccc') | |
| z.writestr('aaa/ccc/3.bin', b'\x00\x01\x02') |
| import tkinter | |
| root = tkinter.Tk() | |
| root.geometry("600x400") | |
| canvas = tkinter.Canvas(root, width=600, height=400, bg="white") | |
| canvas.pack() | |
| def event_handler(event): | |
| print(event) | |
| if event.type == tkinter.EventType.ButtonRelease: |
| #!/usr/bin/env python | |
| # Copyright (c) Twisted Matrix Laboratories. | |
| # See LICENSE for details. | |
| """ | |
| An example of using Twisted with Tkinter. | |
| Displays a frame with buttons that responds to mouse clicks. |
| import pathlib | |
| from typing import List | |
| from PIL import Image | |
| import streamlit as st | |
| from tensorflow import keras | |
| @st.cache_data | |
| def download() -> str: |
Python mini Hack-a-thon Conference 2023-06-17 https://pyhack.connpass.com/event/282942/
100回を記念して、3年3ヶ月前に開催予定だった Python mini Hack-a-thon Conference での発表のために、 自分と Python と Python mini Hack-a-thon に関連した年表を作成した。
| # Pelican https://pypi.org/project/pelican/ plugin that adjusts markdown | |
| # YAML front matter created by Netlify CMS https://www.netlifycms.org/ et al. | |
| # to be handled correctly as metadata in pelican. | |
| # This plugin requires PyYAML https://pypi.org/project/PyYAML/ . | |
| import io | |
| import datetime | |
| import yaml | |
| from pelican import signals | |
| from markdown import Markdown |
| import sys | |
| import os | |
| import json | |
| import http.client | |
| from urllib.parse import urlencode | |
| # Computer Vision API | |
| # https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/ |
| #!/usr/bin/env python | |
| ################################################################################ | |
| # MIT License | |
| # | |
| # Copyright (c) 2021 Hajime Nakagami | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| import hashlib | |
| import binascii | |
| def hmac_sha256_digest(key, msg): | |
| pad_key = key + b'\x00' * (64 - (len(key) % 64)) | |
| ik = bytes([0x36 ^ b for b in pad_key]) | |
| ok = bytes([0x5c ^ b for b in pad_key]) | |
| return hashlib.sha256(ok + hashlib.sha256(ik+msg).digest()).digest() |