Jump to content

Python: Difference between revisions

From EdwardWiki
Bot (talk | contribs)
m Created article 'Python' with auto-categories 🏷️
Bot (talk | contribs)
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, 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''' 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'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]].
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'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.
=== 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.


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>.
=== 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.


=== Major Milestones ===
=== Community and Governance ===
* '''Python 2.0 (2000)''': Introduced list comprehensions, garbage collection, and Unicode support.
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.
* '''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 for readability, using indentation to define code blocks instead of braces or keywords. For example:
Python's syntax is designed to be intuitive and readable. Key characteristics include:
<syntaxhighlight lang="python">
* '''Indentation''': Python uses whitespace indentation to delimit code blocks, unlike many languages that use braces or keywords.
def greet(name):
* '''Dynamic Typing''': Variables are not explicitly declared; their type is inferred at runtime.
Β  Β  print(f"Hello, {name}!")
* '''First-Class Functions''': Functions are treated as objects, allowing them to be passed as arguments or returned from other functions.
</syntaxhighlight>
* '''Garbage Collection''': Python uses automatic memory management via reference counting and a cycle-detecting garbage collector.


Key language features include:
=== Standard Library ===
* '''Dynamic typing''': Variables do not require explicit type declarations.
Python's standard library includes modules for:
* '''Garbage collection''': Automatic memory management via reference counting.
* File I/O (e.g., [[os module|os]], [[sys module|sys]])
* '''Duck typing''': Objects are judged by their methods and properties rather than their type.
* Data serialization (e.g., [[pickle module|pickle]], [[json module|json]])
* '''First-class functions''': Functions can be passed as arguments or returned as values.
* Networking (e.g., [[socket module|socket]], [[http module|http]])
* Concurrent execution (e.g., [[threading module|threading]], [[asyncio module|asyncio]])


=== Standard Library ===
=== Implementation ===
Python's [[standard library]] includes modules for:
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:
* File I/O (<code>os</code>, <code>sys</code>)
* [[Jython]]: Runs on the [[Java Virtual Machine]] (JVM)
* Networking (<code>socket</code>, <code>http.client</code>)
* [[IronPython]]: Integrates with the [[.NET Framework]]
* Data serialization (<code>json</code>, <code>pickle</code>)
* [[PyPy]]: Features a [[just-in-time compilation|JIT]] compiler for improved performance
* Concurrent execution (<code>threading</code>, <code>asyncio</code>)


== Applications or Use Cases ==
== Applications or Use Cases ==


Python's versatility makes it suitable for a wide range of applications:
=== 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


=== Web Development ===
Popular websites built with Python include [[Instagram]], [[Pinterest]], and [[Spotify]].
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 such as:
Python is a dominant language in data science due to libraries like:
* '''[[NumPy]]''': For numerical computing.
* [[NumPy]]: For numerical computing
* '''[[Pandas (software)|Pandas]]''': For data manipulation.
* [[Pandas (software)|Pandas]]: For data manipulation
* '''[[scikit-learn]]''': For machine learning.
* [[Matplotlib]]: For data visualization
* '''[[TensorFlow]]''' and '''[[PyTorch]]''': For deep learning.
* [[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 ===
=== 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]].
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 ===
Used in fields like [[physics]], [[biology]], and [[astronomy]] through tools like [[SciPy]] and [[Astropy]].
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 ===
Libraries like [[Pygame]] and engines like [[Godot (game engine)|Godot]] support 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 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.
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 ===
* '''Tech Giants''': Google, Facebook, and Amazon use Python for backend services, data analysis, and AI.
Python is used in:
* '''Finance''': Banks and hedge funds employ Python for quantitative analysis and algorithmic trading.
* Finance: For algorithmic trading and risk management
* '''Education''': Python is often the first language taught in universities due to its readability.
* Healthcare: For data analysis and bioinformatics
Β 
* Entertainment: For visual effects and animation (e.g., [[Blender (software)|Blender]] uses Python for scripting)
=== 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 ==
Line 89: Line 92:


== References ==
== References ==
<references>
* [https://www.python.org/ Official Python Website]
* [https://www.python.org/ Official Python Website]
* [https://docs.python.org/3/tutorial/ Python Documentation]
* [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]
* 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:Scripting languages]]
[[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:

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:

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:

Automation and Scripting

Python is commonly used for:

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

References