Skip to content

Instantly share code, notes, and snippets.

View pylixm's full-sized avatar
:octocat:
工作中

DeanWu pylixm

:octocat:
工作中
View GitHub Profile
@pylixm
pylixm / pdf_pyqt.py
Created March 3, 2021 10:30
pdf_pyqt5.py
# read docs : https://www.learnpyqt.com/examples/python-pdf-report-generator/
from PyQt5.QtWidgets import QPushButton, QLineEdit, QApplication, QFormLayout, QWidget, QTextEdit, QMessageBox, QSpinBox
from PyQt5.QtCore import QObject, QRunnable, QThreadPool, pyqtSignal, pyqtSlot
from reportlab.pdfgen.canvas import Canvas
import os
import textwrap
from datetime import datetime
@pylixm
pylixm / tailer.py
Created August 14, 2019 07:11
tailer.py
# -*- coding:utf-8 -*-
"""
Tailer
Build Status
Python tail is a simple implementation of GNU tail and head.
It provides 3 main functions that can be performed on any file-like object that supports seek() and tell().
tail - read lines from the end of a file
head - read lines from the top of a file

Go编码规范指南

序言

看过很多方面的编码规范, 可能每一家公司都有不同的规范, 这份编码规范是写给我自己的, 同时希望我们公司内部同事也能遵循这个规范来写Go代码.

如果你的代码没有办法找到下面的规范, 那么就遵循标准库的规范, 多阅读标准库的源码, 标准库的代码可以说是我们写代码参考的标杆.

格式化规范

@pylixm
pylixm / SaltApi.py
Created May 31, 2019 10:38
SaltApi.py
#!/usr/bin/env python
import urllib, urllib2
import time
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
try:
import json
except ImportError:
@pylixm
pylixm / golang_workpool.go
Created April 16, 2019 06:04
golang 工作池实现
// http://www.cnblogs.com/hanyouchun/p/6369736.html
package main
import (
"fmt"
"time"
)
type Pool struct {
Queue chan func() error;
@pylixm
pylixm / api.py
Created April 21, 2017 05:55 — forked from alanhamlett/api.py
Serialize SQLAlchemy Model to dictionary (for JSON output) and update Model from dictionary attributes.
import uuid
import wtforms_json
from sqlalchemy import not_
from sqlalchemy.dialects.postgresql import UUID
from wtforms import Form
from wtforms.fields import FormField, FieldList
from wtforms.validators import Length
from flask import current_app as app
from flask import request, json, jsonify, abort