摘要:
#coding:utf-8importos,reforiinos.walk('d:'+os.sep):fortxtini[2]:try:txt=re.match(r'(.*)(\.txt)',txt).group(0)printos.path.join(i[0],txt)except:pass
阅读全文
posted @ 2013-12-20 17:43
jackyshan
阅读(659)
推荐(0)
摘要:
#!/bin/env python# -*- encoding: utf-8 -*-import datetimeimport timeimport osimport sysimport xlwt #需要的模块import refrom xlutils.copy import copyimport xlrddef txt2xls(filename,xlsname): #文本转换成xls的函数,filename 表示一个要被转换的txt文本,xlsname 表示转换后的文件名 print 'converting xls ... ' #m = re.split('\.
阅读全文
posted @ 2013-11-20 11:26
jackyshan
阅读(1519)
推荐(0)
摘要:
for i in range(101,110): n = repr(i) + '.txt' file = open('c:\\ip\\' + n, 'w')
阅读全文
posted @ 2013-11-04 15:03
jackyshan
阅读(231)
推荐(0)
摘要:
# -*- coding: utf-8 -*-import pygamefrom sys import exitimport randompygame.init()screen = pygame.display.set_mode((450, 600), 0, 32)background = pygame.image.load("back.jpg").convert()plane = pygame.image.load("plane.png").convert_alpha()pygame.display.set_icon(plane)pygame.disp
阅读全文
posted @ 2013-10-28 17:11
jackyshan
阅读(439)
推荐(1)
摘要:
# -*- coding: utf-8 -*-import pygamefrom sys import exitimport randompygame.init()screen = pygame.display.set_mode((450, 600), 0, 32)background = pygame.image.load("back.jpg").convert()plane = pygame.image.load("plane.png").convert_alpha()pygame.display.set_icon(plane)pygame.disp
阅读全文
posted @ 2013-10-24 22:44
jackyshan
阅读(1056)
推荐(1)
摘要:
1 import urllib2 2 3 class SimpleCookieHandler(urllib2.BaseHandler): 4 def http_request(self, req): 5 simple_cookie = 'PHPSESSID=fcf3c469c3c80f3e8480aca76c87faa;ocKey=c9821225458886fa8329cccc283e60e;wy_uid=b52fOIbsG%2BB6kyNmyU9esuL%2FRb8GTatlM4n5ghw7dP4;wy_pwd=f770PcQrsQ2YyEUO07ouNVJxM...
阅读全文
posted @ 2013-10-18 13:54
jackyshan
阅读(1111)
推荐(0)
摘要:
#!/usr/bin/python# -*- coding: utf-8 -*-"""Function: Used to demostrate how to use Python code to emulate login baidu main page: http://www.baidu.com/Note: Before try to understand following code, firstly, please read the related articles: (1)【整理】关于抓取网页,分析网页内容,模拟登陆网站的逻辑/流程和注意事项htt...
阅读全文
posted @ 2013-10-18 13:51
jackyshan
阅读(1590)
推荐(1)