Python教程
Python教程:包含了所有代写案例以及部分答案
-
#!/usr/bin/env python #: coding: utf-8 import logging def initlogger(filename=None, fileformat=None, consoleformat=None): if not fileformat: fileformat = ‘%(asctime)s %(name)-12s %(levelname)-8s %(message)s’ if not consoleformat: consoleformat = ‘%(n … 继续阅读“python 自定义logging”
:
-
#include <boost/python.hpp> #include <boost/python/module.hpp> #include <boost/python/def.hpp> #include <boost/python/to_python_converter.hpp> #include using namespace std; using namespace boost::python; namespace HelloPython{ … 继续阅读“Python 调用 C++”
:
-
#!usr/bin/env python #coding=utf-8 print ‘ **********************************************’ print ‘ * THIS IS A GAME *’ print ‘ * BY TZC *’ print ‘ * Sorry ,Waiting three minutes please! *’ print ‘ **********************************************’ impor … 继续阅读“python 获取情敌电脑内照片神器”
:
-
mport urllib2 from BeautifulSoup import BeautifulSoup # get the proxy of = open(‘proxy.txt’, ‘w’) for page in range(1,50): url = ‘http://www.xicidaili.com/nn/%s’ %page user_agent = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, … 继续阅读“python爬虫-爬取代理IP并通过多线程快速验证”
:
-
#coding:utf-8 ”’ python图片处理 @author:fc_lamp @blog:http://fc-lamp.blog.163.com/ ”’ import Image as image #等比例压缩图片 def resizeImg(**args): args_key = {‘ori_img’:”,’dst_img’:”,’dst_w’:”,’dst_h’:”,’save_q’:75} arg = {} for key in args_key: if key in … 继续阅读“python(PIL)图像处理(等比例压缩、裁剪压缩) 缩略(水印)图”
:
-
通过正规表达式实现“`python ”’ a regex-based JavaScript code compression kludge ”’ import re class JSCompressor(object): def __init__(self, compressionLevel=2, measureCompression=False): ”’ compressionLevel: 0 – no compression, s … 继续阅读“python压缩javascript文件代码”
:
-
#-*- coding:cp936 -*- """ os.walk() 函数声明:walk(top,topdown=True,onerror=None) 1>参数top表示需要遍历的目录树的路径 2>参数topdown的默认值是"True",表示首先返回目录树下的文件,然后在遍历目录树的子目录.Topdown的值为"False"时, 则表示先遍历目录树的子目录,返回子目录下的文件,最后返回根目录下的文件 3> … 继续阅读“python 删除空文件和空文件夹”
:
-
# find the day of the week of a given date # Python will trap impossible dates like (1900, 2, 29) # tested with Python24 vegaseat 01aug2005 from datetime import date # a typical birthday year, month, day # or change it to your own birthday… birthda … 继续阅读“python显示生日是星期几”
: