03 2020 档案

python json模块,处理json文件的读写
摘要:>>> import json >>> a = "ion_params_00.json" >>> fp = open(a, "r") >>> content = fp.read() # 字符串 >>> test = json.loads(content) # 句柄 >>> test = json.l 阅读全文

posted @ 2020-03-12 11:35 庐州月光 阅读(486) 评论(0) 推荐(0) 编辑

python zip 绑定多个list
摘要:>>> a = [1, 2, 3] >>> b = [1, 2, 3] >>> zip(a,b) [(1, 1), (2, 2), (3, 3)] >>> zip(a,b,a) [(1, 1, 1), (2, 2, 2), (3, 3, 3)] >>> zip(a,b,a,b) [(1, 1, 1, 阅读全文

posted @ 2020-03-12 11:31 庐州月光 阅读(1443) 评论(0) 推荐(0) 编辑

python 字符串重复多次的技巧 *操作符
摘要:>>> print("*"*50)************************************************** 阅读全文

posted @ 2020-03-12 10:52 庐州月光 阅读(4309) 评论(0) 推荐(0) 编辑

python 刷新缓冲区,实时监测
摘要:sys.stdout.flush() sys.stderr.flush() 阅读全文

posted @ 2020-03-12 10:50 庐州月光 阅读(634) 评论(0) 推荐(0) 编辑

python os.getcwd 获取工作目录
摘要:>>> import os >>> print(os.getpid()) 26463 >>> print(os.getcwd()) /home/test 阅读全文

posted @ 2020-03-12 10:46 庐州月光 阅读(452) 评论(0) 推荐(0) 编辑

python datetime 获取时间
摘要:# 日期操作, date # 设置日期 >>> datetime.date(2020,3,13) datetime.date(2020, 3, 13) >>> datetime.date.today() datetime.date(2020, 3, 12) # 访问日期 >>> datetime.d 阅读全文

posted @ 2020-03-12 10:41 庐州月光 阅读(6737) 评论(0) 推荐(0) 编辑

python os.environ 读取和设置环境变量
摘要:>>> import os >>> os.environ.keys() ['LC_NUMERIC', 'GOPATH', 'GOROOT', 'GOBIN', 'LESSOPEN', 'SSH_CLIENT', 'LOGNAME', 'USER', 'HOME', 'LC_PAPER', 'PATH 阅读全文

posted @ 2020-03-12 10:00 庐州月光 阅读(18082) 评论(0) 推荐(0) 编辑

python sys获取系统常见变量
摘要:>>> import sys>>> print(sys.path)>>> print(sys.platform)linux2 >>> print(sys.executable)/usr/bin/python >>> print(sys.version)2.7.16 |Anaconda, Inc.| 阅读全文

posted @ 2020-03-12 09:43 庐州月光 阅读(440) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示