Name | Usage(MiB) | Description |
---|---|---|
python | 37 | 启动 |
mpv | 37 | import + init |
requests | 10 | import |
beautifulsoup | 6 | import |
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
# gevent from the ground up - demo 1 | |
import selectors | |
import socket | |
import time | |
from urllib.parse import urlparse | |
sel = selectors.DefaultSelector() |
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
((python-mode | |
;; 激活 pyvenv-mode,也可以自己在 init.el 中默认激活 | |
(eval . (pyvenv-mode)) | |
;; 这个要写绝对路径 | |
(pyvenv-activate . "/Users/cosven/projectpath/.venv") | |
;; 默认 select python-pylint 这个 checker | |
;; |
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
from PyQt5.QtWidgets import * | |
from PyQt5.QtCore import * | |
from PyQt5.QtGui import * | |
class Model(QAbstractTableModel): | |
def __init__(self): | |
super().__init__() | |
self._data = ['miao', 'hello', 'world'] |
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 asyncio | |
from functools import partial | |
from slacker import Slacker | |
__alias__ = 'Slack 状态同步' | |
__version__ = '0.1' | |
__desc__ = 'Slack 状态同步' | |
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 os | |
import signal | |
import socket | |
import sys | |
import time | |
def be_a_worker(sock): | |
"""将当前进程变成一个 worker |
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 os | |
import re | |
from collections import defaultdict | |
def get_query_per_sec(line): | |
""" | |
>>> s = 'queries: 17493427 (58309.95 per sec.)' | |
>>> get_query_per_sec(s) |
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
# -*- mode: Python; -*- | |
# vi: ft=python | |
import os | |
# 自定义配置 | |
# config.THEME = 'dark' | |
config.COLLECTIONS_DIR = '~/Dropbox/public/music' | |
config.AUDIO_SELECT_POLICY = '>>>' |
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
{ | |
"Working Directory" : "\/Users\/yinshaowen", | |
"Prompt Before Closing 2" : false, | |
"Selected Text Color" : { | |
"Green Component" : "0", | |
"Red Component" : "0", | |
"Blue Component" : "0" | |
}, | |
"Rows" : 2, | |
"Ansi 11 Color" : { |
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
#!/usr/bin/env python3 | |
import re | |
def get_key_value(key, line): | |
"""get key's value in log line""" | |
p = re.compile(r'\[{}\='.format(key)) | |
m = p.search(line) | |
if m is None: |