Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions examples/featherwing_keyboard_featherwing.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@
kbd_featherwing.neopixel[0] = 0x002244

try:
f = open("/sd/tft_featherwing.txt", "w")
f = open( # pylint: disable=unspecified-encoding,consider-using-with
"/sd/tft_featherwing.txt", "w"
)
f.write("Blinka\nBlackberry Q10 Keyboard")
f.close()

f = open("/sd/tft_featherwing.txt", "r")
f = open( # pylint: disable=unspecified-encoding,consider-using-with
"/sd/tft_featherwing.txt", "r"
)
print(f.read())
f.close()
except OSError as error:
Expand Down
15 changes: 9 additions & 6 deletions examples/featherwing_tft24_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
tft_featherwing = tft_featherwing_24.TFTFeatherWing24()

try:
f = open("/sd/tft_featherwing.txt", "w")
f.write("Blinka\nBlackberry Q10 Keyboard")
f.close()
with open( # pylint: disable=unspecified-encoding
"/sd/tft_featherwing.txt", "w"
) as f:
f.write("Blinka\nBlackberry Q10 Keyboard")

with open( # pylint: disable=unspecified-encoding
"/sd/tft_featherwing.txt", "r"
) as f:
print(f.read())

f = open("/sd/tft_featherwing.txt", "r")
print(f.read())
f.close()
except OSError as error:
print("Unable to write to SD Card.")

Expand Down
8 changes: 6 additions & 2 deletions examples/featherwing_tft35_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
tft_featherwing = tft_featherwing_35.TFTFeatherWing35()

try:
f = open("/sd/tft_featherwing.txt", "w")
f = open( # pylint: disable=unspecified-encoding,consider-using-with
"/sd/tft_featherwing.txt", "w"
)
f.write("Blinka\nBlackberry Q10 Keyboard")
f.close()

f = open("/sd/tft_featherwing.txt", "r")
f = open( # pylint: disable=unspecified-encoding,consider-using-with
"/sd/tft_featherwing.txt", "r"
)
print(f.read())
f.close()
except OSError as error:
Expand Down