会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
NOV流雨
Powered by
博客园
博客园
|
首页
|
新随笔
|
联系
|
订阅
|
管理
2018年8月1日
json模块
摘要: import jsondic = '{"name":"alex"}' # >{"name":"alex"} >'{"name":"alex"}'i = 8 # >'8's = 'hello' # >"hello" >'"hello"'l = [11,22] # >"[11,22]"print(eva
阅读全文
posted @ 2018-08-01 22:27 NOV流雨
阅读(158)
评论(0)
推荐(0)
编辑
sys模块
摘要: import sys,timeprint(sys.platform) #返回操作系统平台名称print(sys.argv[1:]) #命令行参数List,第一个元素是程序本身路径command = sys.argv[1]path = sys.argv[2]if command == "***": p
阅读全文
posted @ 2018-08-01 22:20 NOV流雨
阅读(137)
评论(0)
推荐(0)
编辑
os模块
摘要: import osprint(os.getcwd()) #C:\Users\PJASUS\PycharmProjects\python_02\day22os.chdir("test1") #改变当前脚本工作目录print(os.getcwd()) #C:\Users\PJASUS\PycharmPr
阅读全文
posted @ 2018-08-01 16:17 NOV流雨
阅读(153)
评论(0)
推荐(0)
编辑
random模块
摘要: import random#得到一个随机数print(random.random()) #0.5419014838427241print(random.randint(1,3)) #2print(random.randrange(1,5)) #4print(random.choice([11,22,33])) #33print(random.sample([11,22,33,44,55]...
阅读全文
posted @ 2018-08-01 14:39 NOV流雨
阅读(110)
评论(0)
推荐(0)
编辑
time模块
摘要: import time#时间戳print(time.time())#结构化时间 当地时间print(time.localtime()) #1533102268.037611t = time.localtime() #time.struct_time(tm_year=2018, tm_mon=8, t
阅读全文
posted @ 2018-08-01 14:03 NOV流雨
阅读(135)
评论(0)
推荐(0)
编辑