13732
备注:
|
5266
|
删除的内容标记成这样。 | 加入的内容标记成这样。 |
行号 1: | 行号 1: |
[[TableOfContents]] = Python语言简介 = |
= Python = |
行号 4: | 行号 3: |
== 总览 == | * Python教程:[[Python游戏开发基础]] * [[StacklessPython]] * [[Python小程序]] * [[Python使用技巧]] * [[Python相关软件]] * [[Python介绍]] from Wikipedia * [[https://stackify.com/learn-python-tutorials/|30个不同的Python入门网站]] |
行号 6: | 行号 11: |
Python is an interpreted programming language created by Guido van Rossum in 1990. Python is fully dynamically typed and uses automatic memory management; it is thus similar to Perl, Ruby, Scheme, Smalltalk, and Tcl. Python is developed as an open source project, managed by the non-profit Python Software Foundation, and is available for free from the project website. Python 2.4.3 was released on March 29, 2006. | == 参考资料 == |
行号 8: | 行号 13: |
||Paradigm编程范式:||Multi-paradigm多范式|| ||Appeared in出现时间:||1990|| ||Designed by设计者:||Guido van Rossum|| ||Developer开发者:||Python Software Foundation|| ||Latest release最后发布时间:||2.4.3 / March 29, 2006|| ||Typing discipline类型规则:||Strong, dynamic ("duck")|| ||Major implementations主要实现:||CPython, Jython, IronPython, PyPy|| ||Influenced by受哪些语言影响:||ABC, Modula-3, Icon, C, Perl, Lisp, Smalltalk, Tcl|| ||Influenced影响了哪些语言:||Ruby, Boo|| ||OS操作系统:||Cross-platform|| ||License许可证:||Python Software Foundation License|| ||Website网站:||www.python.org|| == duck typing == In computer science, duck typing is a term for dynamic typing typical of some programming languages, such as Smalltalk or Visual FoxPro, where a variable's value itself determines what the variable can do. It also implies that an object is interchangeable with any other object that implements the same interface, regardless of whether the objects have a related inheritance hierarchy. The term is a reference to the "duck test"—"If it walks like a duck and quacks like a duck, it must be a duck." One can also say that the duck typing method ducks the issue of typing variables. Pythonic programming style that determines an object's type by inspection of its method or attribute signature rather than by explicit relationship to some type object ("If it looks like a duck and quacks like a duck, it must be a duck.") By emphasizing interfaces rather than specific types, well-designed code improves its flexibility by allowing polymorphic substitution. Duck-typing avoids tests using type() or isinstance(). Instead, it typically employs hasattr() tests or EAFP [Easier to Ask Forgiveness than Permission] programming. The standard example of duck typing in Python is file-like classes. Classes can implement some or all of the methods of file and can be used where file would normally be used. For example, GzipFile implements a file-like object for accessing gzip-compressed data. cStringIO allows treating a Python string as a file. Sockets and files share many of the same methods as well. However, sockets lack the tell() method and cannot be used everywhere that GzipFile can be used. This shows the flexibility of duck typing: a file-like object can implement only methods it is able to, and consequently it can be only used in situations where it makes sense. == Python设计哲学 == Python is a multi-paradigm language. This means that, rather than forcing coders to adopt one particular style of coding, it permits several. Object orientation, structured programming, functional programming, and aspect-oriented programming are all supported. Other paradigms can be supported through extensions, such as pyDBC and Contracts for Python which allow Design by Contract. Python is dynamically type-checked and uses garbage collection for memory management. An important feature of Python is dynamic name resolution, which binds method and variable names during program execution. While offering choice in coding methodology, Python's designers reject exuberant syntax, such as in Perl, in favor of a sparser, less cluttered one. As with Perl, Python's developers expressly promote a particular "culture" or ideology based on what they want the language to be, favoring language forms they see as "beautiful", "explicit" and "simple". For the most part, Perl and Python users differ in their interpretation of these terms and how they are best implemented (see TIMTOWTDI and PythonPhilosophy). Another important goal of the Python developers is making Python fun to use. This is reflected in the origin of the name (after the television series Monty Python's Flying Circus), in the common practice of using Monty Python references in example code, and in an occasionally playful approach to tutorials and reference materials. For example, the metasyntactic variables often used in Python literature are spam and eggs, instead of the traditional foo and bar. Python is sometimes referred to as a "scripting language". In practice, it is used as a dynamic programming language for both application development and occasional scripting. Python has been used to develop many large software projects such as the Zope application server and the Mnet and BitTorrent file sharing systems. It is also extensively used by Google. [1] Another important goal of the language is ease of extensibility. New built-in modules are easily written in C or C++. Python can also be used as an extension language for existing modules and applications that need a programmable interface. Though the design of Python is somewhat hostile to functional programming (no tail call elimination or good support for anonymous closures) and the Lisp tradition, there are significant parallels between the philosophy of Python and that of minimalist Lisp-family languages such as Scheme. Many past Lisp programmers have found Python appealing for this reason. == 新名词Pythonic == A few neologisms have come into common use within the Python community. One of the most common is "pythonic", which can have a wide range of meanings related to program style. To say that a piece of code is pythonic is to say that it uses Python idioms well; that it is natural or shows fluency in the language. Likewise, to say of an interface or language feature that it is pythonic is to say that it works well with Python idioms; that its use meshes well with the rest of the language. In contrast, a mark of unpythonic code is that it attempts to "write C++ (or Lisp, or Perl) code in Python"—that is, provides a rough transcription rather than an idiomatic translation of forms from another language. The prefix Py- can be used to show that something is related to Python. Examples of the use of this prefix in names of Python applications or libraries include Pygame, a binding of SDL to Python (commonly used to create games), PyUI, a GUI encoded entirely in Python, and PySol, a series of solitaire card games programmed in Python. Users and admirers of Python—most especially those considered knowledgeable or experienced—are often referred to as Pythonists, Pythonistas, and Pythoneers |
* [[http://www.python.org/|Python Official Web]] * [[http://en.wikipedia.org/wiki/Python_%28programming_language%29|Wikipedia:Python_programming_language]] ([[http://zh.wikipedia.org/wiki/Python|Wikipedia上的Python编程语言简介]]) * [[https://docs.python.org/3/tutorial/|Python Tutorial]] * [[https://diveintopython3.problemsolving.io/|Dive Into Python 3]] ([[https://woodpecker.org.cn/diveintopython3/|中文版]]) * [[http://www.byteofpython.info/read/index.html|A Byte of Python]] (中文版: [[http://www.byteofpython.info/language/chinese/index.html|简明Python教程]]) * [[http://docs.python.org/ref/ref.html|Python Reference Manual]] (中文版: [[http://chinesepython.org/pythonfoundry/ref2.3/tmp/|Python语言参考手册]] ) * [[http://docs.python.org/lib/lib.html|Python Library Reference]] (中文版: [[http://chinesepython.org/pythonfoundry/lib2.3/tmp/|Python库参考手册]]) * [[http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html|One Day of IDLE Toying]] (中文版: [[http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/IDLE-chinese.htm|摆弄一天IDLE]]) * [[http://www-128.ibm.com/developerworks/cn/linux/theme/special/index.html#python|ibm上的python专题]] * [[http://www.ibiblio.org/obp/thinkCSpy/|How to Think Like a Computer Scientist (Learning with Python)]] * [[http://www.hetland.org/python/instant-hacking.php|Instant Hacking]] and [[http://hetland.org/python/instant-python.php|Instant Python]] * [[http://wiki.python.org/moin/Intro_to_programming_with_Python_and_Tkinter|Intro to programming with Python in Tkinter(Video Lesson)]] * [[http://www.honors.montana.edu/~jjc/easytut/easytut/|Non-Programmers Tutorial For Python]] * [[http://www.pentangle.net/python/handbook/|Handbook of the Physics Computing Course]] * [[http://www.onlamp.com/pub/a/python/2002/10/17/biopython.html|Beginning Python for Bioinformatics]] * [[http://www.pasteur.fr/recherche/unites/sis/formation/python/|Python course in Bioinformatics]] * [[http://www.pasteur.fr/formation/infobio/python/|Introduction to Programming using Python]] * [[http://www.livewires.org.uk/python/|The LiveWires Python Course]] * [[http://gvr.sourceforge.net/|The Guido van Robot]] * [[http://www.linuxjournal.com/article/3946|Python Programming for Beginners]] * [[http://www.rexx.com/~dkuhlman/python_101/python_101.html|Python 101 -- Introduction to Python]] [[http://www.rexx.com/~dkuhlman/python_201/python_201.html|Python 201 -- (Slightly) Advanced Python Topics]] * [[http://www.wag.caltech.edu/home/rpm/python_course/|Python Short Course]] * [[http://www.ifi.uio.no/in228/lecsplit/|Scripting for Computational Science]] * [[http://starship.python.net/crew/hinsen/|Python for Science]] * [[http://www.codeteacher.com/category.php?ID=8|Code Teacher]] * [[http://groups.google.com/group/comp.lang.python|Python讨论组comp.lang.python]] * [[http://pine.fm/LearnToProgram/|Learn to Program(ruby)]] |
行号 55: | 行号 42: |
== Python支持的平台 == | == 入门教程 == * awesome python https://github.com/vinta/awesome-python * [[https://developers.google.com/edu/python|Google's Python Class]] * [[https://blog.jetbrains.com/blog/2020/03/05/jetbrains-academy-python/|Learn Python with JetBrains Academy!]] * [[http://en.wikipedia.org/wiki/Python_syntax_and_semantics|Python语法]] from Wikipedia * [[http://www.linuxjournal.com/article/3882|Why_Python]] by Eric Raymond [[http://wiki.woodpecker.org.cn/moin/WhyPython/WhyPythonZh|why python中文版]] * [[http://www.amk.ca/python/howto/advocacy/|Python_Advocacy_HOWTO]] by A.M. Kuchling * 另类的Python教程: [[attachment:我的名字叫Python.pdf]] * python 与 COM [[http://oreilly.com/catalog/pythonwin32/chapter/ch12.html|Advanced Python and COM]] * Using IDLE: [[attachment:idleUse05b.zip]] * Learning to Program: attachment: http://www.freenetpages.co.uk/hp/alan.gauld/ * Learn To Program CD: [[attachment:LearnToProgramCD.zip]] * Tkinter Life Preserver: http://www.python.org/doc/life-preserver/ * Python介绍视频[[http://video.google.com/videoplay?docid=9023849479319414382|Introducing Python]] * [[https://towardsdatascience.com/30-python-best-practices-tips-and-tricks-caefb9f8c5f5|30 Python Best Practices, Tips, And Tricks]] * [[https://docs.python-guide.org/dev/virtualenvs/|pipenv, virtual env]] * [[https://docs.python-guide.org/writing/gotchas/|Python Gotchas]] * [[https://www.ibm.com/developerworks/cn/opensource/os-cn-python-yield/|Python yield 使用浅析]] |
行号 57: | 行号 61: |
The most popular (and therefore best maintained) platforms Python runs on are Linux, BSD, Mac OS X, Microsoft Windows. Separate implementations also exist for the Java (called Jython) and for the .NET Framework or Mono (called IronPython). Other supported platforms include: | == python游戏相关 == * pygame: http://www.pygame.org/ * panda3d: http://www.panda3d.org/ * renpy: http://www.renpy.org/wiki/renpy/Home_Page |
行号 59: | 行号 66: |
Unix-like | == Python与正则表达式 == * http://docs.python.org/lib/module-re.html * http://www.amk.ca/python/howto/regex/ * Mastering Regular Expressions 2nd Edition, By Jeffrey E. F. Friedl |
行号 61: | 行号 71: |
* AIX operating system * BSD * FreeBSD * NetBSD * Linux * OpenBSD * SPARC Solaris * Other Unixes, e.g. Irix Desktop OS's * Amiga * AROS * BeOS * Mac OS 9 * Mac OS X * Microsoft Windows * OS/2 * RISC OS (formerly Acorn) Special and embedded * GP2X * Java virtual machine * Nokia 770 Internet Tablet * Palm OS * PlayStation 2 * PlayStation Portable * Psion * QNX * Sharp Zaurus * Symbian OS * Windows CE/Pocket PC * Xbox (Used in XBMC) * VxWorks Mainframe and other * AS/400 * OS/390 * Plan 9 from Bell Labs * VMS * z/OS Most of the third-party libraries for Python (and even some first-party ones) are only available on Windows, Linux, BSD, and Mac OS X. Python was originally developed as a scripting language for the Amoeba operating system capable of making system calls; however, that version is no longer maintained. == Standard library == Python has a large standard library, which makes it well suited to many tasks. This comes from a so-called "batteries included" philosophy for Python modules. The modules of the standard library can be augmented with custom modules written in either C or Python. The standard library is particularly well tailored to writing Internet-facing applications, with a large number of standard formats and protocols (such as MIME and HTTP) supported. Modules for creating graphical user interfaces, connecting to relational databases, arithmetic with arbitrarily precise decimals, and manipulating regular expressions are also included. The standard library is one of Python's greatest strengths. The bulk of it is cross-platform compatible, meaning that even heavily leveraged Python programs can often run on Unix, Windows, Macintosh, and other platforms without change. It is currently being debated whether or not third-party but open source Python modules such as Twisted, NumPy, or wxPython should be included in the standard library, in accordance with the batteries included philosophy. == Python应用 == === Educational uses of Python === As of 2005, Python is getting more popular for teaching computer programming. Its strengths for teaching include its syntactic simplicity, flexible typing, and interactive interpreter. Python uses far fewer symbols than languages like Java and C. For example blocks inside loops and IF statements are indicated by indentation rather than curly braces ({}), and the end of a line does not have to have a semicolon. Beginning students often have initial trouble with memorizing where curly braces and semi-colons go. With Python students can skip directly to the fun part of writing code that does something. Similarly, with Java, and C++, variables types must be declared before being used. That is not needed in Python which again allows students to quickly get to the interesting part of getting their program to do something. The interactive interpreter is an extremely valuable aid to learning and experimentation. Learning-by-doing is about trying things out and seeing what happens. The faster you can get results from your experiment, the faster that learning produces results. Experience has shown that the interactive interpreter and lack of a compiler really speeds up the learning process, both for beginners and for pros who are learning a new library and such. === Major organizations using Python === * Google uses Python for many tasks including the backends of web apps such as Gmail and Google Maps and for many of its search-engine internals. * NASA is using Python to implement a CAD/CAE/PDM repository and model management, integration, and transformation system which will be the core infrastructure for its next generation collaborative engineering environment. === Software written in Python === * BitTorrent, the original implementation and several derivatives * Chandler, a personal information manager including calendar, email, tasks and notes support that is currently under development * Civilization IV videogame and the newly released computer game uses boost.python to allow the Python programming language access to many parts of the game (including the style and content of all interface screens) * Mailman, one of the more popular packages for running email mailing lists * Kombilo, go games' database manager and browser. * MoinMoin, a popular wiki engine in Python * OpenRPG, a virtual table on which to play Role Playing Games over the internet * Plone, a user-friendly and powerful open source Content Management System * Portage, the heart of Gentoo Linux. An advanced package management system based on the *BSD style ports system * Solipsis, a system for massively shared virtual world * Trac, bug/issue tracking database, integrated with MoinMoin wiki and Subversion source version control * Turbogears, an application framework composed of Cherrypy, SQLObject, MochiKit, and KID templates * Vampire: The Masquerade - Bloodlines, a videogame, uses Python for game scripting * ViewVC, a web-based interface for browsing CVS and SVN repositories * Zope, an object-oriented web-application platform. Zope includes an application server with an integrated object-oriented database and a built-in web-based management interface * Battlefield 2, a first person shooter that uses python for its configuration scripts * Indian Ocean Tsunami Detector, a free mobile phone software for tsunami prediction. * EVE Online, a space Multi Massive Online Role Playing Game, the highest-ranked MMORPG on MMORPG.com * SPE - Stani's Python Editor, a free, open-source Python IDE for Windows, Linux & Mac with wxGlade (GUI designer), PyChecker (Code Doctor) and Blender (3D) support. === Packages for Python === The Python Cheese Shop and Vaults of Parnassus are two primary directories of hundreds of Python packages * matplotlib, an extension providing matlab-like plotting and mathematical functions * Numeric Python, a language extension that adds support for large, multi-dimensional arrays and matrices * SciPy, a library of scientific and numerical routines * SimPy, a discrete-event simulation package; * Biopython, an international association of developers of freely available Python tools for computational molecular biology. * PyOpenGL, a package that allows 3D rendering using Python * Soya 3D, a high-level 3D game engin |
== Python数据处理 == * [[https://radimrehurek.com/data_science_python/|Practical Data Science in Python]] |
Python
Python教程:Python游戏开发基础
Python介绍 from Wikipedia
1. 参考资料
Wikipedia:Python_programming_language (Wikipedia上的Python编程语言简介)
A Byte of Python (中文版: 简明Python教程)
Python Reference Manual (中文版: Python语言参考手册 )
One Day of IDLE Toying (中文版: 摆弄一天IDLE)
How to Think Like a Computer Scientist (Learning with Python)
Python 101 -- Introduction to Python Python 201 -- (Slightly) Advanced Python Topics
2. 入门教程
awesome python https://github.com/vinta/awesome-python
Python语法 from Wikipedia
Why_Python by Eric Raymond why python中文版
Python_Advocacy_HOWTO by A.M. Kuchling
另类的Python教程: 我的名字叫Python.pdf
python 与 COM Advanced Python and COM
Using IDLE: idleUse05b.zip
Learning to Program: attachment: http://www.freenetpages.co.uk/hp/alan.gauld/
Learn To Program CD: LearnToProgramCD.zip
Tkinter Life Preserver: http://www.python.org/doc/life-preserver/
Python介绍视频Introducing Python
3. python游戏相关
pygame: http://www.pygame.org/
panda3d: http://www.panda3d.org/
4. Python与正则表达式
- Mastering Regular Expressions 2nd Edition, By Jeffrey E. F. Friedl