Category:Python: Difference between revisions

From Rosetta Code
Content added Content deleted
(Add notes on deviations from idiomatic Python to support 2.X and 3.X.)
Line 27: Line 27:
==See Also==
==See Also==
* [[wp:python_(programming_language)|Wikipedia: Python]]
* [[wp:python_(programming_language)|Wikipedia: Python]]
* [http://www.skulpt.org/ Skulpt, a basic Python interpreter in JavaScript]

Revision as of 14:23, 26 December 2010

Language
Python
This programming language may be used to instruct a computer to perform a task.
Official website
Execution method: Interpreted
Garbage collected: Yes
Type safety: Safe
Type strength: Strong
Type expression: Implicit
Type checking: Dynamic
See Also:
Listed below are all of the tasks on Rosetta Code which have been solved using Python.
Try this language on Codepad.

From the official Python website: "Python is a dynamic object-oriented programming language that can be used for many kinds of software development."

It is easy to create clean bug-free programs in Python due to the motto: "Errors should never pass silently." Python is an interpreter. Python source files (.py files) are typically compiled to an intermediate bytecode language (.pyc files) and executed by a Python Virtual Machine.

Notes

Because Python uses whitespace for structure, do not format long code examples with leading whitespace, instead use <pre></pre> tags, or, preferably, <lang python></lang> tags. This will make it easier to copy code into and out of the wiki. Example:

<lang python>print 'this line must not have leading indentation!'

if True:

 print 'example: ', foo(3), len(bar)</lang>

Some Python examples may deviate from idiomatic Python because they may be written to work in Python 3.X as well as Python 2.X environments. This includes doing things like:

  • Using brackets in print statements/functions of one expression.
  • Using zip and not izip; keys(), values(), items() and not their iter- forms.
  • Checking for raw_input and setting raw_input to input if not found.
  • Conditionally importing reduce if it is not found.

This style is not a requirement for Python code on RC, but it may be in use and should not necessarily be 'corrected' if found in examples.

See Also

Subcategories

This category has the following 18 subcategories, out of 18 total.

K

L

M

N

P

S

T

V

W

Pages in category "Python"

The following 200 pages are in this category, out of 1,513 total.

(previous page) (next page)

A

(previous page) (next page)