-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPython.html
More file actions
173 lines (147 loc) · 14.7 KB
/
Python.html
File metadata and controls
173 lines (147 loc) · 14.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<html>
<head>
<title>Python</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<style>
* { margin: 0; padding: 0;}
ul { list-style-type: none;}
.slide { width: 500px; height: 250px; margin: 0 auto;}
</style>
<head/>
<body>
<!--Navigation Bar-->
<div class="page">
<header id="header">
<hgrounp class="white blank"></hgrounp>
</header>
<section class="demo">
<ul class="nav black">
<li><a href="Index.html">Home</a></li>
<li><a href="contacts.html">Contacts</a></li>
<li><a href="Python.html">Python</a></li>
<li><a href="">C</a></li>
<li><a href="">JAVA</a></li>
<li><a href="">C++</a></li>
<li><a href="http://dst.uic.edu.hk/cn/data-science"><img src="images/CDS.png" width="20" height="20" align ="right"></a><li>
</ul>
</section>
</div>
<h1>
<br/>
<div class="Gallary"><a href="https://www.python.org"><img src="myimages/Python.jpg" width="600" height="337.5"></a></div>
</h1>
<br/>
<br/>
<h2>Introduction</h2>
<img src="myimages/Python-logo.png" align ="right">
<p>Python is a widely used high-level programming language for general-purpose programming. An interpreted language, Python has a design philosophy that emphasizes code readability (notably using whitespace indentation to delimit code blocks rather than curly brackets or keywords), and a syntax that allows programmers to express concepts in fewer lines of code than might be used in languages such as C++ or Java. The language provides constructs intended to enable writing clear programs on both a small and large scale.
</p>
<p>Python is intended to be a highly readable language. It is designed to have an uncluttered visual layout, often using English keywords where other languages use punctuation. Python does not use curly brackets to delimit blocks, and semicolons after statements are optional, in contrast to many other programming languages. Further, Python has fewer syntactic exceptions and special cases than C or Pascal. That may be the reason why Python is popular.
</p>
<br/>
<br/>
<h3>History</h3>
<img src="myimages/Guido.png" align ="left">
<p>Python was conceived in the late 1980s, and its implementation began in December 1989 by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a successor to the ABC language (itself inspired by SETL) capable of exception handling and interfacing with the operating system Amoeba. Van Rossum is Python’s principal author, and his continuing central role in deciding the direction of Python is reflected in the title given to him by the Python community, Benevolent Dictator For Life (BDFL).
</p>
<br/>
<p>About the origin of Python, Van Rossum wrote in 1996:</p>
<p>Over six years ago, in December 1989, I was looking for a hobby programming project that would keep me occupied during the week around Christmas. My office ... would be closed, but I had a home computer, and not much else on my hands. I decided to write an interpreter for the new scripting language I had been thinking about lately: a descendant of ABC that would appeal to Unix/C hackers. I chose Python as a working title for the project, being in a slightly irreverent mood (and a big fan of Monty Python’s Flying Circus).
</p>
<p> Python 2.0 was released on 16 October 2000 and had many major new features, including a cycle-detecting garbage collector and support for Unicode. With this release the development process was changed and became more transparent and community-backed.
</p>
<p> Python 3.0 (initially described as Python 3000 or py3k), is a major, backward-incompatible release that was released after a long period of testing on 3 December 2008. Many of its major features have been backported to the backwards-compatible Python 2.6.x and 2.7.x version series.
</p>
<img src="myimages/P1.png" align ="right">
<p> The End Of Life date (EOL, sunset date) for Python 2.7 was initially set at 2015, then postponed to 2020 out of concern that a large body of existing code cannot easily be forward-ported to Python 3. In January 2017, Google announced work on a Python 2.7 to go transcompiler, which The Register speculated was in response to Python 2.7’s planned end-of-life but Google cited performance under concurrent workloads as their only motivation.
</p>
<br/>
<br/>
<h4>Libraries</h4>
<p>Python’s large standard library, commonly cited as one of its greatest strengths, provides tools suited to many tasks. For Internet-facing applications, many standard formats and protocols such as MIME and HTTP are supported. It includes modules for creating graphical user interfaces, connecting to relational databases, generating pseudorandom numbers, arithmetic with arbitrary precision decimals, manipulating regular expressions, and unit testing.</p>
<p>Some parts of the standard library are covered by specifications (for example, the Web Server Gateway Interface (WSGI) implementation wsgiref follows PEP 333), but most modules are not. They are specified by their code, internal documentation, and test suites (if supplied). However, because most of the standard library is cross-platform Python code, only a few modules need altering or rewriting for variant implementations.</p>
<p>As of September 2017, the Python Package Index, the official repository for third-party Python software, contains over 117,000 packages with a wide range of functionality, including:</p>
<img src="myimages/P2.png" align ="right">
<ul><p>· Graphical user interfaces</p>
<p>· Web frameworks</p>
<p>· Multimedia</p>
<p>· Databases</p>
<p>· Networking</p>
<p>· Test frameworks</p>
<p>· Automation</p>
<p>· Web scraping</p>
<p>· Documentation</p>
<p>· System administration</p>
<p>· Scientific computing</p>
<p>· Text processing</p>
<p>· Image processing</p>
<br/>
<br/>
<h1>Development environments</h1>
<p>Most Python implementations (including CPython) include a read–eval–print loop (REPL), permitting them to function as a command line interpreter for which the user enters statements sequentially and receives results immediately.
</p>
<p>Other shells, including IDLE and IPython, add further abilities such as auto-completion, session state retention and syntax highlighting.
</p>
<p>As well as standard desktop integrated development environments (see Wikipedia’s "Python IDE" article), there are Web browser-based IDEs; SageMath (intended for developing science and math-related Python programs); PythonAnywhere, a browser-based IDE and hosting environment; and Canopy IDE, a commercial Python IDE emphasizing scientific computing.</p>
<p> See also: <a href="https://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#Python"; style="color:#8A9FA1;"> Comparison of integrated development environments § Python</a></p>
<br/>
<br/>
<h1>Comparing Python To Other Languages</h1>
<p align ="right">This essay was written sometime in 1997. It shows its age. <br/>It is retained here merely as a historical artifact. <br/>--Guido van Rossum</p>
<!--Slide-->
<div class="slide slider--animated" data-slidizle>
<ul data-slidizle-content>
<li style="background-image: url('myimages/vsjava.jpg')"></li>
<li style="background-image: url('myimages/Javascript.jpg')"></li>
<li style="background-image: url('myimages/perl.jpg')"></li>
<li style="background-image: url('myimages/tcl.jpg')"></li>
<li style="background-image: url('images/C++.jpg')"></li>
</ul>
<div data-slidizle-next>
<i class="fa fa-arrow-right"></i>
</div>
<div data-slidizle-previous>
<i class="fa fa-arrow-left"></i>
</div>
<ul data-slidizle-navigation></ul>
</div>
<br/>
<p><strong>Java</strong></p>
<p>Python programs are generally expected to run slower than Java programs, but they also take much less time to develop. Python programs are typically 3-5 times shorter than equivalent Java programs. This difference can be attributed to Python’s built-in high-level data types and its dynamic typing. For example, a Python programmer wastes no time declaring the types of arguments or variables, and Python’s powerful polymorphic list and dictionary types, for which rich syntactic support is built straight into the language, find a use in almost every Python program. Because of the run-time typing, Python’s run time must work harder than Java’s. For example, when evaluating the expression a+b, it must first inspect the objects a and b to find out their type, which is not known at compile time. It then invokes the appropriate addition operation, which may be an overloaded user-defined method. Java, on the other hand, can perform an efficient integer or floating point addition, but requires variable declarations for a and b, and does not allow overloading of the + operator for instances of user-defined classes.
</p>
<p>For these reasons, Python is much better suited as a "glue" language, while Java is better characterized as a low-level implementation language. In fact, the two together make an excellent combination. Components can be developed in Java and combined to form applications in Python; Python can also be used to prototype components until their design can be "hardened" in a Java implementation. To support this type of development, a Python implementation written in Java is under development, which allows calling Python code from Java and vice versa. In this implementation, Python source code is translated to Java bytecode (with help from a run-time library to support Python"s dynamic semantics).</p>
<br/>
<p><strong>Javascript</strong></p>
<p>Python’s "object-based" subset is roughly equivalent to JavaScript. Like JavaScript (and unlike Java), Python supports a programming style that uses simple functions and variables without engaging in class definitions. However, for JavaScript, that’s all there is. Python, on the other hand, supports writing much larger programs and better code reuse through a true object-oriented programming style, where classes and inheritance play an important role.</p>
<br/>
<p><strong>Perl</strong></p>
<p>Python and Perl come from a similar background (Unix scripting, which both have long outgrown), and sport many similar features, but have a different philosophy. Perl emphasizes support for common application-oriented tasks, e.g. by having built-in regular expressions, file scanning and report generating features. Python emphasizes support for common programming methodologies such as data structure design and object-oriented programming, and encourages programmers to write readable (and thus maintainable) code by providing an elegant but not overly cryptic notation. As a consequence, Python comes close to Perl but rarely beats it in its original application domain; however Python has an applicability well beyond Perl’s niche.</p>
<br/>
<img src="myimages/Comparing.png" align="right">
<p><strong>Tcl</strong></p>
<p>Like Python, Tcl is usable as an application extension language, as well as a stand-alone programming language. However, Tcl, which traditionally stores all data as strings, is weak on data structures, and executes typical code much slower than Python. Tcl also lacks features needed for writing large programs, such as modular namespaces. Thus, while a "typical" large application using Tcl usually contains Tcl extensions written in C or C++ that are specific to that application, an equivalent Python application can often be written in "pure Python". Of course, pure Python development is much quicker than having to write and debug a C or C++ component. It has been said that Tcl’s one redeeming quality is the Tk toolkit. Python has adopted an interface to Tk as its standard GUI component library.</p>
<p>Tcl 8.0 addresses the speed issuse by providing a bytecode compiler with limited data type support, and adds namespaces. However, it is still a much more cumbersome programming language.</p>
<br/>
<p><strong>C++</strong></p>
<p>Almost everything said for Java also applies for C++, just more so: where Python code is typically 3-5 times shorter than equivalent Java code, it is often 5-10 times shorter than equivalent C++ code! Anecdotal evidence suggests that one Python programmer can finish in two months what two C++ programmers can't complete in a year. Python shines as a glue language, used to combine components written in C++.</p>
<br/>
<br/>
<h1 class="in-point">References</h1>
<p>1. <a href="http://python-history.blogspot.com/2009/01/brief-timeline-of-python.html"; style="color:#8A9FA1;">The History of Python: A Brief Timeline of Python".</a> Blogger. 20 January 2009. Retrieved 20 March 2016.</p>
<p>2. <a href="https://en.wikipedia.org/wiki/Python_(programming_language)"; style="color:#8A9FA1;">Python - Wikipedia</a> 2017</p>
<p>3.<a href="https://www.python.org/doc/essays/comparisons/"; style="color:#8A9FA1;">Guido van Rossum: Comparing Python to Other Languages</a><p>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.slidizle.js"></script>
<script>
$(function() {
$('.slide').slidizle();
});
</script>
</body>
</html>