查看: 29|回复: 4

[软件] [转载] What is Python for ?

恒博快乐 发表于 2017-4-16 12:55 | 显示全部楼层 |阅读模式
本帖最后由 rpw 于 2016-11-22 16:07 编辑


When I need to build a web app, I reach for Python. When I need to automate some small task on my system, I reach for Python. When I want to find the most common colors in an image, I reach for Python. When I…OK, I think you get the picture. Basically, when I need to code something and the language doesn’t matter, I use Python. So what is Python?

Python is a general purpose programming language created in the late 1980s, and named after Monty Python, that’s used by thousands of people to do things from testing microchips at Intel, to powering Instagram, to building video games with the PyGame library. It’s small, very closely resembles the English language, and has hundreds of existing third-party libraries.

So what are the major reasons why I, personally, choose Python and recommend it to as many people as possible? It comes down to three reasons.


Python very closely resembles the English language, using words like ‘not’ and ‘in’ to make it to where you can very often read a program, or script, aloud to someone else and not feel like you’re speaking some arcane language. This is also helped by Python’s very strict punctuation rules which means you don’t have curly braces ({ }) all over your code.

Also, Python has a set of rules, known as PEP 8, that tell every Python developer how to format their code. This means you always know where to put new lines and, more importantly, that pretty much every other Python script you pick up, whether it was written by a novice or a seasoned professional, will look very similar and be just as easy to read. The fact that my Python code, with five or so years of experience, looks very similar to the code that Guido van Rossum (the creator of Python) writes is such an ego boost.


Python has been around for over 20 years, so a lot of code written in Python has built up over the decades and, being an open source language, a lot of this has been released for others to use. Almost all of it is collected on, pronounced “pie-pee-eye” or, more commonly called “the CheeseShop”. You can install this software on your system to be used by your own projects. For example, if you want to use Python to build scripts with commandline arguments, you’d install the “click” library and then import it into your scripts and use it. There are libraries for pretty much any use case you can come up with, from image manipulation, to scientific calculations, to server automation.


Python has user groups everywhere, usually called PUGs, and does major conferences on every continent other than Antarctica. PyCon NA, the largest Python conference in North America, sold out its 2,500 tickets this year. And, reflecting Python’s commitment to diversity, it had over 30% women speakers. PyCon NA 2013 also started a trend of offering “Young Coder” workshops, where attendees taught Python to kids between 9 and 16 years of age for a day, getting them familiar with the language and, ultimately, helping them hack and mod some games on the Raspberry Pis they were given. Being part of a such a positive community does a lot to keep you motivated.

I’m very excited to be able to share my favorite language with the Treehouse community and hopefully the pieces of Python that I love the most will help you decide to check it out and learn it with me.

Here’s a short video of Kenneth giving examples of the best uses of Python.

[backcolor=rgba(0, 0, 0, 0.8)]



使用道具 举报

longwayhome 发表于 2017-7-6 16:33 | 显示全部楼层
Python !!!现如今程序员的学习成本确实降低了 !

回复 支持 反对

使用道具 举报

idema 发表于 2017-9-12 15:58 | 显示全部楼层
回复 支持 反对

使用道具 举报

信條 发表于 2017-10-1 23:43 | 显示全部楼层
编程入门 Phthon 确实更加容易上手,学习起来性价比高
回复 支持 反对

使用道具 举报

czrsmcn 发表于 2018-1-8 01:26 | 显示全部楼层
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册


手机版|小黑屋|Keep Friends

GMT+8, 2019-5-24 01:30 , Processed in 0.072203 second(s), 8 queries , Gzip On, APC On.

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表