pyinstaller xxxx.py --onedir --onefile --noconsole --clean
--onedir
or-D
- 出力を1ディレクトリにまとめる
$ nkf -Se -Lu --in-place /path/to/file
TERM環境変数をcygwin
にすればちゃんと表示できる
$ TERM=cygwin lv /path/to/file
alias 設定しておいたらいい感じ
alias lv='TERM=cygwin lv'
$ cocot -t UTF-8 -p EUC-JP -- ssh xxx@xxxx
いつも忘れるのでメモ
$ cygstart .
$ ls -ltr | tail -n 3
using System; | |
using CommandLine; | |
namespace CommandLineArg | |
{ | |
class Program | |
{ | |
public class Options | |
{ | |
// shortnameで短いオプション名。(-v)longnameで長いオプション名を指定できる。(--versioninfo) |
""" | |
asyncio のサンプルです。 | |
asyncio.Queueを使った producer-consumer パターンのサンプル。 | |
""" | |
import asyncio | |
import contextlib | |
import itertools | |
import random | |
import asyncio | |
async def factorial(id: int, number: int): | |
f = 1 | |
for i in range(2, number + 1): | |
print(f'[{id}]: compute {i} ...') | |
await asyncio.sleep(1) | |
f *= i | |
print(f'[{id}]: factorial {number} = {f}') |
# ------------------------------------------------ | |
# イベントループを別スレッドで動作させて | |
# メインスレッドは生かすサンプル | |
# | |
# asyncio をつかった処理にて、別スレッドから | |
# イベントスレッドに対して処理を行う場合 | |
# イベントスレッド自体がスレッドセーフではないため | |
# 専用のメソッドを利用する必要がある | |
# | |
# - ev_loop.call_soon_threadsafe() |