摘要: 1 a, b = 3, 4 2 c, d = 3, 4 3 4 a, b = b, a + b 5 c = d 6 d = c + d 7 print(a, b, c, d) 输出: 4 7 4 8 因为a, b和b, a + b都是元祖(tuple) 先计算(b, a + b)的元祖为(4, 7) 阅读全文
posted @ 2017-10-02 14:55 CodingIsBeautiful 阅读(1449) 评论(0) 推荐(0) 编辑
摘要: 一、int函数能够 一、int函数能够 (1)把符合数学格式的数字型字符串转换成整数 (2)把浮点数转换成整数,但是只是简单的取整,而非四舍五入。 1 aa = int("124") #Correct 2 print "aa = ", aa #result=124 3 bb = int(123.45 阅读全文
posted @ 2017-09-29 19:06 CodingIsBeautiful 阅读(1205) 评论(0) 推荐(0) 编辑
摘要: 参考:https://wrf.ecse.rpi.edu//Research/Short_Notes/pnpoly.html 在GIS(地理信息管理系统)中,判断一个坐标是否在多边形内部是个经常要遇到的问题。乍听起来还挺复杂。根据W. Randolph Franklin 提出的PNPoly算法,只需区 阅读全文
posted @ 2017-09-23 16:16 CodingIsBeautiful 阅读(56522) 评论(8) 推荐(15) 编辑
摘要: 1。大数据量的list,要进行局部元素删除,尽量避免用del随机删除,非常影响性能,如果删除量很大,不如直接新建list,然后用下面的方法释放清空旧list。 2。对于一般性数据量超大的list,快速清空释放内存,可直接用 a = [] 来释放。其中a为list。 3。对于作为函数参数的list,用 阅读全文
posted @ 2017-09-23 14:17 CodingIsBeautiful 阅读(4175) 评论(0) 推荐(0) 编辑
摘要: Git分支管理的基本操作 首先从远端版本库clone下来一个全新的库: git clone username@xxx:/xxx/xxx.git 此时clone下来的,只是master分支,没有其他分支。 查看分支: git branch #查看本地分支 git branch -r #查看远端分支 g 阅读全文
posted @ 2017-09-22 12:19 CodingIsBeautiful 阅读(362) 评论(0) 推荐(0) 编辑
摘要: Flask 解析 前端 数组 阅读全文
posted @ 2017-08-22 22:00 CodingIsBeautiful 阅读(2438) 评论(0) 推荐(0) 编辑