![]() |
Forum Index : Microcontroller and PC projects : Pi3B+ and Python2
Author | Message | ||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
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 KingdomPosts: 4311 |
Hi Palcal, I *may* be able to help but no promises. Why Python2, does it report a particular issue if you use Python3, that might not be impossible to resolve. 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: CroatiaPosts: 59 |
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: AustraliaPosts: 1993 |
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: AustraliaPosts: 1993 |
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: AustraliaPosts: 1993 |
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: AustraliaPosts: 1993 |
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 StatesPosts: 719 |
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: AustraliaPosts: 1993 |
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 KingdomPosts: 4044 |
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: CroatiaPosts: 59 |
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: AustraliaPosts: 1993 |
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" |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |