We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f1ede6 commit 9c5d052Copy full SHA for 9c5d052
examples/featherwing_tft24_simpletest.py
@@ -13,17 +13,16 @@
13
tft_featherwing = tft_featherwing_24.TFTFeatherWing24()
14
15
try:
16
- f = open( # pylint: disable=unspecified-encoding,consider-using-with
+ with open( # pylint: disable=unspecified-encoding
17
"/sd/tft_featherwing.txt", "w"
18
- )
19
- f.write("Blinka\nBlackberry Q10 Keyboard")
20
- f.close()
+ ) as f:
+ f.write("Blinka\nBlackberry Q10 Keyboard")
21
22
23
"/sd/tft_featherwing.txt", "r"
24
25
- print(f.read())
26
+ print(f.read())
+
27
except OSError as error:
28
print("Unable to write to SD Card.")
29
0 commit comments