`
liseor
  • 浏览: 47176 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论
文章列表

python 线程控制类

class WorkManager(object): def __init__(self, work_num=1000,thread_num=2): self.work_queue = Queue.Queue() self.threads = [] self.__init_work_queue(work_num) self.__init_thread_pool(thread_num) #----初始化线程------------------------------------------------- ...

python sqlite类

#!/usr/bin/env python # -*- coding: utf-8 -*- import sqlite3 as sqlite import os.path as osp import sys class Sqli(object): conn = '' cursor = '' def __init__(self, dbname): try: self.conn = sqlite.connect(osp.abspath(dbname)) except Except ...
links = SoupStrainer('a') [tag for tag in BeautifulSoup(doc, parseOnlyThese=links)]  

wget 整站下载

以前知道  但是用的时候老是要忘记 现在摘抄一下 防止忘记wget -r -p -np -k http://www.gtk.org/tutorial/-r,  --recursive(递归)          specify recursive download.(指定递归下载)-k,  --convert-links(转换链接)      make links in downloaded HTML point to local files.(将下载的HTML页面中的链接转换为本地链接)-p,  --page-requisites(页面必需元素)    get all images, e ...
  http://hi.baidu.com/zjw0358/blog/item/aab19652ff3a4a080cf3e301.html 1)wxWidgets是一个比MFC优雅的库,TortoiseCVS用wxWidges而不用MFC,就是因为wxWidgets好用,而不是为了可以移植。 2)Python的面向对象脚本语言编程适合快速界面开发 3)Python在服务器端和客户端都非常有前途,可以形成一个统一的解决方案,这一点明显比Java有优势 4)Python桌面应用程序可以完全编译为本地代码,脱离Python运行环境,这一点比dotnet winforms都有优势 5) ...
1.安装基本依懒的包  yum install gcc gdbm-devel readline-devel ncurses-devel zlib-devel bzip2-devel sqlite-devel db4-devel openssl-devel tk-devel bluez-libs-devel 2.安装python 2.6.4  wget http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tgztar xvfz Python-2.6.4.tgzcd Python-2.6.4./configure --prefi ...
yum install python-devel libxslt-devel   1. 我的mysql是下载原码包自行编译安装到 /usr/local/mysql,在安装python的mysql模块时,执行安装命令会提示以下错误: installsh: line 1: mysql_config: command not foundTraceback (most recent call last):File “setup.py”, line 16, in ?metadata, options = get_config()File “/Users/farocco/MySQL-pytho ...

lnmp问题解决

  /bin/rm: cannot remove `libtoolT’: No such file or directory 解决方案   这时直接打开 configure,把 $RM “$cfgfile” 那行删除掉,重新再运行 ./configure 就可以了。网上所说的那些方法根本不管用,如: # aclocal# autoconf# automake# libtoolize –force 或者: # autoreconf –force –install# libtoolize –automake –force# automake –force –add-missing ...

操作lnmpa shell

  #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH # Check if user is root if [ $(id -u) != "0" ]; then echo "Error: You must be root to run this script, please use root to install lnmp" exit 1 fi clear echo &quo ...
127 #!/usr/bin/env python路径有问题   126错误是 project.py 没有执行权限 要chmod +x   ls -lah index.py head index.py  
ps aux|grep index.py killall -9 python   
查 mysql 里的 replace 函数   update `xxx` set `a` = replace(`a` , ‘要替换的‘ , ‘替换为的‘)  
#! /usr/bin/env python # Script to restart daily my wireless router # by Helio Loureiro import httplib import base64 import urllib import time from time import ctime user = "admin" passw = "password" host = "192.168.1.1" def GetAuth(user = "us ...
位置函数   from PyQt4.QtCore import * from PyQt4.QtGui import * import sys class Geometry(QDialog): def __init__(self,parent = None): super(Geometry,self).__init__(parent) self.labelx = QLabel("x: ") self.labely = QLa ...
#coding=gbk import os import re import urllib2 import smtplib import time from time import localtime,strftime #################参数设置###################### #邮箱用户名 username = "" #邮箱密码 password = "" #smtp服务器 mailserver = "" #smtp服务器端口 port = "25" ...
Global site tag (gtag.js) - Google Analytics