2008-05-06

python script 打包EXE例子

关键字: py2exe
最近公司让把几个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" , ...
2008-01-31

python 知识小结

关键字: python
转换字符集 为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") ...
2007-10-31

python 模拟线程并发

关键字: python
最近做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 ...
88958620
搜索本博客
我的相册
121e6bfe-bb49-46f4-9736-fbe3789ec49e-thumb
DSC01762
共 1 张
存档
最新评论