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 [[programming language]] known for its readability and | '''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 clean, English-like syntax. It supports multiple [[programming paradigms]], including [[procedural programming|procedural]], [[object-oriented programming|object-oriented]], and [[functional programming|functional]] styles. | ||
Python | Python's design philosophy prioritizes simplicity and clarity, often summarized by the phrase "There should be oneβand preferably only oneβobvious way to do it." This principle, along with its extensive [[standard library]] and vibrant [[open-source]] ecosystem, has made Python one of the most popular programming languages worldwide. It is widely used in fields such as [[web development]], [[data science]], [[artificial intelligence]], [[automation]], and [[scientific computing]]. | ||
== History or Background == | == History or Background == | ||
Python | Python's development began in the late 1980s when Guido van Rossum, then working at the [[Centrum Wiskunde & Informatica]] (CWI) in the Netherlands, sought to create a successor to the [[ABC (programming language)|ABC]] language. Van Rossum aimed to address ABC's shortcomings while retaining its ease of use. The language was named after the British comedy group [[Monty Python]], reflecting van Rossum's fondness for their work. | ||
The first public release, Python 0.9.0, was made available in February 1991. Key features included exception handling, functions, and core data types like lists, dictionaries, and strings. Python 1.0, released in 1994, introduced functional programming tools such as <code>lambda</code>, <code>map</code>, and <code>filter</code>. | |||
=== Major Milestones === | |||
* '''Python 2.0 (2000)''': Introduced list comprehensions, garbage collection, and Unicode support. | |||
* '''Python 3.0 (2008)''': A major, backward-incompatible release that removed redundancies and improved consistency. Key changes included print as a function, Unicode as the default string type, and the <code>bytes</code> type for binary data. | |||
* '''End of Python 2 (2020)''': Official support for Python 2 ended, encouraging migration to Python 3. | |||
Β | |||
Python is now developed under the oversight of the [[Python Software Foundation]] (PSF), a non-profit organization that manages the language's intellectual property and supports its community. | |||
== Technical Details or Architecture == | == Technical Details or Architecture == | ||
Python is an [[interpreted language]], meaning that code is executed line-by-line by the Python interpreter rather than being compiled into machine code beforehand. The default implementation, [[CPython]], is written in [[C (programming language)|C]] and serves as the reference implementation. Other implementations include: | |||
* '''[[Jython]]''': Runs on the [[Java Virtual Machine]] (JVM). | |||
* '''[[IronPython]]''': Integrates with the [[.NET Framework]]. | |||
* '''[[PyPy]]''': Uses a [[just-in-time compilation|JIT]] compiler for improved performance. | |||
=== Syntax and Semantics === | === Syntax and Semantics === | ||
Python's syntax is designed to | Python's syntax is designed for readability, using indentation to define code blocks instead of braces or keywords. For example: | ||
<syntaxhighlight lang="python"> | |||
Β | |||
def greet(name): | def greet(name): | ||
Β Β Β print(f"Hello, {name}!") | Β Β Β print(f"Hello, {name}!") | ||
</syntaxhighlight> | |||
Key language features include: | |||
Β | * '''Dynamic typing''': Variables do not require explicit type declarations. | ||
* '''Garbage collection''': Automatic memory management via reference counting. | |||
* '''Duck typing''': Objects are judged by their methods and properties rather than their type. | |||
Β | * '''First-class functions''': Functions can be passed as arguments or returned as values. | ||
* ''' | |||
* ''' | |||
* ''' | |||
=== Standard Library === | === Standard Library === | ||
Python's [[standard library]] includes modules for: | Python's [[standard library]] includes modules for: | ||
* File I/O ( | * File I/O (<code>os</code>, <code>sys</code>) | ||
* | * Networking (<code>socket</code>, <code>http.client</code>) | ||
* | * Data serialization (<code>json</code>, <code>pickle</code>) | ||
* | * Concurrent execution (<code>threading</code>, <code>asyncio</code>) | ||
== Applications or Use Cases == | == Applications or Use Cases == | ||
Python's versatility makes it suitable for a | Python's versatility makes it suitable for a wide range of applications: | ||
=== Web Development === | === Web Development === | ||
Frameworks like [[Django (web framework)|Django]] and [[Flask (web framework)|Flask]] | Frameworks like [[Django (web framework)|Django]] and [[Flask (web framework)|Flask]] simplify building scalable web applications. Django, for example, includes an [[Object-Relational Mapping|ORM]], authentication, and an admin interface out-of-the-box. | ||
=== Data Science and Machine Learning === | === Data Science and Machine Learning === | ||
Libraries | Libraries such as: | ||
* '''[[NumPy]]''': For numerical computing. | |||
* '''[[Pandas (software)|Pandas]]''': For data manipulation. | |||
* '''[[scikit-learn]]''': For machine learning. | |||
* '''[[TensorFlow]]''' and '''[[PyTorch]]''': For deep learning. | |||
Python is the dominant language in [[data science]], used by companies like [[Google]], [[Facebook]], and [[Netflix]]. | |||
Python is | |||
=== Automation and Scripting === | === Automation and Scripting === | ||
Python's simplicity makes it ideal for writing scripts to automate repetitive tasks, such as file | Python's simplicity makes it ideal for writing scripts to automate repetitive tasks, such as file processing or web scraping with libraries like [[Beautiful Soup]]. | ||
Β | |||
=== Scientific Computing === | |||
Used in fields like [[physics]], [[biology]], and [[astronomy]] through tools like [[SciPy]] and [[Astropy]]. | |||
=== Game Development === | === Game Development === | ||
Libraries like [[Pygame]] and engines like [[Godot (game engine)|Godot]] support game development. | |||
== Relevance in Computing or Industry == | == Relevance in Computing or Industry == | ||
Python's popularity | Python's popularity stems from its balance of simplicity and power. According to indices like the [[TIOBE Index]] and [[Stack Overflow Developer Survey]], Python consistently ranks among the top programming languages. | ||
Β | |||
Β | |||
Β | |||
Β | |||
=== | === Industry Adoption === | ||
* ''' | * '''Tech Giants''': Google, Facebook, and Amazon use Python for backend services, data analysis, and AI. | ||
* ''' | * '''Finance''': Banks and hedge funds employ Python for quantitative analysis and algorithmic trading. | ||
* '''Education''': Python is often the first language taught in universities due to its readability. | |||
== | === Community and Ecosystem === | ||
Β | Python's open-source community contributes thousands of third-party packages via the [[Python Package Index]] (PyPI). Tools like [[pip (package manager)|pip]] simplify package management, while platforms like [[GitHub]] host collaborative projects. | ||
== See also == | == See also == | ||
* [[Comparison of programming languages]] | |||
* [[List of Python software]] | * [[List of Python software]] | ||
* [[Python Software Foundation]] | * [[Python Software Foundation]] | ||
* [[History of | * [[History of Python]] | ||
== References == | == References == | ||
Β | <references> | ||
<references | * [https://www.python.org/ Official Python Website] | ||
* [https://docs.python.org/3/tutorial/ Python Documentation] | |||
* [https://wiki.python.org/moin/ Python Wiki] | |||
* Van Rossum, G. (1995). "Python Tutorial". Technical Report CS-R9526, CWI. | |||
</references> | |||
[[Category:Programming languages]] | [[Category:Programming languages]] | ||
[[Category:High-level programming languages]] | [[Category:High-level programming languages]] | ||
[[Category: | [[Category:Scripting languages]] |
Revision as of 05:07, 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 clean, English-like syntax. It supports multiple programming paradigms, including procedural, object-oriented, and functional styles.
Python's design philosophy prioritizes simplicity and clarity, often summarized by the phrase "There should be oneβand preferably only oneβobvious way to do it." This principle, along with its extensive standard library and vibrant open-source ecosystem, has made Python one of the most popular programming languages worldwide. It is widely used in fields such as web development, data science, artificial intelligence, automation, and scientific computing.
History or Background
Python's development began in the late 1980s when Guido van Rossum, then working at the Centrum Wiskunde & Informatica (CWI) in the Netherlands, sought to create a successor to the ABC language. Van Rossum aimed to address ABC's shortcomings while retaining its ease of use. The language was named after the British comedy group Monty Python, reflecting van Rossum's fondness for their work.
The first public release, Python 0.9.0, was made available in February 1991. Key features included exception handling, functions, and core data types like lists, dictionaries, and strings. Python 1.0, released in 1994, introduced functional programming tools such as lambda
, map
, and filter
.
Major Milestones
- Python 2.0 (2000): Introduced list comprehensions, garbage collection, and Unicode support.
- Python 3.0 (2008): A major, backward-incompatible release that removed redundancies and improved consistency. Key changes included print as a function, Unicode as the default string type, and the
bytes
type for binary data. - End of Python 2 (2020): Official support for Python 2 ended, encouraging migration to Python 3.
Python is now developed under the oversight of the Python Software Foundation (PSF), a non-profit organization that manages the language's intellectual property and supports its community.
Technical Details or Architecture
Python is an interpreted language, meaning that code is executed line-by-line by the Python interpreter rather than being compiled into machine code beforehand. The default implementation, CPython, is written in C and serves as the reference implementation. Other implementations include:
- Jython: Runs on the Java Virtual Machine (JVM).
- IronPython: Integrates with the .NET Framework.
- PyPy: Uses a JIT compiler for improved performance.
Syntax and Semantics
Python's syntax is designed for readability, using indentation to define code blocks instead of braces or keywords. For example: <syntaxhighlight lang="python"> def greet(name):
print(f"Hello, {name}!")
</syntaxhighlight>
Key language features include:
- Dynamic typing: Variables do not require explicit type declarations.
- Garbage collection: Automatic memory management via reference counting.
- Duck typing: Objects are judged by their methods and properties rather than their type.
- First-class functions: Functions can be passed as arguments or returned as values.
Standard Library
Python's standard library includes modules for:
- File I/O (
os
,sys
) - Networking (
socket
,http.client
) - Data serialization (
json
,pickle
) - Concurrent execution (
threading
,asyncio
)
Applications or Use Cases
Python's versatility makes it suitable for a wide range of applications:
Web Development
Frameworks like Django and Flask simplify building scalable web applications. Django, for example, includes an ORM, authentication, and an admin interface out-of-the-box.
Data Science and Machine Learning
Libraries such as:
- NumPy: For numerical computing.
- Pandas: For data manipulation.
- scikit-learn: For machine learning.
- TensorFlow and PyTorch: For deep learning.
Python is the dominant language in data science, used by companies like Google, Facebook, and Netflix.
Automation and Scripting
Python's simplicity makes it ideal for writing scripts to automate repetitive tasks, such as file processing or web scraping with libraries like Beautiful Soup.
Scientific Computing
Used in fields like physics, biology, and astronomy through tools like SciPy and Astropy.
Game Development
Libraries like Pygame and engines like Godot support game development.
Relevance in Computing or Industry
Python's popularity stems from its balance of simplicity and power. According to indices like the TIOBE Index and Stack Overflow Developer Survey, Python consistently ranks among the top programming languages.
Industry Adoption
- Tech Giants: Google, Facebook, and Amazon use Python for backend services, data analysis, and AI.
- Finance: Banks and hedge funds employ Python for quantitative analysis and algorithmic trading.
- Education: Python is often the first language taught in universities due to its readability.
Community and Ecosystem
Python's open-source community contributes thousands of third-party packages via the Python Package Index (PyPI). Tools like pip simplify package management, while platforms like GitHub host collaborative projects.
See also
- Comparison of programming languages
- List of Python software
- Python Software Foundation
- History of Python
References
<references>
- Official Python Website
- Python Documentation
- Python Wiki
- Van Rossum, G. (1995). "Python Tutorial". Technical Report CS-R9526, CWI.
</references>