MicroPython stuff
This commit is contained in:
13
code/MicroPython/read_write_file.py
Normal file
13
code/MicroPython/read_write_file.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import os
|
||||
|
||||
print('Listing filesystem...')
|
||||
print(os.listdir(), '\n')
|
||||
|
||||
print('Write data...')
|
||||
with open('data.txt', 'w') as f:
|
||||
count = f.write('ololo\n')
|
||||
print('Write', count, 'bytes')
|
||||
|
||||
print('Read data...')
|
||||
with open('data.txt', 'r') as f:
|
||||
print('Data:', f.read())
|
||||
Reference in New Issue
Block a user