摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*- #根据数据文件在窗口中动态路径绘制 from turtle import * import turtle def main(): #设置窗口信息 turtle.title("数据驱动的动态路径绘制") turtle.setup(800, 600, 0, 0) #设置画... 阅读全文
posted @ 2017-11-14 15:44 hayden__wang 阅读(259) 评论(0) 推荐(0) 编辑
摘要: Turtle 库是自Python2.6开始的内嵌模块,是简单图形绘制模块。记录下学习过程 上图是官方文档对Turtle库的介绍目录,中文版地址:http://usyiyi.cn/translate/python_352/library/frameworks.html 。Turtle库是python的 阅读全文
posted @ 2017-11-14 15:19 hayden__wang 阅读(449) 评论(0) 推荐(0) 编辑
摘要: 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 #encode 编码 decode 解码 4 #GBK 编码: 全称是“《汉子内码扩展规范》” 双字节编码 5 s = "中文字符串" 6 bs = s.encode("utf-8") 7 cs = s.encode("GBK") 8 print("{} 的utf-8 编码是... 阅读全文
posted @ 2017-11-07 15:32 hayden__wang 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 1 #!/usr/bin/env python3 2 # -*- coding:utf-8 -*- 3 4 #01 函数的定义,调用 5 #生日歌 6 def happy(): 7 print("Happy birthday to you!") 8 9 def sing(person): 10 happy() 11 happy() 12 p... 阅读全文
posted @ 2017-11-06 13:37 hayden__wang 阅读(207) 评论(0) 推荐(0) 编辑
摘要: python调试 转载 https://www.ibm.com/developerworks/cn/linux/l-cn-pythondebugger/ 阅读全文
posted @ 2017-11-01 17:52 hayden__wang 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 1. 错误&异常概述 获取BaseException 2. Try except 语法详解 代码示例: 阅读全文
posted @ 2017-11-01 16:14 hayden__wang 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 1 #!/usr/bin/env python3 2 # -*- coding: utf-8 -*- 3 4 #01 温度转换 5 while True: 6 val = input("请输入带温度表示符号的温度值(例如:32C): ") 7 if val[-1] in ['C','c']: 8 f = 1.8 * float(val[0:-1]... 阅读全文
posted @ 2017-10-27 11:26 hayden__wang 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 1 #!/usr/bin/env python3 2 # -*- coding: utf-8 -*- 3 #01 字符串拼接 4 str1 = input("请输入一个人的名字:") 5 str2 = input("请输入一个国家的名字: ") 6 print("世界这么大,{}想去{}看看。".format(str1,str2)) #{} .format 7 8 #02 整数... 阅读全文
posted @ 2017-10-26 14:37 hayden__wang 阅读(454) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-10-24 15:28 hayden__wang 阅读(3) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-10-24 15:18 hayden__wang 阅读(3) 评论(0) 推荐(0) 编辑