摘要: MoveTo和MoveBy可以使精灵移动,区别在于MoveTo是移动到给定的坐标点;而MoveBy是从当前坐标点移动给定的坐标点这么多的距离。举个例子,假定精灵当前的坐标点是(x, y),分别给MoveTo和MoveBy指定一个坐标点(x1, y1),那么MoveTo和MoveBy最终的效果分别如下 阅读全文
posted @ 2019-11-18 16:48 流星曳尾 阅读(1021) 评论(0) 推荐(0) 编辑
摘要: let 声明变量用于块级作用域中 阅读全文
posted @ 2019-10-23 15:39 流星曳尾 阅读(82) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python# -*- coding:utf-8 -*- import osimport json file = open('a.txt','w')for root,dirs,files in os.walk('./'): file.write('root:' + root + 阅读全文
posted @ 2019-10-16 17:09 流星曳尾 阅读(113) 评论(0) 推荐(0) 编辑
摘要: https://www.runoob.com/python/python-json.html 阅读全文
posted @ 2019-10-16 16:33 流星曳尾 阅读(139) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python# -*- coding:utf-8 -*- import os os.system('cocos jscompile -s ./dir1 -d ./dir2') 阅读全文
posted @ 2019-10-16 13:45 流星曳尾 阅读(1834) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python# -*- coding:utf-8 -*- import shutil #shutil.copy(文件1,文件2)#将源内容复制到目标文件中。d.txt不存在则创建,存在则复制内容到d.txt 如不对文件重命名则文件2改为文件2的上级目录 例:shutil.cop 阅读全文
posted @ 2019-10-16 11:21 流星曳尾 阅读(1227) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python# -*- coding:utf-8 -*- import os import shutil os.remove(path) #删除文件shutil.rmtree(path) #删除文件夹及其子 可为'./dir' 也可'dir' 阅读全文
posted @ 2019-10-15 17:35 流星曳尾 阅读(1290) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python# -*- coding:utf-8 -*- import os fileName1 = 'a.txt'if os.path.exists(fileName1): file1 = open(fileName1,'w') file1.write('file1 exis 阅读全文
posted @ 2019-10-15 16:37 流星曳尾 阅读(200) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python# -*- coding:utf-8 -*- #!/usr/bin/python# -*- coding:utf-8 -*- file1 = open('a.txt','r')str = file1.read()file2 = open('b.txt','w')fi 阅读全文
posted @ 2019-10-15 15:58 流星曳尾 阅读(85) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python# -*- coding:utf-8 -*- open('a.txt','w+') 阅读全文
posted @ 2019-10-15 15:54 流星曳尾 阅读(162) 评论(0) 推荐(0) 编辑