2021-01-28


一、random 模块,formate

:random() 方法返回随机生成的一个实数,它在[0,1)范围内。
execjs.get().name

#formate
>>>"{} {}".format("hello", "world")    # 不设置指定位置,按默认顺序
'hello world'
 
>>> "{0} {1}".format("hello", "world")  # 设置指定位置
'hello world'
 
>>> "{1} {0} {1}".format("hello", "world")  # 设置指定位置
'world hello world'

二、execjs

通过运行时环境运行js:

default = execjs.get()

default.eval(“1 + 2”)
结果:

[‘red’, ‘yellow’, ‘blue’]
js文件一般写在另一个文件中后续通过node.compile(open(’./filena’,encoding=‘utf-8’).read())来调用


三、时间戳

https://blog.youkuaiyun.com/BcXbHello/article/details/111060606
在这里插入图片描述

引用

https://blog.youkuaiyun.com/BcXbHello/article/details/111060606

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值