|
| 1 | +Python for Newbies |
| 2 | +================== |
| 3 | + |
| 4 | +This is a guide to Python for *absolute beginners*. You need to know how to use a mouse, a keyboard, a Web browser, and that's pretty much it. By following this guide, you'll learn how to set up the Python programming language on your computer for: |
| 5 | + |
| 6 | +* data analysis |
| 7 | +* task automation |
| 8 | +* system administration |
| 9 | +* or just fun! |
| 10 | + |
| 11 | +> This guide was originally written as a prolegomenon for the [IPython minibook](http://ipython-books.github.io/minibook/), which focuses on Python for data analysis. However, we won't cover data analysis in this guide, only general programming and Python topics, so read on! |
| 12 | +
|
| 13 | +In this guide, we'll cover the very basics of the Python language. The "bad news" is that the language is actually only the easy part. You'll also have to learn the basics of: |
| 14 | + |
| 15 | +* your **operating system**: there are a few things you need to know abouot our OS, be it Windows, Linux, or Mac OS X |
| 16 | +* **the command-line interface** (or terminal): do things on your computer by typing commands rather than clicking on buttons (that's more powerful) |
| 17 | +* **conda**: a program for installing Python modules |
| 18 | +* **Python**: an accessible programming language (many kids learn it nowadays) |
| 19 | +* **the IPython notebook**: use Python from your Web browser |
| 20 | +* **a text editor**: ditch Word and use a real code editor |
| 21 | +* **Git**: a program that will prevent your from accidentally losing your work |
| 22 | + |
| 23 | +The good news is that all of these programs are free (well, except Windows, for now). All you need is some time to digest this guide. Then, you'll be ready to code in Python like a pro! (or, more precisely, like an "enlightened beginner") |
| 24 | + |
| 25 | +But, first: |
| 26 | + |
| 27 | + |
| 28 | +### Why would I want to learn Python? |
| 29 | + |
| 30 | +You have two options in life. Be a consumer, dependent on the connected things around you (your smartphone, tablet, computer, watch), always bugging your geek friends when you need help. Or be a producer, maker, hacker. Program your computer instead of letting others program it for you. An app doesn't have a feature you need? Code it yourself. Be in control of your devices and your personal data. |
| 31 | + |
| 32 | +> "Don't just buy a new video game - make one. Don't just download the latest app - help design it. Don't just play on your phone - program it." |
| 33 | +
|
| 34 | +> [Barack Obama](http://venturebeat.com/2013/12/08/president-obama-kicks-off-cs-education-week-with-code-org-dont-just-play-on-your-phone-program-it/) |
| 35 | +
|
| 36 | +Learning Python will let you do that. Python is one of the most accessible programming languages in the world, yet it is highly capable. It is widely used in industry and academia. It is a very appreciated skill on the job market. If you've never programmed before, this is the first language you want to learn (but not the last!). |
| 37 | + |
| 38 | +> Check out the [Python brochure (PDF preview)](http://brochure.getpython.info/media/releases/prerelases/psf-python-brochure-vol-1-final-content-preview) to get an idea about the things people do with Python. |
| 39 | +
|
| 40 | +A few examples: |
| 41 | + |
| 42 | +* You're a journalist? Conduct your very own data analyses from scratch instead of using Excel (which crashes on large datasets anyway) |
| 43 | +* You're an amateur photograph? Organize and process your photos exactly as you wish instead of using buggy or expensive software. |
| 44 | +* You're a gamer? Make your own video game! |
| 45 | +* You're an active citizen? Download open datasets and find out how well (or bad) your city or country is doing. |
| 46 | +* You're a teacher? Teach your students how to code. Illustrate concepts in computer science, maths, physics, biology, or economics with simple programs. |
| 47 | +* You're an entrepreneur? Create a product prototype, or make your own website. |
| 48 | +* You're a parent? Make a video game for your kids, or learn to code with them. Or just manage your house expenses. |
| 49 | + |
| 50 | + |
| 51 | +### What do I need to get started? |
| 52 | + |
| 53 | +You need three things: |
| 54 | + |
| 55 | +* **A computer**. It doesn't need to be powerful (if it dates from this century, it's good enough). |
| 56 | +* **Motivation**. Learning a first programming language is not particularly easy, but it's not excessively difficult either. It's probably easier than learning a new human language or a musical instrument. |
| 57 | +* **Time**. Work regularly and you'll progress. For example, work through this guide for one hour every couple of days and you'll make small Python scripts within two weeks. |
| 58 | + |
| 59 | +All of the tools we'll be using in this guide are free and open source (anyone can distribute and modify them). They run on virtually all sorts of personal computers we find on the market today. |
| 60 | + |
| 61 | + |
| 62 | +### What is covered in this guide? |
| 63 | + |
| 64 | +You'll not only learn the essentials of the Python programming language, you'll also learn how to install it on your computer, how to organize your code, how to use a text editor, and so on. Many beginners find that the most important barrier to entry is not the language itself (which is quite simple), but everything that comes *before*. How to install it. Where to put the darned code. How to use the command-line. We'll cover all of these things here. |
| 65 | + |
| 66 | + |
| 67 | +## Lesson 1: know your operating system |
| 68 | + |
| 69 | + |
| 70 | +## Lesson 2: use the command-line interface |
| 71 | + |
| 72 | + |
| 73 | +## Lesson 3: install Python with conda |
| 74 | + |
| 75 | + |
| 76 | +## Lesson 4: code in Python |
| 77 | + |
| 78 | + |
| 79 | +## Lesson 5: code in your browser with the IPython notebook |
| 80 | + |
| 81 | + |
| 82 | +## Lesson 6: use a text editor |
| 83 | + |
| 84 | + |
| 85 | +## Lesson 7: save your code with Git |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
0 commit comments