05 2011 档案
《Python核心编程》第二版第160页第六章练习 续五 -Python核心编程答案-自己做的-
摘要:(b)代码如下,另外一种做法,逆序查找:def rfindchr(string, char): a = string index = -1 k = len(a) for i in a[::-1]: k = k - 1 if i == char: index = k print index break if index == -1: print 'index = ', index a = raw_input('Please input a string ... ')b = raw_input('Please input a character to be 阅读全文
posted @ 2011-05-31 12:25 balian 阅读(767) 评论(1) 推荐(0)
《Python核心编程》第二版第160页第六章练习 续四 -Python核心编程答案-自己做的-
摘要:6-11.转换。(a)创建一个从整型到IP地址的转换,如下格式:www.xxx.yyy.zzz。(b)更新你的程序,使之可以逆转换。【答案】(a)代码如下:Input_number = abs(int(raw_input('Please input a number ...')))x3 = x2 = x1 = x0 = 0x3 = Input_number / (256 ** 3)if x3 > 255: tmp = x3 x3 = 255else: tmp = x3x2 = (Input_number - 256 ** 3 * tmp) / (256 ** 2)x1 = 阅读全文
posted @ 2011-05-30 19:34 balian 阅读(886) 评论(2) 推荐(0)
Eclipse风格下载
摘要:【推荐】下面是我搜到的IDE风格,用于Eclipse + PyDEVhttp://pydev.blogspot.com/2009/07/creating-dark-theme-and-exporting-and.htmlhttp://stackoverflow.com/questions/1685079/color-themes-for-eclipse-python-development http://marketplace.eclipse.org/content/eclipse-color-themehttp://www.hanselman.com/blog/VisualStudioPro 阅读全文
posted @ 2011-05-28 12:40 balian 阅读(499) 评论(1) 推荐(0)