python
Bridge_go
这个作者很懒,什么都没留下…
展开
-
python学习记录——修饰符
1.函数修饰符(@) @与其说是修饰不如说其是引用 def use(f): def test(): print('this is use test') f() return test @use def usetest(): print('Hello') usetest() # 输出: # this is use test # Hello 类似于如下应用: def use(f): print('this is use test原创 2022-03-28 14:38:59 · 995 阅读 · 0 评论 -
python学习记录——日期和时间
时间间隔是以秒为单位的浮点小数。每个时间戳都以自从1970 年 1 月 1 日午夜(历元)经过了多长时间来表示。 import time ticks = time.time() print (f"当前时间戳为:{ticks}秒") # 当前时间戳为: 1649243762.6342976秒 时间戳单位最适于做日期运算。但是1970年之前的日期就无法以此表示了。太遥远的如期也不行,UNIX和Windows只支持到2038年。 很多python函数用一个9个数字的元组来处理时间,对应这struct_原创 2022-04-06 19:43:44 · 327 阅读 · 0 评论