Python Script no longer echos output?

Hi all,
was running a Python Script successfully up till yesterday. Echoing output to cli.
stopped the script and restarted and now script is no longer echoing output and is no longer working or displaying any errors?

Have tried Thony to debug says everything is correct?

Has anyone come across this?

I am running Raspberry Pi Zero and PiicDev_BME280


Might be worth trying a basic script, without any other code

print("Hello World")


Hi Phil,

Were you able to get the script to do a basic print() command as Gramo has suggested? This would isolate the PiicoDev sensor setup and hardware from the equation and might help pinpoint what’s changed.


Hi Trent and @Gramo. the Piico Sensor is working fine. This script is working correctly.
However, the other script that I wrote was echoing correctly and this has just stopped working.
You can run the script, i.e. python3 and this gives no echo and or errors?


Hi Phil,

Does a totally new script with just hello world echo? Or does only your custom script not return the echo?

If an otherwise blank script returns the echo then we’ll know that it’s something in your which is causing the strange behaviour, even if other functions of the script are still performing their jobs normally.


Hi Trent,

the affected script is pi@pi0w-weather-stn-herm:~/Weather $ python3 echos out Hello World as per @Gramo

pi@pi0w-weather-stn-herm:~/Weather python3 pi@pi0w-weather-stn-herm:~/Weather python3
Hello World

PiicoDev_BME280 script works fine

pi@pi0w-weather-stn-herm:~/PiicoDev $ python3
30.17 °C 957.8265234375 hPa 26.607421875 % RH
sending {sensor data} to server
30.16 °C 957.7457421875 hPa 26.4169921875 % RH can be found here:
PhilKern65/aprs-weather: Weather data using a PiicoDev_BME280 sensor and Raspberry Pi Zero and transmit weather data via APRS (

Cheers in advance


Python is an interpreted language; each line of code is interpreted and then run. Perhaps add print statements with basic debug text, starting at line 1 and every so often as you feel appropriate.

Don’t go overboard first time around, you’ll soon iterate toward the issue and find out which line of code is the problem.

When a line of code fails you get an error on the terminal. Interesting that you don’t, so it’s more likely an infinite loop or blocking call never completes.

Good luck and let me know how you go!


Thanks, will check and advise.



Hi @Gramo…After many hours of trial and error, I simply just started again.
Its working, but needs some legacy code removed.

Thanks again.



Recently I experienced something similar.
I cut and pasted some code from a web page and it did not work as it should.

When I typed in the code it worked ok.

I put it down to some characters in the cut and paste which were hidden in the text display but affected the running of the code. Thonny

When I cut and paste now; I will put it into a simple text editor like the one that comes with Windows 10. Then cut and paste the text from the text editor.

Unsure if this is your problem, but it was confusing at the time.



Hi James, from your description it sounds like maybe it’s a space/tab issue.
Some people like to use tabs instead of spaces, visa-versa.

For Python, which is indent sensitive, mixing spaces and tabs should be avoided.
So even if the spacing/tab looks the same, the interpreter does not think so.

Sorry, this probably doesn’t answer the main topic.

1 Like