Python Forum
I'm New to Python and have a question
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I'm New to Python and have a question
#1
Hi
I've just bought my son a Raspberry Pi 3 , along with user guides including "Coding: Raspberry Pi & Python: Step By Step Guide From Beginner To Advanced: Two Manuscripts In One" from Amazon.

My question is how do we get the Python App so he can start with it? or is it included in the OS?

Any advice more than welcome.

Thanks in advance

Steve
Reply
#2
The OS will be some Linux distribution for sure. Most of these are coming with preinstalled Python. Probably both versions. All needed is to type python in the terminal to run the interpreter. python2, python3 are shortcuts to the respective version. The python "command" will run the default version for the OS:

victor@jerry:~$ python
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 12:22:00) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
So, on this Ubuntu MATE the default one is Python 3.6.0.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
I have a Raspberry Pi 2 (loaded with Raspian 'Jessie'. This is a Linux OS (Debian fork, actually) and comes with Python 2.7.9 and Python 3.4.2 by default. As was pointed out, Linux generally comes with both versions, but the versions may be older/newer. I doubt (though I don't know for sure) that the Windows version for the Pi comes with any Python version pre-installed. It shouldn't be a problem to install, however.

Since you are are apparently new to Python, you will want to use the latest available version of Python you have, ie 3.x, do not waste your time with Python 2, as this is only a maintenance release and will no longer be supported as of 2020. If you use a Linux distribution, you access Python 3.x with the command "python3" in the command terminal. You can also add a "shebang" line as the very first line of the scripts you write. This usually takes the form of !# /usr/bin/env python3 . You should also make sure that 'pip' is installed and is the most up to date version (currently 9.0.1). You can check this by typing "pip3 -V" at the command prompt (not the Python prompt), if your version is less than the current you can upgrade it with pip3 install --upgrade pip , again, typed at the command prompt.

If you have any other questions or concerns feel free to ask, it's why we are here. :-)
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020