看过很多方面的编码规范, 可能每一家公司都有不同的规范, 这份编码规范是写给我自己的, 同时希望我们公司内部同事也能遵循这个规范来写Go代码.
如果你的代码没有办法找到下面的规范, 那么就遵循标准库的规范, 多阅读标准库的源码, 标准库的代码可以说是我们写代码参考的标杆.
| # 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 |
| # -*- 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 |
| #!/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: |
| // http://www.cnblogs.com/hanyouchun/p/6369736.html | |
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| type Pool struct { | |
| Queue chan func() error; |
| 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 |