Skip to content

Instantly share code, notes, and snippets.

View 510908220's full-sized avatar
🎯
Focusing

westdoorblowcola 510908220

🎯
Focusing
View GitHub Profile
import requests
import os
import shutil
import json
BASE = os.path.dirname(__file__)
DATA_PATH = os.path.join(BASE,'data')
def _fetch(url):
name = url.split('/')[-1]
@510908220
510908220 / task
Last active August 27, 2016 13:35
# TASK
- [x] Pick the flowers
- [ ] Call John 9303032332
- [x] Cancel cable subscription
- [ ] Book the flight tickets
@510908220
510908220 / subprocess-bufsize-test.py
Last active January 30, 2023 04:15 — forked from jaypei/subprocess-bufsize-test.py
使用subprocess。避免在子程序大量输出时因buffer size满,导致父进程hang住。
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
from StringIO import StringIO
out = StringIO()
sp = subprocess.Popen(["python", "test_output.py"],
stdout=subprocess.PIPE,
@510908220
510908220 / QListWidget的item上实现右键菜单.md
Last active October 14, 2015 15:26
QListWidget的item上实现右键菜单
    void ListWidget::contextMenuEvent ( QContextMenuEvent * event )
    {
        QMenu* popMenu = new QMenu(this);
        popMenu->addAction(new QAction("添加", this));
        popMenu->addAction(new QAction("删除", this));
        if(this->itemAt(mapFromGlobal(QCursor::pos())) != NULL) //如果有item则添加"修改"菜单 [1]*
        {
            popMenu->addAction(new QAction("修改", this));

}