2013年10月21日

Python Cookbook学习记录 ch1_2_2013/10/21

摘要: 1.2 字符和字符值之间的转换a.ASCII码之间的转换ord获得字符对应的ASCII码,chr根据ASCII码获得字符>>> print chr(100)d>>> print ord('d')100unichr可以将Unicode码转成Unicode字符>>> print ord(u'H')72>>> print unichr(72)H讨论:chr和str的区别:chr是将整数转成ASCII码对应的字符,str是将所有输入转成文本形式的字符串>>> print chr(1 阅读全文

posted @ 2013-10-21 22:27 七海之风 阅读(167) 评论(0) 推荐(0)

2013年10月20日

Python Cookbook学习记录 ch1_1_2013/10/20

摘要: 1.1 每次处理一个字符a. list方法将字符串转成列表>>> thestring = 'Helloworld'>>> thelist = list(thestring)>>> print thelist['H', 'e', 'l', 'l', 'o', 'w', 'o', 'r', 'l', 'd']b.使用for循环完成字符串遍历>>> the 阅读全文

posted @ 2013-10-20 15:44 七海之风 阅读(138) 评论(0) 推荐(0)

すべての始まり~~开始学习Python Cookbook

摘要: 已经自学完了Python的基础知识,下一步研究一下大名鼎鼎的Python Cookbook。将在这里记录学习上的点点滴滴。 阅读全文

posted @ 2013-10-20 12:03 七海之风 阅读(102) 评论(0) 推荐(0)

导航