随笔分类 -  [python]

How to process number for different number type: float, decimal, int...
摘要:1. install python, set environment variables. 2. pip install selenium 3. 下载与自己浏览器版本匹配的chrome webdriver, 放到python.exe同目录(python安装目录)。 http://npm.taobao 阅读全文
posted @ 2020-06-04 13:01 buptqq 阅读(2839) 评论(3) 推荐(1)
摘要:#获取当前时间的时间戳(%m/%d/%Y %H:%M:%S.ms), 时间部分,毫秒部分def get_cur_timestamp(): ct = time.time() utc_ct = time.gmtime(ct) date_head = str(time.strftime("%m/%d/%Y 阅读全文
posted @ 2020-05-13 14:23 buptqq 阅读(130) 评论(0) 推荐(0)
摘要:#将float类型转化成有固定总位数的数值。 from decimal import * getcontext().prec=5 Decimal('107.23')/Decimal('0.9726') a=str(Decimal('107.23')/Decimal('0.9726')) 阅读全文
posted @ 2020-05-11 17:07 buptqq 阅读(501) 评论(0) 推荐(0)