Skip to content

Instantly share code, notes, and snippets.

Avatar
🕴️
designing rs3

Johannes-Maria Frank jmfrank63

🕴️
designing rs3
View GitHub Profile
@jmfrank63
jmfrank63 / utime2str.py
Last active Aug 14, 2018
Unixtime to printable string
View utime2str.py
import datetime
utime = '1534256362'
strdate = datetime.datetime.fromtimestamp(
int(utime)
).strftime('%Y-%m-%d %H:%M:%S')
print(strdate)
@jmfrank63
jmfrank63 / adeque.py
Created Aug 6, 2018
Async deque in python
View adeque.py
# -*- 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