会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
孙瓜瓜
新随笔
管理
2018年8月26日
python,day3:python目录操作 / enumerate / 集合set / zip拉链 / map / 迭代器iter
摘要: python下的目录操作: import os os.getcwd() #获取当前路劲 os.chdir(r’路径’) #进入某个目录下 f = open (‘test.txt’,’w’,encoding=’utf8’) #创建文件 os.makedirs(r’path\new_folder’) #
阅读全文
posted @ 2018-08-26 21:49 月半月半儿瓜
阅读(277)
评论(0)
推荐(0)
2018年8月19日
python,day2:文件处理/列表/元组/字典
摘要: 1.文件处理(i/o处理) 在python2里用file,在python3里用open w没有创建/有就覆盖 r 阅读 a 追加 创建文件 f = file(‘myfile.txt’,’w’) f = write(“hello world!”) f.close 遍历文件内容 a = file(‘us
阅读全文
posted @ 2018-08-19 16:53 月半月半儿瓜
阅读(114)
评论(0)
推荐(0)
2018年7月16日
python.day1:赋值 / 格式化输出 / 逻辑判断 / 循环
摘要: 声明字符集: #一般2.x版本使用 # -*- coding:utf-8 -*- 赋值: Name = input("Name:")Age = int(input("Age:"))print(type(Age),type(str(Age))) # 格式化转换 Job = input("job:")S
阅读全文
posted @ 2018-07-16 10:18 月半月半儿瓜
阅读(165)
评论(0)
推荐(0)