Python: Difference between revisions
m Created article 'Python' with auto-categories π·οΈ |
m Created article 'Python' with auto-categories π·οΈ |
||
Line 1: | Line 1: | ||
== Introduction == | == Introduction == | ||
'''Python''' is a high-level, interpreted, general-purpose | '''Python''' is a high-level, interpreted, general-purpose programming language known for its readability, simplicity, and versatility. Created by [[Guido van Rossum]] and first released in 1991, Python emphasizes code readability through its use of significant indentation and a clear, expressive syntax. It supports multiple programming paradigms, including [[procedural programming]], [[object-oriented programming]], and [[functional programming]]. Python's extensive standard library and dynamic typing make it a popular choice for a wide range of applications, from web development to scientific computing. | ||
Python | Python is an open-source language with a large, active community that contributes to its development and maintenance. Its design philosophy, summarized in the document ''[[The Zen of Python]]'', prioritizes simplicity and explicitness. Python's interpreter and standard library are available for all major platforms, making it highly portable. | ||
== History or Background == | == History or Background == | ||
Python | === Early Development === | ||
Python was conceived in the late 1980s by Guido van Rossum at the [[Centrum Wiskunde & Informatica]] (CWI) in the Netherlands. Van Rossum aimed to create a successor to the [[ABC (programming language)|ABC]] language that would address its shortcomings while retaining its ease of use. The first public release, Python 0.9.0, was made in February 1991. Key features from this early version included exception handling, functions, and core data types like lists, dictionaries, and strings. | |||
=== Python 2 and Python 3 === | |||
Python 2.0 was released in 2000, introducing features like list comprehensions, a garbage collection system, and Unicode support. Python 3.0, released in 2008, was a major revision that was not backward-compatible with Python 2. This decision was made to eliminate inconsistencies and redundant features. The transition from Python 2 to Python 3 was gradual, with Python 2 reaching end-of-life on January 1, 2020. | |||
=== | === Community and Governance === | ||
Python's development is managed by the [[Python Software Foundation]] (PSF), a non-profit organization that oversees the language's direction and promotes its adoption. The language's evolution is guided by [[Python Enhancement Proposals]] (PEPs), which document new features, standards, and best practices. PEP 8, for example, defines Python's style guide. | |||
Β | |||
== Technical Details or Architecture == | == Technical Details or Architecture == | ||
=== Syntax and Semantics === | === Syntax and Semantics === | ||
Python's syntax is designed | Python's syntax is designed to be intuitive and readable. Key characteristics include: | ||
* '''Indentation''': Python uses whitespace indentation to delimit code blocks, unlike many languages that use braces or keywords. | |||
* '''Dynamic Typing''': Variables are not explicitly declared; their type is inferred at runtime. | |||
* '''First-Class Functions''': Functions are treated as objects, allowing them to be passed as arguments or returned from other functions. | |||
* '''Garbage Collection''': Python uses automatic memory management via reference counting and a cycle-detecting garbage collector. | |||
=== Standard Library === | |||
* | Python's standard library includes modules for: | ||
* | * File I/O (e.g., [[os module|os]], [[sys module|sys]]) | ||
* | * Data serialization (e.g., [[pickle module|pickle]], [[json module|json]]) | ||
* | * Networking (e.g., [[socket module|socket]], [[http module|http]]) | ||
* Concurrent execution (e.g., [[threading module|threading]], [[asyncio module|asyncio]]) | |||
=== | === Implementation === | ||
Python | The reference implementation of Python, [[CPython]], is written in C and compiles Python code to bytecode, which is executed by the Python virtual machine. Other implementations include: | ||
* | * [[Jython]]: Runs on the [[Java Virtual Machine]] (JVM) | ||
* | * [[IronPython]]: Integrates with the [[.NET Framework]] | ||
* | * [[PyPy]]: Features a [[just-in-time compilation|JIT]] compiler for improved performance | ||
== Applications or Use Cases == | == Applications or Use Cases == | ||
Python | === Web Development === | ||
Python is widely used in web development, with frameworks such as: | |||
* [[Django (web framework)|Django]]: A high-level framework for rapid development | |||
* [[Flask (web framework)|Flask]]: A lightweight microframework | |||
* [[FastAPI]]: A modern framework for building APIs | |||
Popular websites built with Python include [[Instagram]], [[Pinterest]], and [[Spotify]]. | |||
=== Data Science and Machine Learning === | === Data Science and Machine Learning === | ||
Python is a dominant language in data science due to libraries like: | |||
* | * [[NumPy]]: For numerical computing | ||
* | * [[Pandas (software)|Pandas]]: For data manipulation | ||
* | * [[Matplotlib]]: For data visualization | ||
* | * [[Scikit-learn]]: For machine learning | ||
Β | * [[TensorFlow]] and [[PyTorch]]: For deep learning | ||
=== Automation and Scripting === | === Automation and Scripting === | ||
Python | Python is commonly used for: | ||
* System administration tasks | |||
* Web scraping (e.g., with [[Beautiful Soup]] or [[Scrapy]]) | |||
* Test automation (e.g., [[Selenium (software)|Selenium]]) | |||
=== Scientific Computing === | === Scientific Computing === | ||
Python is used in fields like physics, biology, and astronomy, with tools such as: | |||
* [[SciPy]]: For scientific computing | |||
* [[Astropy]]: For astronomy | |||
=== Game Development === | === Game Development === | ||
Python is used in game development with libraries like: | |||
* [[Pygame]]: For 2D games | |||
* [[Panda3D]]: For 3D games | |||
== Relevance in Computing or Industry == | == Relevance in Computing or Industry == | ||
Python's popularity | Python's popularity has grown steadily due to its ease of use and versatility. It consistently ranks among the top programming languages in indices like the [[TIOBE Index]] and the [[PYPL PopularitY of Programming Language Index]]. Major tech companies, including [[Google]], [[Facebook]], and [[Netflix]], use Python for various applications. | ||
Β | |||
=== Education === | |||
Python is often recommended as a first programming language due to its simple syntax and readability. It is widely taught in schools and universities. | |||
=== Industry Adoption === | === Industry Adoption === | ||
* | Python is used in: | ||
* | * Finance: For algorithmic trading and risk management | ||
* | * Healthcare: For data analysis and bioinformatics | ||
Β | * Entertainment: For visual effects and animation (e.g., [[Blender (software)|Blender]] uses Python for scripting) | ||
== See also == | == See also == | ||
Line 89: | Line 92: | ||
== References == | == References == | ||
* [https://www.python.org/ Official Python Website] | * [https://www.python.org/ Official Python Website] | ||
* [https://docs.python.org/3/ | * [https://docs.python.org/3/ Python Documentation] | ||
* [https://peps.python.org/ Python Enhancement Proposals (PEPs)] | |||
* [https://wiki.python.org/moin/ Python Wiki] | * [https://wiki.python.org/moin/ Python Wiki] | ||
[[Category:Programming languages]] | [[Category:Programming languages]] | ||
[[Category:High-level programming languages]] | [[Category:High-level programming languages]] | ||
[[Category: | [[Category:Interpreted programming languages]] |
Revision as of 05:10, 6 July 2025
Introduction
Python is a high-level, interpreted, general-purpose programming language known for its readability, simplicity, and versatility. Created by Guido van Rossum and first released in 1991, Python emphasizes code readability through its use of significant indentation and a clear, expressive syntax. It supports multiple programming paradigms, including procedural programming, object-oriented programming, and functional programming. Python's extensive standard library and dynamic typing make it a popular choice for a wide range of applications, from web development to scientific computing.
Python is an open-source language with a large, active community that contributes to its development and maintenance. Its design philosophy, summarized in the document The Zen of Python, prioritizes simplicity and explicitness. Python's interpreter and standard library are available for all major platforms, making it highly portable.
History or Background
Early Development
Python was conceived in the late 1980s by Guido van Rossum at the Centrum Wiskunde & Informatica (CWI) in the Netherlands. Van Rossum aimed to create a successor to the ABC language that would address its shortcomings while retaining its ease of use. The first public release, Python 0.9.0, was made in February 1991. Key features from this early version included exception handling, functions, and core data types like lists, dictionaries, and strings.
Python 2 and Python 3
Python 2.0 was released in 2000, introducing features like list comprehensions, a garbage collection system, and Unicode support. Python 3.0, released in 2008, was a major revision that was not backward-compatible with Python 2. This decision was made to eliminate inconsistencies and redundant features. The transition from Python 2 to Python 3 was gradual, with Python 2 reaching end-of-life on January 1, 2020.
Community and Governance
Python's development is managed by the Python Software Foundation (PSF), a non-profit organization that oversees the language's direction and promotes its adoption. The language's evolution is guided by Python Enhancement Proposals (PEPs), which document new features, standards, and best practices. PEP 8, for example, defines Python's style guide.
Technical Details or Architecture
Syntax and Semantics
Python's syntax is designed to be intuitive and readable. Key characteristics include:
- Indentation: Python uses whitespace indentation to delimit code blocks, unlike many languages that use braces or keywords.
- Dynamic Typing: Variables are not explicitly declared; their type is inferred at runtime.
- First-Class Functions: Functions are treated as objects, allowing them to be passed as arguments or returned from other functions.
- Garbage Collection: Python uses automatic memory management via reference counting and a cycle-detecting garbage collector.
Standard Library
Python's standard library includes modules for:
- File I/O (e.g., os, sys)
- Data serialization (e.g., pickle, json)
- Networking (e.g., socket, http)
- Concurrent execution (e.g., threading, asyncio)
Implementation
The reference implementation of Python, CPython, is written in C and compiles Python code to bytecode, which is executed by the Python virtual machine. Other implementations include:
- Jython: Runs on the Java Virtual Machine (JVM)
- IronPython: Integrates with the .NET Framework
- PyPy: Features a JIT compiler for improved performance
Applications or Use Cases
Web Development
Python is widely used in web development, with frameworks such as:
- Django: A high-level framework for rapid development
- Flask: A lightweight microframework
- FastAPI: A modern framework for building APIs
Popular websites built with Python include Instagram, Pinterest, and Spotify.
Data Science and Machine Learning
Python is a dominant language in data science due to libraries like:
- NumPy: For numerical computing
- Pandas: For data manipulation
- Matplotlib: For data visualization
- Scikit-learn: For machine learning
- TensorFlow and PyTorch: For deep learning
Automation and Scripting
Python is commonly used for:
- System administration tasks
- Web scraping (e.g., with Beautiful Soup or Scrapy)
- Test automation (e.g., Selenium)
Scientific Computing
Python is used in fields like physics, biology, and astronomy, with tools such as:
Game Development
Python is used in game development with libraries like:
Relevance in Computing or Industry
Python's popularity has grown steadily due to its ease of use and versatility. It consistently ranks among the top programming languages in indices like the TIOBE Index and the PYPL PopularitY of Programming Language Index. Major tech companies, including Google, Facebook, and Netflix, use Python for various applications.
Education
Python is often recommended as a first programming language due to its simple syntax and readability. It is widely taught in schools and universities.
Industry Adoption
Python is used in:
- Finance: For algorithmic trading and risk management
- Healthcare: For data analysis and bioinformatics
- Entertainment: For visual effects and animation (e.g., Blender uses Python for scripting)
See also
- Comparison of programming languages
- List of Python software
- Python Software Foundation
- History of Python