- そうだ! EuroPython 2011へ行こう
- EuroPython2013に参加しました
- EuroPython 2015参加レポートと、Sphinxに関する発表
- EuroPython 2018参加レポート
- ヨーロッパのPythonコミュニティと交流できる3日間「EuroPython 2019」参加レポート
- EuroPython 2022 Day 1注目セッションと渡航や現地のあれこれ
みんなのPython勉強会#98 - connpass で紹介した内容です。
"""file io using threads with trio | |
You should ideally use this one: https://trio.readthedocs.io/en/stable/reference-io.html#asynchronous-filesystem-i-o | |
""" | |
import trio | |
async def read_file(file_path): | |
# Read the file in a separate thread | |
def blocking_read(): |
[dependencies] | |
tokio = { version = "1", features = ["full"] } | |
warp = "0.3" | |
tokio-tungstenite = "0.15" |
""" | |
Trying cancellation on a single task. | |
This code snippet was created in response to a question about task cancellation | |
during the PyConTW 2023 talk. | |
$ python await_single_task_exceptions.py | |
""" | |
import asyncio | |
"""micropython webserver | |
$ micropython minimum_webserver_for_micropython.py | |
docker image: micropython/unix:latest | |
micropython uasyncio document (ja) | |
https://micropython-docs-ja.readthedocs.io/ja/latest/library/uasyncio.html | |
""" | |
import uasyncio as asyncio |
"""This code is for monitoring CPU usage. It performs 3 minutes of polling and 3 minutes of monitoring. | |
During the 3 minutes of polling, it acquires CPU usage every second and adds it to a list. | |
During the 3 minutes of monitoring, it acquires CPU usage every second and adds it to a list. | |
Finally, it calculates and displays the average value and median value. | |
$ pip install statistics psutil | |
$ python cpu_stats_by_asyncio.py | |
Average CPU usage: 9.531666666666666% | |
Median CPU usage: 7.75% | |
""" |
""" | |
Description: | |
This script enhances the Python interactive console (REPL) by introducing | |
a custom exception handling mechanism. It leverages the built-in InteractiveConsole | |
and InteractiveInterpreter classes and overrides the 'showtraceback' method | |
for personalized exception handling. This enables more flexible control over | |
how exceptions are dealt with in the console, and can be particularly useful for | |
debugging or for enhancing console output in specific applications. | |
""" | |
import sys |