This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
utime = '1534256362' | |
strdate = datetime.datetime.fromtimestamp( | |
int(utime) | |
).strftime('%Y-%m-%d %H:%M:%S') | |
print(strdate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
class AsyncDeque(deque): | |
def __init__(self, elements): | |
super().__init__(elements) | |
def __aiter__(self): | |
return self | |
async def __anext__(self): | |
if not self: | |
raise StopAsyncIteration |