摘要: 一控制语句 http://blog.csdn.net/lynn_yan/article/details/5464911 if 语句二 字典详解 http://blog.csdn.net/moodytong/article/details/7647684 字典方法 http://ghostfromheaven.iteye.com/blog/1549441 字典遍历 http://5iqiong.blog.51cto.com/2999926/806230 字典遍历三 格式化 http://hi.baidu.com/xiaoyuandy/item/4517df384b116b99b80... 阅读全文
posted @ 2013-11-07 20:50 空城夕 阅读(160) 评论(0) 推荐(0) 编辑
摘要: import typesaaa = 0print type(aaa)if type(aaa) is types.IntType: print "the type of aaa is int"if isinstance(aaa,int): print "the type of aaa is int"bbb = 'hello'print type(bbb)if type(bbb) is types.StringType: print "the type of bbb is string"if isinstance(bbb, 阅读全文
posted @ 2013-11-07 20:49 空城夕 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 原因: 如果文件里有非ASCII字符,需要在第一行或第二行指定编码声明。解决办法:必须是在第一行或是第二行加入1)加上# -*- coding:utf-8 -*-之后就能成功使用中文注释了2)或者加上 # coding=utf-83)或者加上 #!/usr/bin/python # vim: set fileencoding=utf-8:备注:支持中文的格式有utf-8,gbk,gb2312 阅读全文
posted @ 2013-11-07 17:11 空城夕 阅读(359) 评论(0) 推荐(0) 编辑