摘要: 1、mymodel.py 1 #!/usr/bin/python 2 3 #Filename:mymode.py 4 5 version = '1.0' 6 7 def sayHello(): 8 9 print("Hello world") 10 11 12 13 def modelName(): 阅读全文
posted @ 2016-12-15 11:17 一罐热茶 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 资料: http://www.2cto.com/kf/201312/268555.html http://www.2cto.com/kf/201505/397354.html 1、查看关键字 2、判断、循环 if elif else for while break continue and or i 阅读全文
posted @ 2016-12-07 11:30 一罐热茶 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 出处:http://www.cnblogs.com/snake-hand/archive/2013/06/16/3138866.html 1、函数内部的变量名如果第一次出现,且出现在=前面,即被视为定义一个局部变量,不管全局域中有没有用到该变量名,函数中使用的将是局部变量,例如: 1 num = 1 阅读全文
posted @ 2016-12-02 11:48 一罐热茶 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 出处: http://bbs.csdn.net/topics/320265093 http://www.cnblogs.com/xuxm2007/archive/2010/08/04/1792463.html 1、if __name__ == '__main__': 函数() 一般来说python写 阅读全文
posted @ 2016-12-02 11:06 一罐热茶 阅读(1077) 评论(0) 推荐(0) 编辑
摘要: 资料来源:http://www.runoob.com/python/python-operators.html#ysf5 1、位运算符 转换成二进制一位一位运算 1 a = 60 # 60 = 0011 1100 2 b = 13 # 13 = 0000 1101 3 c = 0 4 5 c = a 阅读全文
posted @ 2016-11-30 20:06 一罐热茶 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 资料来源: http://www.runoob.com/python/python-operators.html#ysf5 1、逻辑运算符"与、或、非" 在Java、C中使用"&、||、!",在Python中使用"and,or,not" 优先级 not > and = or 1 #True和Fals 阅读全文
posted @ 2016-11-30 17:35 一罐热茶 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 1、一个十分简单的日语五十音字母查询程序 2、简单的程序但是调试了很久,把功能删到最简还是会出错,最后发现是Python的逻辑运算符是使用"and,or,not" 3、程序代码如下,想改成二维数组的直接查询 1 input_row = '请输入查询字母所在行:' 2 input_col = '请输入 阅读全文
posted @ 2016-11-30 16:37 一罐热茶 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 原博客地址 1、代码 1 #pythonz中的字符串可以用单引号''和双引号""标示 2 strA = 'This is string A' 3 strB = "This is string B" 4 print('strA = ' + strA) 5 print('strB = ' + strB) 阅读全文
posted @ 2016-11-29 23:26 一罐热茶 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 出处: Hongten的博客 Vamei的博客 1、for循环 GUI中的代码: 1 #基本的for循环语句 2 test_list = [2,4.4,'Liu','A',"B",'HelloPy',"Today"] 3 #打印列表的长度 4 print(len(test_list)) 5 for 阅读全文
posted @ 2016-11-29 12:29 一罐热茶 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 原博客地址 1、新建一个 .py文件,如test_hello.py; 2、右键,Edit with IDLE(即Python GUI) 3、编写代码 hello = "hello" print(hello) ##################################### test_lis 阅读全文
posted @ 2016-11-29 11:39 一罐热茶 阅读(446) 评论(0) 推荐(0) 编辑