|
| 1 | +# Installing Python |
| 2 | + |
| 3 | +If you want to learn to program with Python using this tutorial, you |
| 4 | +need to try out the code examples. You could use a website like |
| 5 | +[repl.it](https://repl.it/languages/python3), but I highly recommend |
| 6 | +installing Python. That way you don't need to open a web browser just to |
| 7 | +write code, and you can work without an Internet connection. |
| 8 | + |
| 9 | +Let's get started! |
| 10 | + |
| 11 | +### Downloading and installing Python |
| 12 | + |
| 13 | +#### Windows |
| 14 | + |
| 15 | +1. Go to [the official Python website](https://www.python.org/). |
| 16 | +2. Move your mouse over the blue Downloads button, but don't click it, |
| 17 | + Then click the button that downloads the latest version of Python. |
| 18 | +3. Run the installer. |
| 19 | +4. Select the "advanced installation" option, and make sure the py.exe |
| 20 | + launcher gets installed. |
| 21 | + |
| 22 | +#### Mac OSX |
| 23 | + |
| 24 | +I don't have an up-to-date copy of Mac OSX. If you would like to write |
| 25 | +instructions for OSX, [tell me](contact-me.md). |
| 26 | + |
| 27 | +#### GNU/Linux |
| 28 | + |
| 29 | +You already have Python, there's no need to install it. If you |
| 30 | + |
| 31 | +If you want to use IDLE (see below), install it. The name of the package |
| 32 | +is `idle3` on Debian-based distributions, like Ubuntu and Linux Mint, |
| 33 | +and you can install it with a software manager like any other program. |
| 34 | +On other distributions you can just search for idle using the |
| 35 | +distribution's package manager. |
| 36 | + |
| 37 | +### Running Python |
| 38 | + |
| 39 | +Now you have Python installed. There are several ways to run Python: |
| 40 | + |
| 41 | +1. Directly from PowerShell, command prompt or terminal. |
| 42 | +2. Using IDLE. |
| 43 | +3. Using something else. |
| 44 | + |
| 45 | +I'm not going to focus on the third option in this tutorial, but if you |
| 46 | +know how to use Python with something else than PowerShell, command |
| 47 | +prompt, a terminal or IDLE it's fine. Do whatever you want. |
| 48 | + |
| 49 | +#### If you like working with PowerShell, command prompt or terminal |
| 50 | + |
| 51 | +On Windows. you should be able to run Python from a PowerShell window, |
| 52 | +or a command prompt window if you don't have PowerShell. Open one of |
| 53 | +these programs from the start menu or start screen, type there `py` and |
| 54 | +press Enter. You should see something like this in it: |
| 55 | + |
| 56 | + C:\Users\You> py |
| 57 | + Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) |
| 58 | + [MSC v.1600 32 bit (Intel)] on win32 |
| 59 | + Type "help", "copyright", "credits" or "license" for more information. |
| 60 | + >>> |
| 61 | + |
| 62 | +On GNU/Linux or Mac OSX, type `python3` instead: |
| 63 | + |
| 64 | + you@YourComputer:~$ python3 |
| 65 | + Python 3.4.3 (default, Oct 14 2015, 20:28:29) |
| 66 | + [GCC 4.8.4] on linux |
| 67 | + Type "help", "copyright", "credits" or "license" for more information. |
| 68 | + >>> |
| 69 | + |
| 70 | +Now type `exit()` and press Enter to get out of Python. |
| 71 | + |
| 72 | +#### If you are not an advanced user and you have no idea what PowerShell, command prompt and terminal are |
| 73 | + |
| 74 | +Use IDLE. Experienced Python users will say that IDLE is garbage, but |
| 75 | +don't listen to them. These people want you to use "better" alternatives |
| 76 | +with more features, but that's exactly what you don't want as a |
| 77 | +beginner. You should spend as little time as possible learning your |
| 78 | +tools, and as much time as possible learning Python. Advanced |
| 79 | +programming tools are not going to help you at all with this. |
| 80 | + |
| 81 | +Launch Python's IDLE like any other program. You should see something |
| 82 | +like this: |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | +From now on, I'll instead show everything like this, so I don't have to |
| 87 | +take more screenshots: |
| 88 | + |
| 89 | + Python 3.4.3 (default, Oct 14 2015, 20:28:29) |
| 90 | + [GCC 4.8.4] on linux |
| 91 | + Type "copyright", "credits" or "license()" for more information. |
| 92 | + >>> |
| 93 | + |
| 94 | +The exact content of your Python's welcome message is probably different |
| 95 | +than mine, it's ok. |
| 96 | + |
| 97 | +### Summary |
| 98 | +- Now you should be able run Python. |
| 99 | +- |
| 100 | + |
| 101 | +*** |
| 102 | + |
| 103 | +You may use this tutorial freely at your own risk. See [LICENSE](LICENSE). |
| 104 | + |
| 105 | +[Back to the list of contents](README.md) |
0 commit comments