Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:38 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Pi3B+ and Python2

Author Message
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 03:25am 16 Feb 2021
Copy link to clipboard 
Print this post

I bought a Pi3B+ to build a project from Silicon Chip July 2018, a Tide Chart.
Got the Pi all up and running, downloaded the software from SC, but it has to run on Python2. So I navigated to Preferences/Main Menu Editor/Programming and ticked Python2.7 . At first when I clicked the Raspberry and Programming and selected 2.7 it opened in a black screen like a terminal window. I rebooted and now it throws an error and wont open at all. How do I get to use 2.7 just like I can use Python3.
I am new to The Pi and Python.

Don't know why that other thread appeared!!!
Edited 2021-02-16 13:32 by palcal
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 10:25am 16 Feb 2021
Copy link to clipboard 
Print this post

Hi Palcal,

I *may* be able to help but no promises.

  palcal said  I bought a Pi3B+ to build a project from Silicon Chip July 2018, a Tide Chart.
Got the Pi all up and running, downloaded the software from SC, but it has to run on Python2.


Why Python2, does it report a particular issue if you use Python3, that might not be impossible to resolve.

  Quote   ... I rebooted and now it throws an error and wont open at all.


What's the error ?

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Rado
Regular Member

Joined: 27/11/2020
Location: Croatia
Posts: 59
Posted: 10:26am 16 Feb 2021
Copy link to clipboard 
Print this post

Have you tried opening a console and then typing in "python2"? This should bring up the older version.
Alternatively, you can try using Idle2 instead just Idle.
(haven't tried, did not fire up RPi for quite a long time now, but I guess the above should work)

Also, what version of the OS are you using?
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 08:48pm 16 Feb 2021
Copy link to clipboard 
Print this post

I tried to convert the code to Python 3 by taking the error messages one at a time. The first one was easy, remove parenthesis from all the print statements but I got lost when Import commands were throwing errors. I know not much about the Pi and even less about Python. Why SC printed an article that uses old software I don't know. The project gets the tide heights and times from the Weather Bureau and converts them into graphs that are displayed on the screen
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 08:48pm 16 Feb 2021
Copy link to clipboard 
Print this post

I tried to convert the code to Python 3 by taking the error messages one at a time. The first one was easy, remove parenthesis from all the print statements but I got lost when Import commands were throwing errors. I know not much about the Pi and even less about Python. Why SC printed an article that uses old software I don't know. The project gets the tide heights and times from the Weather Bureau and converts them into graphs that are displayed on the screen
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 08:48pm 16 Feb 2021
Copy link to clipboard 
Print this post

I tried to convert the code to Python 3 by taking the error messages one at a time. The first one was easy, remove parenthesis from all the print statements but I got lost when Import commands were throwing errors. I know not much about the Pi and even less about Python. Why SC printed an article that uses old software I don't know. The project gets the tide heights and times from the Weather Bureau and converts them into graphs that are displayed on the screen (ILI9341).

Edit.... That's twice that has happened I had not finished the post and it just uploaded by itself.
Edited 2021-02-17 06:50 by palcal
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 12:40am 17 Feb 2021
Copy link to clipboard 
Print this post

Finally found out that Raspbian Stretch defaults to Python2 so I downloaded that.
I am finally getting somewhere the code runs and I have a UI on the screen.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 12:50am 17 Feb 2021
Copy link to clipboard 
Print this post

I usually use Stretch for various reasons .
One nifty thing about RPi .....
You can switch OS at the flip of a SD .
AND
Have a fresh version with a ( relatively ) quick download .
my site
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 03:32am 17 Feb 2021
Copy link to clipboard 
Print this post

Well somehow I got it running, my only concern is that now it's headless the only way to turn it off is to cut the power, hope it doesn't corrupt the card.



"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 07:56am 17 Feb 2021
Copy link to clipboard 
Print this post

You could arrange to shut it down cleanly in any of several ways, such as:

1. if it's on a (local) network, login over it and invoke shutdown

2. a small process which monitors an I/O then add a switch you flip to signal it should shut down

You could also arrange that it runs without the SD being write-enabled.

John
 
Rado
Regular Member

Joined: 27/11/2020
Location: Croatia
Posts: 59
Posted: 09:13am 17 Feb 2021
Copy link to clipboard 
Print this post

It's really simple:

https://www.quartoknows.com/page/raspberry-pi-shutdown-button



Edited 2021-02-17 19:14 by Rado
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 08:49pm 17 Feb 2021
Copy link to clipboard 
Print this post

Thanks for the ideas. I'll try the Button and see how it goes.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025