@@ -160,6 +160,8 @@ def print(self, value):
160160
161161 def __setitem__ (self , key , value ):
162162 self ._put (value , key )
163+ if self ._auto_write :
164+ self .show ()
163165
164166 def scroll (self , count = 1 ):
165167 """Scroll the display by specified number of places."""
@@ -182,8 +184,6 @@ def _put(self, char, index=0):
182184 character = ord (char ) * 2 - 64
183185 self ._set_buffer (index * 2 , CHARS [1 + character ])
184186 self ._set_buffer (index * 2 + 1 , CHARS [character ])
185- if self ._auto_write :
186- self .show ()
187187
188188 def _push (self , char ):
189189 """Scroll the display and add a character at the end."""
@@ -199,6 +199,8 @@ def _text(self, text):
199199
200200 def _number (self , number ):
201201 """Display the specified decimal number."""
202+ auto_write = self ._auto_write
203+ self ._auto_write = False
202204 string = "{}" .format (number )
203205 if len (string ) > 4 :
204206 if string .find ('.' ) > 4 :
@@ -208,6 +210,7 @@ def _number(self, number):
208210 if '.' in string :
209211 places += 1
210212 self ._text (string [:places ])
213+ self ._auto_write = auto_write
211214
212215class Seg7x4 (Seg14x4 ):
213216 """Numeric 7-segment display. It has the same methods as the alphanumeric display, but only
@@ -257,8 +260,6 @@ def _put(self, char, index=0):
257260 else :
258261 return
259262 self ._set_buffer (index , NUMBERS [character ])
260- if self ._auto_write :
261- self .show ()
262263
263264class BigSeg7x4 (Seg7x4 ):
264265 """Numeric 7-segment display. It has the same methods as the alphanumeric display, but only
0 commit comments