discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Printing from within an embedded Python program


From: Kimmo Lehtinen
Subject: Printing from within an embedded Python program
Date: Fri, 19 Aug 2022 12:39:24 +0000 (UTC)


Hi

I am using an embedded Python program to take an average of a large number of spectra.
I want to continuously print the number of averaged spectra so that output happens on a same line, always overwriting the previous number. So not printing each number on a separate line.

In Python you can do it in the following way:

>for i in range(100000):
...   print('Number of spectra averaged  ', i, end='\r')

However, that does not work from within an embedded Python program, each number is on its own line, which is very time consuming.

How to print on a same line, overwriting previous output ?
I am using GRC 3.9.5.0 (Python 3.8.10) on Ubuntu 12.04.4

Cheers, Kimmo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]