很多公司都大量使用了python,其中有一些开发规范,code guidline, 通用组件,基础框架是可以共用的。
每个公司都自己搞一套, 太浪费人力,我想开一帖和大家讨论一下这些python基础设施的搭建。
原则是我们尽量不重新发明轮子,但开源组件这么多,也要有个挑选的过程和组合使用的过程,在这里讨论一下。
另一方面,有些开源组件虽然强大,但我们不能完全的驾驭它,或只使用其中很少的一部分,我们就可以考虑用python实现一个简单的轮子,可控性更强,最好不要超过300行代码。
###################################################################### | |
# CURRENT AWARE LOCAL DATETIME | |
###################################################################### | |
from datetime import datetime | |
from tzlocal import get_localzone | |
local_tz = get_localzone() | |
local_dt = datetime.now(local_tz) |
<?xml version="1.0" encoding="UTF-8"?><result><errorCode>0</errorCode><url>http://flash4.3mang.com/3m/1109/live/index.jsp</url><param>5505868fb804a12dab5bd3c843821f0797e6f3a0cd26c210972ab31df29811bc7848282eca90c7ddcec1fa9122a759fa1f58a133056fd1f7ec25ee0548de008449d62e3e20e84cbe579929eedc017ca5f58cef80685b440fb96e5ccede7d5845534e6bc5619af64a86ef3d1c877702b80155e1d2c152e201365bc35d6646cc2a9860e538bee5e8bef72d26a389e4d36ee4f2940b33585e22ff459ebbd628510299ee5b526b54c61932e8e2fc1d563238e222e9946d8d6a64e3bd870c2e6a9fb81f76681e2503c1533ac2d151236946e7e8a983b451dc75e3945ef65536c4fb83a24c93e07214dc6c636834745f3191c6de6efcbffc514cca3a444a7359a07c2bf8e13fdb663335da168b9d0415c9e0c4d16e67070b42c3477a8ab0555f6f36e20076ce9b489865c872e6478f8b76e9a0304a3f11a0ed9328239250d282e1cc86dc2e7e54d67ceaa6e7eb7a5f154e8d5ceabd4ba1e34aa92253f2a98a832755a31a69100417d02625441494b02a51e5ee43ce17bc863a6f84ba70442ea87c0e45bad1a54a355c52ef603ec4abb35bc1c5723bea5766f5378aa44f375dba7f26aeb4ae5b6b782f36fc21ab9acf58fdb9e4c1c89b59678e1b3c1546252ac9 |
import sys | |
def test1(): | |
try: | |
raise Exception("tessssssssssssst") | |
except Exception as e: | |
_e = e | |
def test2(): | |
print(_e) | |
return test2 |
<?php | |
/** | |
* Front to the WordPress application. This file doesn't do anything, but loads | |
* wp-blog-header.php which does and tells WordPress to load the theme. | |
* | |
* @package WordPress | |
*/ | |
/** | |
* Tells WordPress to load the WordPress theme and output it. |
#!/usr/bin/env python | |
# Convert files in Open Container Format from Traditional Chinese | |
# to Simplified Chinese. | |
import sys, os, zipfile, re, codecs, subprocess | |
from xml.dom import minidom | |
sys.stdout = codecs.getwriter('utf-8')(sys.stdout) | |
debug = True |