标签:镜像 项目 opera 命令行 引入 stat parent 多个 虚拟环境
pip < command > [options] | |
command 命令 | 说明 |
install | install packages |
download | Download packages |
uninstall | Uninstall packages |
freeze | Output installed packages in requirements format |
from datetime import datetime
now = datetime.now()
print(now)
from datetime import datetime
now = datetime.now()
print(now)
from datetime import datetime
now = datetime.now()
dt = datetime(2018,6,6,12,12) # 用指定日期时间创建datetime
print(now)
print(dt)
from datetime import datetime
now = datetime.now()
dt = datetime(2018,6,6,12,12) # 用指定日期时间创建datetime
print(now)
print(dt)
from datetime import datetime
now = datetime.now()
dt = datetime(2018,6,6,12,12) # 用指定日期时间创建datetime
print(now)
print(dt)
print(dt.timestamp())
from datetime import datetime
now = datetime.now()
dt = datetime(2018,6,6,12,12) # 用指定日期时间创建datetime
print(now)
print(dt)
print(dt.timestamp())
from datetime import datetime
now = datetime.now()
dt = datetime(2018,6,6,12,12) # 用指定日期时间创建datetime
print(now)
print(dt)
print(dt.timestamp())
from datetime import datetime
now = datetime.now()
dt = datetime(2018,6,6,12,12) # 用指定日期时间创建datetime
print(now)
print(dt)
print(dt.timestamp())
datee_test = datetime.strptime(‘2018-06-19 13:15:00‘, ‘%Y-%m-%d %H:%M:%S‘)
print(datee_test)
datee_test = datetime.strptime(‘2018-06-19 13:15:00‘, ‘%Y-%m-%d %H:%M:%S‘)
print(datee_test)
now.strftime(‘%a, %b %d %H:%M‘)
now.strftime(‘%a, %b %d %H:%M‘)
now = datetime.now()
datetime.datetime(2018, 6, 19, 14, 42, 36, 664596)
now + timedelta(hours=10)
now - timedelta(days=10)
now + timedelta(days=12, hours=23)
now = datetime.now()
datetime.datetime(2018, 6, 19, 14, 42, 36, 664596)
now + timedelta(hours=10)
now - timedelta(days=10)
now + timedelta(days=12, hours=23)
import json
dict_test = { "01":"张三","02":"李四"}
# 将 字符串、数字、字典等数据序列化为标准的字符串( str )格式
json.dumps("Python") # 字符串
json.dumps(15.78) # 数字
json.dumps(dict_test) # 字典
import json
dict_test = { "01":"张三","02":"李四"}
# 将 字符串、数字、字典等数据序列化为标准的字符串( str )格式
json.dumps("Python") # 字符串
json.dumps(15.78) # 数字
json.dumps(dict_test) # 字典
import json
dict_test = { "01":"张三","02":"李四"}
# 将 字符串、数字、字典等数据序列化为标准的字符串( str )格式
json.dumps("Python") # 字符串
json.dumps(15.78) # 数字
json.dumps(dict_test) # 字典
# 使用 dump 方法将字典数据 dict_test 保存到 F 盘根目录下的 json_test.json文件中。
with open("F:\\json_test.json","w", encoding=‘utf-8‘) as file_test:
json.dump(dict_test,file_test,indent=5)
import json
dict_test = { "01":"张三","02":"李四"}
# 将 字符串、数字、字典等数据序列化为标准的字符串( str )格式
json.dumps("Python") # 字符串
json.dumps(15.78) # 数字
json.dumps(dict_test) # 字典
# 使用 dump 方法将字典数据 dict_test 保存到 F 盘根目录下的 json_test.json文件中。
with open("F:\\json_test.json","w", encoding=‘utf-8‘) as file_test:
json.dump(dict_test,file_test,indent=5)
import json
# 使用 loads 和 load
teacher_info = json.loads(‘{"teacher_name":"Mr.Liu","teacher_age":24}‘)
print(teacher_info)
with open("F:\\json_test.json","r",encoding="utf-8") as file_test:
test_loads = json.loads(file_test.read())
file_test.seek(0)
test_load = json.load(file_test) # json.loads( file_test.read())
print(test_loads)
print(test_load)
import json
# 使用 loads 和 load
teacher_info = json.loads(‘{"teacher_name":"Mr.Liu","teacher_age":24}‘)
print(teacher_info)
with open("F:\\json_test.json","r",encoding="utf-8") as file_test:
test_loads = json.loads(file_test.read())
file_test.seek(0)
test_load = json.load(file_test) # json.loads( file_test.read())
print(test_loads)
print(test_load)
Successfully built MarkupSafe
Installing collected packages: MarkupSafe, jinja2, rpy2
Successfully installed MarkupSafe-1.0 jinja2-2.10 rpy2-2.9.4
Successfully built MarkupSafe
Installing collected packages: MarkupSafe, jinja2, rpy2
Successfully installed MarkupSafe-1.0 jinja2-2.10 rpy2-2.9.4
R object with classes: (‘numeric‘,) mapped to:
<FloatVector - Python:0x06ADCE68 / R:0x08BBE9D8>
[3.141593]
R object with classes: (‘numeric‘,) mapped to:
<FloatVector - Python:0x06ADCE68 / R:0x08BBE9D8>
[3.141593]
from rpy2.robjects.packgages import importr
base = importr("base")
stats = importr("stats")
stats.rnorm(12)
from rpy2.robjects.packgages import importr
base = importr("base")
stats = importr("stats")
stats.rnorm(12)
标签:镜像 项目 opera 命令行 引入 stat parent 多个 虚拟环境
原文地址:https://www.cnblogs.com/long90/p/12299924.html