摘要://初始化数据库连接::CoInitialize(NULL);连接数据库BOOL CLogin::ConnectDB(void){ HRESULT hr = NULL; try { hr = m_pConnection.CreateInstance("ADODB.Connection");///...
阅读全文
摘要:源码:import os,time,datetime,stringimport urllib2def chk_qq(qqnum): chkurl = 'http://wpa.qq.com/pa?p=1:'+`qqnum`+':1' #print(chkurl) a = urllib...
阅读全文
摘要:Question:The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes below two million.Code:import mathdef IsPrime(n): if n...
阅读全文
摘要:翻译+整理: By Bigworm 不当之处请指正这篇文章是根据H. Carvey的The Dark Side of NTFS (Microsoft’s Scarlet Letter)翻译的,可以自由转载,但请保持译者和来源以及文章的完整性. 简介:微软的平台不断在增加.公司用的服务器和桌面操作系...
阅读全文
摘要:Question:import refrom operator import mula = '7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858...
阅读全文
摘要:#################################################################################Question: ...
阅读全文
摘要:a = '1'for i in xrange(30): pos = 0 tmp = '' str_len = len(a) while pos < str_len: count = 1 while pos+1<str_len and a[pos] ...
阅读全文
摘要:题目链接:http://www.pythonchallenge.com/pc/return/good.htmlimport Image,ImageDrawim = Image.new('RGB', (500,500))draw = ImageDraw.Draw(im)first=[146,399,1...
阅读全文
摘要:题目:http://www.pythonchallenge.com/pc/def/integrity.html点击蜜蜂发现可以分登录,而网页源码中恰好有两行,像是加密了的用户名和密码,又发现字符串的前缀是bz2的,所以用bz2解压试试,结果不小心就出来了。import bz2un = 'BZh91A...
阅读全文
摘要:import Imageim = Image.open('oxygen.png')print ('image information:',im.format,im.size,im.mode)y_begin = 0while True: p = im.getpixel((0,y_begin)) i...
阅读全文
摘要:题目:http://www.pythonchallenge.com/pc/def/peak.html看到这个题目,标题"peak hell",下面写着"pronounce it",而且网页源码提示说这个“是不是很熟悉?”,我就在着急这个标题能读出个啥东西出来,由于python学的时间短,英语也不是很...
阅读全文
摘要:先贴代码吧。from urllib import *import reimport ossrc = urlopen(r'http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345')nexturl = Noneurl = r'...
阅读全文
摘要:题:http://www.pythonchallenge.com/pc/def/equality.html好吧,看完题目我只知道一个小写字母和两边的大保镖,然后就不知道该怎么下去了,我表示我还不习惯做这种题目。后来,看了别人的解释,才知道要从网页的源文件读取,坑爹坑到家了,我根本就没没往这方面想。然...
阅读全文
摘要:代码:from urllib import *src = urlopen(r'http://www.pythonchallenge.com/pc/def/ocr.html')for i in range(37): #排除前面没用的37行 text.readline()a = []str1 = ...
阅读全文
摘要:先贴代码:import stringstr = r"g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq ...
阅读全文
摘要:先贴代码吧!#!/usr/bin/env pythonimport ospreurl = r'http://www.pythonchallenge.com/pc/def/0.html'page = 2**38newurl = preurl.replace('0',str(page))os.start...
阅读全文
摘要:import randomdef qsort(L): if len(L)L[0]]))li = []for i in range(20): li.append(random.randrange(10,100))print(li)print(sorted(li))print(qsort(l...
阅读全文
摘要:+看书。import wxdef load(event): file = open(filename.GetValue()) contents.SetValue(file.read()) file.close() def save(event): file = open...
阅读全文
摘要:/*************************************************************测试获取文件所在的模块的方法,其中GetModuleHandle是获取exe的*句柄,而后两者还可以用来获取dll模块的句柄*By IT05*2012-8-6 16:24:27...
阅读全文