mirror of
https://github.com/licsber/micropython.git
synced 2024-09-21 01:20:23 +08:00
6 lines
114 B
Python
6 lines
114 B
Python
# construct a bytes object from a generator
|
|
def gen():
|
|
for i in range(4):
|
|
yield i
|
|
print(bytes(gen()))
|