Python on RPiOS
Posted: Mon Jun 22, 2020 8:14 pm
Can you install Python on RPiOS. If this is possible, which version do you need to download.
python.org/downloads/
python.org/downloads/
A small, affordable computer with free resources to help people learn, make things, and have fun
https://www.raspberrypi.org/forums/
https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=278069
I have downloaded a couple of books on learning Python and how to write some basic programs.DougieLawson wrote: ↑Mon Jun 22, 2020 8:16 pmAll versions of Raspbian (since Wheezy) and RaspiOS already include an appropriate (and current when built) version of python2 and python3.
What are you attempting to do?
EnterRaspberry Pi Micro wrote: ↑Mon Jun 22, 2020 8:26 pmI have downloaded a couple of books on learning Python and how to write some basic programs.
How do you start Python on RPiOS.
Code: Select all
python
Code: Select all
python3
Finally looks like I now have Python3 installed. I start Terminal and then type python 3 and then the following information is displayed.pfletch101 wrote: ↑Mon Jun 22, 2020 8:35 pmEnterRaspberry Pi Micro wrote: ↑Mon Jun 22, 2020 8:26 pmI have downloaded a couple of books on learning Python and how to write some basic programs.
How do you start Python on RPiOS.at the system command line for Python 2, orCode: Select all
python
at the system command line for Python 3. These will give you the relevant version of python's command line.Code: Select all
python3
If you like (or your book uses) IDEs, Thonny and Geany are part of the non-lite packages and can be found on the 'Programming' tab of the main menu.
The Thonny IDE is not itself Python.....It is a tool to help you write and debug your Python code. As mentioned any text editor such as nano or mousepad could be used to write Python code, but an IDE has a lot more features to help you write and debug your code.Raspberry Pi Micro wrote: ↑Tue Jun 30, 2020 2:33 pmOk thank you, is this the same or slightly different version of python.
From the Thorny View menu, what should I have selected or shown.
Code: Select all
$ python3
Python 3.7.2 (default, Jan 9 2019, 15:51:37)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 2 + 2
4
>>> print("Hello world!")
Hello world!
>>>
Thank you. Think I will start with Thorny Python IDE, from the menu at the top, you select View, this it gives you a number of views options, what should I best select here to start with.klricks wrote: ↑Tue Jun 30, 2020 3:33 pmThe Thonny IDE is not itself Python.....It is a tool to help you write and debug your Python code. As mentioned any text editor such as nano or mousepad could be used to write Python code, but an IDE has a lot more features to help you write and debug your code.Raspberry Pi Micro wrote: ↑Tue Jun 30, 2020 2:33 pmOk thank you, is this the same or slightly different version of python.
From the Thorny View menu, what should I have selected or shown.
Once your code is written and working, in most cases, the IDE is no longer needed and you just run your code from the command line or desktop like any other app or command.
Pressing the [Print Screen] key will capture the entire screen and save a .png image in the current directory.Raspberry Pi Micro wrote: ↑Tue Jun 30, 2020 6:45 pmWhat options are there for taking a screenshot on RPiOS, if it's the whole screen or just an active window.
On Mac OS it's CMD + SHIFT + 3 and CMD + SHIFT + 4
Code: Select all
scrot -h
Code: Select all
man scrot
Documented on RPi website: