最近公司让把几个python srcript的打包成EXE,查了一些资料,完成打包,总结一下:
1.安装py2exe插件
2. 新建一个setup.py 文件,文件内包含以下的代码
#!/usr/bin/python
# -*- coding: utf-8 -*-
# py2exe file
# 1.install py2exe application
# 2.python setup.py py2exe
from distutils.core import setup
import py2exe
includes = ["Action","CryptoUtil", "Phone" , ...
转换字符集 为unicode字符集:unicode(shortname,“原字符集”,'ignore')
#得到文件的字符集
def detectCharset(file):
fileCharSet = "GBK"
detector = UniversalDetector()
for line in open(file):
detector.feed(line)
if detector.done: break
detector.close()
if detector.result.has_key("encoding") ...
最近做python,下面是一段测试数据库性能的代码。
数据库表记录:1000000条。
开200个线程,100个同时并发。
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import os.path
import re
import MySQLdb
import httplib, mimetypes
import traceback
import logging
import ConfigParser
import time
import threading
import str ...
- 浏览: 17176 次
- 性别:

- 来自: 北京

- 详细资料
搜索本博客
我的相册
DSC01762
共 1 张
共 1 张
最新评论
-
经常看《程序员》杂志的进 ...
我更爱看《非程序员》,可惜没得看了
-- by nighthawk -
经常看《程序员》杂志的进 ...
对于我这样的初学者感觉没什么用,很杂很没方向感。
-- by wangyifeng -
JSF中文教程
正好需要 感谢咯
-- by cainwise -
经常看《程序员》杂志的进 ...
蹲厕所的时候看
-- by 温柔一刀 -
经常看《程序员》杂志的进 ...
睡觉之前看一看
-- by javaboy2006






评论排行榜