Python (programming language)

From Uncyclopedia, the content-free encyclopedia

(Difference between revisions)
Jump to: navigation, search
(+AAP: This page needs some images.)
m (Protected "Python (programming language)": Featured article (‎[edit=autoconfirmed] (indefinite) ‎[move=autoconfirmed] (indefinite)))
 
(39 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{AAP}}
+
<div class="nonwhite">[[File:Pylogo.jpg|thumb|right|250px|Python's pretentious logo, representing a union of two "beautiful"<ref>According to Python's developer, Guido van Rossum. ''An Independent Investigation on Why Python Is Better Than Everything Else''. Sumsord, Ovangui.</ref> pythons of opposite sex.]]</div>
{{wikipedia}}
 
   
'''Python''', also known as compilable pseudocode, is a toy programming language notable for its lack of tail recursion, which makes it completely useless for any real world software which is primarily written in [[Lisp]]. It emphasizes programmer efficiency over runtime efficiency which makes it unsuitable to run on modern computers like the [[Commodore 64]]. Python is near as awfull as [[C Sharp|C#]], being roughly equally so popular (see [http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html Tiobe index]).
+
'''Python''', also known as compilable pseudocode, is a toy programming language. It emphasizes programmer efficiency over runtime efficiency<ref>Indeed, Python's runtime efficiency is almost nil. ''The Greatest Invention of the Humanity''. Sumsord, Ovangui.</ref>, making it incompatible with modern computers, such as [[Commodore 64]].
   
 
== History ==
 
== History ==
Python was developed by El Guido del Rosario at the University of Schlonkgingenderhoffderwess in order to catalogue El Guido's personal collection of Dutch cheeses. It was named after famous English writer [[Monty Python|Montague Python Shakespeare]], whose iambic pentameter poetry inspired the language's syntax. Other researchers eventually realized that El Guido's pet language Python was a lot better than the language they were developing, ABC, and kicked El Guido out for being a general smartypants and "taking the piss."
 
   
Dejected, El Guido almost gave up on the language until a strange, foul smelling Japanese researcher named matz encouraged him to continue. matz' motives were not pure, however, for as soon as Python released a stable version matz stole the code, added a bunch of question marks, and called the new language [[Ruby (programming language)|Ruby]].
+
Python was developed by Guido van Rossum. Van Rossum was very disappointed by ABC (programming language), which "did not allow him to perform some main functions due to its complexity and lack of beauty" and thought that a new language would solve his problems. It is not clear, however, whether it is the ABC language that lacked beauty or its developer, whom van Rossum was known to frequent. It is also not clear which functions ABC failed to accomplish. Presumably, it was to store van Rossum's large collection of Dutch cheeses.
   
El Guido continued to develop his language while working for upscale soap manufacturer Zoape. Moving vats of boiling lye and animal fat by day, and coding long into the night, El Guido finally got his language working well enough that one or two newsgroup trolls noticed it. El Guido knew the language was going places when the complaints started. He eventually was dubbed BDFL (Bloodthirsty Dictator For Life) by newsgroup trolls who used Python to code [[Slashdot]] hacking scripts.
+
[[File:Guido van Rossum.jpg|thumb|right|300px|Python's developer, Guido van Rossum, tried to replace the logo of Python with his photo (which many of his female employees found "very nice"), but was discouraged from it by his male colleagues.]]
   
El Guido currently works for bing.com and spends 50% of his time developing Python, the other 50% hauling loads of fresh produce up to Bill Gates' mansion.
+
There are two hypothesizes about the origin of the language's name. Pythoners (Python's followers) believe that it was named after a famous English writer [[Monty Python|Montague Python Shakespeare]], whose iambic pentameter poetry inspired the language's syntax. Critics claim that it was after van Rossum's pet animal. Indeed, the developer told the press that "his python devoured many of his rivals with their programming languages". Presumably, one of these was a Japanese researcher, called Matsumoto, who added some question marks to the code van Rossum was developing and called this new language "[[Ruby (programming language)|Ruby]]".
   
== Getting started ==
+
The fact that van Rossum also possesses a cobra, makes his followers think that he is the developer of a programming language named "Cobra". But these claims have never been justified by evidence. The researchers who tried to investigate the matter died, bitten by an unidentified snake.
In fact, it's very easy, REALLY very very easy to start programming in Python. Here are the steps:
 
   
1. Download ~30 MB installer of the latest version from Python's [http://www.python.org official website].<ref>Non-Windows users may skip these steps and go directly to step 8.</ref>
+
Finally, after years of work with his pet animal, Python gained popularity. Van Rossum started calling himself Python's ''Blood-thirsty Dictator For Life'', and while his fellow programmers agreed that he certainly deserved this title, they shortened it to ''BDFL'', which is now often read as "Benevolent Dictator For Life".
   
2. Realize that you need some more libraries, download ~10 MB GTK installer, PyGTK, etc.
+
== Syntax ==
  +
Python is notable for its use of indentation.
   
3. Fry few eggs.
+
{{CQ|It may confuse at first, but it certainly helps the user to develop his talents, as after using Python for a while, it will be very easy for him to immediately perceive the difference between two and three spaces, an aptitude unavailable to so many others.}}
  +
- states a researcher, Ovangui Sumsord, in his two works: "Independent Investigation on Why Python Is Better Than Everything Else" and "The Greatest Invention of the Humanity'".
   
4. Realize that PyGTK requires earlier version of Python, go back to download site, download that version (another chunk of 30 MB).
+
===Examples===
  +
To illustrate such use of indentation, Sumsord provides an example, which—according to him—was a program created by van Rossum himself, when he was a student. The program would ask for the name of the user's mother and give back the name of the person who slept with her the previous night. This very program was the cause of van Rossum's forced departure from his school and it is considered a masterpiece of programming as it contains only seven lines of code. Actually, it could be even smaller, if it didn't have the for loop, which van Rossum considered important to leave, in order to illustrate all of the functions of his new language.
   
5. Download more and more libraries, BTW downgrading your Python version step by step, until... you understand Micro$oft Window$ is so insuFREAKINGfficient for your tasks!
+
However, it cannot be displayed in this article, due to privacy concerns of people mentioned in it.<ref>In particular of one local in van Rossum's town, who played a major role in the program, as he was known for not being able to sleep two times at the same place.</ref>
   
6. Install Microsoft Visual.NET Studio 2015 President Edition with .NET framework and some managed <s>cheerless crap</s> addons code (~100 GB, [[Cowbell|and moar AND MOAR]]!).
+
There are other examples of Python's simple syntax, easy style and laconism. One of these is a program called "Hello World" and one can find it in the first chapter of ''Python for Dummies'' (written by a team of Pythoners).
  +
<syntaxhighlight lang="python">
  +
#Uncyclopedia "Hello World"
  +
#Quad Licensed under the GPLv3/BSD/Python/CC-BY-NC-SA 2.0
  +
#THIS PROGRAM COMES WITH NO WARRANTY, BECAUSE WE'RE TOO STRESSED TO TROUBLESHOOT YOUR PROBLEMS
  +
x = 3
  +
y = 5
  +
if x + y = 8:
  +
import sys
  +
from sys import *
  +
import os
  +
from os import *
  +
import PySide
  +
from PySide import *
  +
import PySide.QtCore
  +
import PySide.QtNetwork
  +
import cmath
  +
import numpy
  +
import pypolynomial
  +
from pypolynomial import *
  +
import twisted
  +
from twisted import *
  +
import math
  +
from math import *
  +
  +
while x = 3:
  +
  +
class printerunitui(QtGui.QWidget)
  +
   
7. Try to install IronPython so you can write less lines because there are no brackets, but runs 1.7e+5 slower compared to Brainfuck.
+
def __init__(self):
  +
  +
if __name__=__main__:
  +
  +
while y = 5:
  +
  +
for 'x' = 'x':
  +
  +
QtGui.QWidget.__init__(self)
  +
  +
self.setWindowTitle('Printerunit')
   
8. Install [[Linux]] or something X like, download Linux versions of all that stuff.<ref>We would [[Nobody cares|recommend]] you to spend a [[Bullshit|very little]] bit of time and money and download <s>5</s> now even 8 DVD images of [[Debian]] distro.</ref>
+
   
9. ??????
 
   
10. {{C|NO FUCKING}} PROFIT!!!!<ref>OK, I'll tell you why. The 99% probability of your fail is that you forgot to do the step 3 properly - it's the most essential part of the process, because fried albumine contained in omelette stimulates your brains to find the way how to put that fucking [[DRM]] on your source-based program so that it could not be opened and would run only under EULA after the user gets the serial number and activa... OH SHI~!</ref>
+
def metaprinterconsoleunit():
  +
  +
inval = input('Requires input')
  +
  +
if inval = 'yes':
  +
  +
messagestringconstantglobalvalue = 'Hello World'
  +
  +
print(messagestringconstantglobalvalue)
  +
  +
else:
  +
  +
print('Fatal error')
  +
  +
exit()
  +
   
11. Migrate to Lua.
+
printerunitui()
  +
metaprinterconsoleunit().exec()
  +
sys.exit()
  +
</syntaxhighlight>
   
== Syntax ==
+
==="Pythonic propaganda"===
Python is notable for its use of indentation which confuses the lay man but is actually quite logical. In particular, an indent of three spaces represents an 'if' block, and five spaces represents a 'for' loop-- provided there are no tabs in the file in which case one tab is the 'if' block and the 'for' loop is 1/2 tab.
+
[[File:Keep calm and learn Python.jpg|thumb|"This is a poster, that every human should have in his study" - state both Rossum and Sumsord.]]
   
def do_some_python():
+
{{Wikipedia}}
if your_mum:
+
After having used Python for some time, any programmer feels a strong discomfort when using any other computer language. This side-effect was van Rossum's personal idea. It is achieved by a constant enhancement of Python's special features. This method is being referred to as "Pythonic propaganda", as the user is often unaware of this enhancement or of his addiction to the language.
for person in your_mum.who_did_her?():
 
if person is self:
 
print "I did your mum!"
 
else:
 
print idiot!
 
   
  +
For instance, semicolons, very useful in other languages, are absent from Python. They can always be added to the program, but each new semicolon delays the code by half a second, when it is being run. The only explanation provided by van Rossum is that one of Python's most important principles is "Programmer efficiency over runtime efficiency" (see '''Notes''').
   
'''I would like to point out that to print the line "idiot!" you would need to either remove the exclamation mark and previously declare it as a variable or enclose it in quotation marks.'''
+
==Python's philosophy==
   
  +
Guido van Rossum was also the inventor of five important aphorisms that Python uses. Each one was called a "Commandment" and is written on a special "Tablet". Every Pythoner (employee at Python) was supposed to know all the Commandments by heart and to pray to the Arc of Python (where all the Tablets are placed) every day before work started.
   
One also notes that semicolons are absent. In fact, developers can use semicolons but use is discouraged because every semicolon adds a 0.5 second delay to the code. The reasons for this are esoteric, but El Guido assures us they are useful.
+
All Python's philosophy, which is referred to as ''Pythonism'', could then be summarized by one quote from Huxley's ''Brave New World'':
   
Python is also well known for its standard library which has a function for everything you can imagine. El Guido has lately taken to saying "we've got a function for that" when confronted with any programming question. Unfortunately, controversy over the deprecation of gopherlib-- which led to a violent riot at PyCon 2009-- underscores the fragility and frustration with the standard library's mutant growth and the fact that anyone can add code to it whenever they want.
+
{{CQ|There isn't any need for a civilized man to bear anything that's seriously unpleasant.}}
   
== Real-life code example ==
+
Indeed, the aphorisms reinforced the importance of beauty of every worker at Python as well as of every user<ref>"Beautiful is better than ugly" and "Readability counts". From ''A Short Introduction to the Best Thing Humans Have Ever Made''. Sumsord, Ovangui.</ref> and simplicity of all the actions<ref>"Explicit is better than implicit", "Simple is better than complex" and "Complex is better than complicated". From ''A Short Introduction to the Best Thing Humans Have Ever Made''. Sumsord, Ovangui</ref>. However, Pythoners soon found these principles needlessly complicated and reduced them to one slogan: "Easy - good, everything else - bad". They did not restore the "beauty" principle, because all of the people employed by van Rossum were already physically attractive.<ref>''If You Want To Be Successful, Believe in Python''. Sumsord, Ovangui.</ref>
Here is a simple example useful IRL as an <s>evil tool to [[DESTROY ALL HUMANS|kill everyone]]</s> MP3-player.
 
 
import ao
 
import mad
 
MyDevice = ao.AudioDevice('triPod')
 
MyFile = mad.MadFile('Destroy humanity.mp3')
 
while (MyFile.current_time() < MyFile.total_time()):
 
MyDevice.play(MyFile.read())
 
 
== The GIL ==
 
One major problem with Python is its dependence on The GIL-- a nasty little homonculous that lives in every Python program. The GIL's supreme arrogance (demanding capitalization of his name and the prefix 'The') represents a challenge to every programmer. The GIL's arrogance extends to ensuring that there is only one GIL-- himself-- in the system at any given time. This means that Python threads suck and your eight-core Mac Pro won't run Python any better than an Atari 800XL.
 
 
Recent research has looked at removing The GIL but work is slow because GIL cries like a whiny girl and eventually is put back in the system when the developers get tired of his tantrum. Nobody has the guts to slap The GIL upside the head except El Guido but lately he's been too drunk to care, mumbling at The GIL "you're the reason daddy drinks."
 
   
 
== Notes ==
 
== Notes ==
  +
[[File:Vestal1.jpg|thumb|right|100px|Emmy Rossum. Not related.]]
 
{{reflist}}
 
{{reflist}}
 
== Links ==
 
[http://www.dalkescientific.com/writings/diary/archive/2007/06/01/lolpython.html LOLPython]
 
   
 
{{programming languages}}
 
{{programming languages}}
 
[[Category:Computers]]
 
[[Category:Computers]]
+
{{FA|date=28 April 2014|revision=5795076}}
 
[[ja:Python]]
 
[[ja:Python]]
 
[[ko:파이썬]]
 
[[ko:파이썬]]

Latest revision as of 14:29, April 28, 2014

Pylogo

Python's pretentious logo, representing a union of two "beautiful"[1] pythons of opposite sex.

Python, also known as compilable pseudocode, is a toy programming language. It emphasizes programmer efficiency over runtime efficiency[2], making it incompatible with modern computers, such as Commodore 64.

edit History

Python was developed by Guido van Rossum. Van Rossum was very disappointed by ABC (programming language), which "did not allow him to perform some main functions due to its complexity and lack of beauty" and thought that a new language would solve his problems. It is not clear, however, whether it is the ABC language that lacked beauty or its developer, whom van Rossum was known to frequent. It is also not clear which functions ABC failed to accomplish. Presumably, it was to store van Rossum's large collection of Dutch cheeses.

Guido van Rossum

Python's developer, Guido van Rossum, tried to replace the logo of Python with his photo (which many of his female employees found "very nice"), but was discouraged from it by his male colleagues.

There are two hypothesizes about the origin of the language's name. Pythoners (Python's followers) believe that it was named after a famous English writer Montague Python Shakespeare, whose iambic pentameter poetry inspired the language's syntax. Critics claim that it was after van Rossum's pet animal. Indeed, the developer told the press that "his python devoured many of his rivals with their programming languages". Presumably, one of these was a Japanese researcher, called Matsumoto, who added some question marks to the code van Rossum was developing and called this new language "Ruby".

The fact that van Rossum also possesses a cobra, makes his followers think that he is the developer of a programming language named "Cobra". But these claims have never been justified by evidence. The researchers who tried to investigate the matter died, bitten by an unidentified snake.

Finally, after years of work with his pet animal, Python gained popularity. Van Rossum started calling himself Python's Blood-thirsty Dictator For Life, and while his fellow programmers agreed that he certainly deserved this title, they shortened it to BDFL, which is now often read as "Benevolent Dictator For Life".

edit Syntax

Python is notable for its use of indentation.

Cquote1 It may confuse at first, but it certainly helps the user to develop his talents, as after using Python for a while, it will be very easy for him to immediately perceive the difference between two and three spaces, an aptitude unavailable to so many others. Cquote2

- states a researcher, Ovangui Sumsord, in his two works: "Independent Investigation on Why Python Is Better Than Everything Else" and "The Greatest Invention of the Humanity'".

edit Examples

To illustrate such use of indentation, Sumsord provides an example, which—according to him—was a program created by van Rossum himself, when he was a student. The program would ask for the name of the user's mother and give back the name of the person who slept with her the previous night. This very program was the cause of van Rossum's forced departure from his school and it is considered a masterpiece of programming as it contains only seven lines of code. Actually, it could be even smaller, if it didn't have the for loop, which van Rossum considered important to leave, in order to illustrate all of the functions of his new language.

However, it cannot be displayed in this article, due to privacy concerns of people mentioned in it.[3]

There are other examples of Python's simple syntax, easy style and laconism. One of these is a program called "Hello World" and one can find it in the first chapter of Python for Dummies (written by a team of Pythoners).

 #Uncyclopedia "Hello World"
 #Quad Licensed under the GPLv3/BSD/Python/CC-BY-NC-SA 2.0
 #THIS PROGRAM COMES WITH NO WARRANTY, BECAUSE WE'RE TOO STRESSED TO TROUBLESHOOT YOUR PROBLEMS
 x = 3
 y = 5
 if x + y = 8:
    import sys
    from sys import *
    import os
    from os import *
    import PySide
    from PySide import *
    import PySide.QtCore
    import PySide.QtNetwork
    import cmath
    import numpy
    import pypolynomial
    from pypolynomial import *
    import twisted
    from twisted import *
    import math
    from math import *
 
      while x = 3:
 
            class printerunitui(QtGui.QWidget)
 
 
                      def __init__(self):
 
                         if __name__=__main__:
 
                           while y = 5:
 
                                for 'x' = 'x':
 
                                     QtGui.QWidget.__init__(self)
 
                                                                  self.setWindowTitle('Printerunit')
 
 
 
 
                       def metaprinterconsoleunit():
 
                                                     inval = input('Requires input')
 
                                                           if inval = 'yes':
 
                                                            messagestringconstantglobalvalue = 'Hello World'
 
                                                            print(messagestringconstantglobalvalue)
 
                                                           else:
 
                                                                   print('Fatal error')
 
                            exit()
 
 
                    printerunitui()
                    metaprinterconsoleunit().exec()
      sys.exit()

edit "Pythonic propaganda"

Keep calm and learn Python

"This is a poster, that every human should have in his study" - state both Rossum and Sumsord.

Bouncywikilogo9
For those without comedic tastes, the so-called experts at Wikipedia have an article very remotely related to Python (programming language).

After having used Python for some time, any programmer feels a strong discomfort when using any other computer language. This side-effect was van Rossum's personal idea. It is achieved by a constant enhancement of Python's special features. This method is being referred to as "Pythonic propaganda", as the user is often unaware of this enhancement or of his addiction to the language.

For instance, semicolons, very useful in other languages, are absent from Python. They can always be added to the program, but each new semicolon delays the code by half a second, when it is being run. The only explanation provided by van Rossum is that one of Python's most important principles is "Programmer efficiency over runtime efficiency" (see Notes).

edit Python's philosophy

Guido van Rossum was also the inventor of five important aphorisms that Python uses. Each one was called a "Commandment" and is written on a special "Tablet". Every Pythoner (employee at Python) was supposed to know all the Commandments by heart and to pray to the Arc of Python (where all the Tablets are placed) every day before work started.

All Python's philosophy, which is referred to as Pythonism, could then be summarized by one quote from Huxley's Brave New World:

Cquote1 There isn't any need for a civilized man to bear anything that's seriously unpleasant. Cquote2

Indeed, the aphorisms reinforced the importance of beauty of every worker at Python as well as of every user[4] and simplicity of all the actions[5]. However, Pythoners soon found these principles needlessly complicated and reduced them to one slogan: "Easy - good, everything else - bad". They did not restore the "beauty" principle, because all of the people employed by van Rossum were already physically attractive.[6]

edit Notes

Vestal1

Emmy Rossum. Not related.

  1. According to Python's developer, Guido van Rossum. An Independent Investigation on Why Python Is Better Than Everything Else. Sumsord, Ovangui.
  2. Indeed, Python's runtime efficiency is almost nil. The Greatest Invention of the Humanity. Sumsord, Ovangui.
  3. In particular of one local in van Rossum's town, who played a major role in the program, as he was known for not being able to sleep two times at the same place.
  4. "Beautiful is better than ugly" and "Readability counts". From A Short Introduction to the Best Thing Humans Have Ever Made. Sumsord, Ovangui.
  5. "Explicit is better than implicit", "Simple is better than complex" and "Complex is better than complicated". From A Short Introduction to the Best Thing Humans Have Ever Made. Sumsord, Ovangui
  6. If You Want To Be Successful, Believe in Python. Sumsord, Ovangui.

190px-Featured.png

Potatohead aqua Featured Article  (read another featured article) Featured version: 28 April 2014
This article has been featured on the front page. — You can vote for or nominate your favourite articles at Uncyclopedia:VFH.
<includeonly>Template:FA/28 April 2014Template:FA/2014</includeonly>
Personal tools
projects