摘要: import os这些必须会 print(os.getcwd())#取当前工作目录# print(os.mkdir("test1")) # 创建文件夹# print(os.remove("../day4/5.png")) # 删除文件,不能删文件夹。# print(os.listdir('c://' 阅读全文
posted @ 2018-01-20 23:10 Flynn丶傅 阅读(161) 评论(0) 推荐(0) 编辑
摘要: import json#json串就是字符串。d = { 'car':{'color':'red','price':100,'count':50}, '挨粪叉':{'color':'red','price':100,'count':50}, '挨粪叉1':{'color':'red','price' 阅读全文
posted @ 2018-01-20 22:48 Flynn丶傅 阅读(194) 评论(0) 推荐(0) 编辑
摘要: #函数即变量# len type print input str# print(all([1, 2, 3, 4])) # 判断可迭代的对象里面的值是否都为真# print(any([0, 1, 2, 3, 4])) # 判断可迭代的对象里面的值是否有一个为真# print(bin(100)) # 十 阅读全文
posted @ 2018-01-20 21:30 Flynn丶傅 阅读(136) 评论(0) 推荐(0) 编辑
摘要: #函数 方法 功能#说白了函数就是把一堆代码组合到一起,变成一个整体#提高代码复用性#函数不调用不会被执行#全局变量、局部变量# def hello (file_name,content=''):#形参,形式参数# f = open(file_name,'a+',encoding='utf-8')# 阅读全文
posted @ 2018-01-20 15:53 Flynn丶傅 阅读(177) 评论(0) 推荐(0) 编辑