Skip to content

Commit 70652e1

Browse files
committed
DOC: Add flush=True to a few examples
1 parent 814581a commit 70652e1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Callback "wire" with `sounddevice.Stream`:
235235
236236
def callback(indata, outdata, frames, time, status):
237237
if status:
238-
print(status)
238+
print(status, flush=True)
239239
outdata[:] = indata
240240
241241
with sd.Stream(channels=2, callback=callback):
@@ -250,7 +250,7 @@ Same thing with `sounddevice.RawStream`:
250250
251251
def callback(indata, outdata, frames, time, status):
252252
if status:
253-
print(status)
253+
print(status, flush=True)
254254
outdata[:] = indata
255255
256256
with sd.RawStream(channels=2, dtype='int24', callback=callback):

examples/spectrogram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def callback(indata, frames, time, status):
8585
args.gain /= 2
8686
else:
8787
print('\x1b[31;40m', usage_line.center(args.columns, '#'),
88-
'\x1b[0m', sep='')
88+
'\x1b[0m', sep='', flush=True)
8989
break
9090
if statuses:
9191
logging.warning(str(statuses))

0 commit comments

Comments
 (0)