Python: Difference between revisions
No edit summary |
No edit summary |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 16: | Line 16: | ||
* [https://greenteapress.com/wp/think-python-2e/ Think Python] | * [https://greenteapress.com/wp/think-python-2e/ Think Python] | ||
Has been used in the course as a textbook | Has been used in the course as a textbook | ||
* http://www.diveintopython3.net/ | * http://www.diveintopython3.net/ | ||
| Line 30: | Line 26: | ||
* A Python [http://www.addedbytes.com/download/python-cheat-sheet-v1/pdf/ "Cheat Sheet"] -- hmmm, might it not be a good project to be able to generate your own "cheat sheets"? | * A Python [http://www.addedbytes.com/download/python-cheat-sheet-v1/pdf/ "Cheat Sheet"] -- hmmm, might it not be a good project to be able to generate your own "cheat sheets"? | ||
* [http://hetland.org/writing/instant-hacking.html Instant Hacking] (dated! uses python 2 syntax) | |||
A nice quick intro to programming with Python as the specific language. | |||
* https://www.khanacademy.org/computing/intro-to-python-fundamentals | |||
== Useful Add-ons (Libraries) == | == Useful Add-ons (Libraries) == | ||
| Line 52: | Line 54: | ||
You can insert Python code in a wiki page with syntax highlighting in this way: | You can insert Python code in a wiki page with syntax highlighting in this way: | ||
<nowiki>< | <nowiki><syntaxhighlight lang="python"></syntaxhighlight></nowiki> | ||
So for example: | So for example: | ||
<nowiki>< | <nowiki><syntaxhighlight lang="python"> | ||
print("Enter your name:") | print("Enter your name:") | ||
x = input() # waiting for input | x = input() # waiting for input | ||
print("Hello, " + x) | print("Hello, " + x) | ||
</ | </syntaxhighlight></nowiki> | ||
renders as: | renders as: | ||
< | <syntaxhighlight lang="python"> | ||
print("Enter your name:") | print("Enter your name:") | ||
x = input() # waiting for input | x = input() # waiting for input | ||
print("Hello, " + x) | print("Hello, " + x) | ||
</ | </syntaxhighlight> | ||
==See also== | |||
* [[:Category:Python|Python related pages on this wiki]] | |||
[[Category:Python]] | [[Category:Python]] | ||
Latest revision as of 13:50, 10 November 2025
Python is a scripting language written by Guido van Rossom.
The name actually refers to Monty Python, the charmingly irreverent and absurdist comedy troupe, as opposed to venomous snake.
General
- Charming Pythonistas, an article about why Python makes a good learning language, and in particular considers the underrepresentation of female programmers
Learning Python
Has been used in the course as a textbook
Another good, free, resource, by Mark Pilgrim
Interesting discussion about the merits of Python as a learning language, and the "gender gap" in programming
- A Python "Cheat Sheet" -- hmmm, might it not be a good project to be able to generate your own "cheat sheets"?
- Instant Hacking (dated! uses python 2 syntax)
A nice quick intro to programming with Python as the specific language.
Useful Add-ons (Libraries)
- PythonImageLibrary (PIL)
- feedparser
Applications that use/support Python plugins/extensions
- GIMP has GIMP-python to allow python plugins
- Inkscape can use any language scripts, including Python, as filters (or "effects")
- Blender has an embedded Python interpreter
- Dia via a python plugin
- Scribus has a scripting API that uses Python
Visualisations of python code
- Syntax: Showing a parse tree: https://vpyast.appspot.com/ code
- Execution frames also same thing?
Saving Python code in the wiki
You can insert Python code in a wiki page with syntax highlighting in this way:
<syntaxhighlight lang="python"></syntaxhighlight>
So for example:
<syntaxhighlight lang="python">
print("Enter your name:")
x = input() # waiting for input
print("Hello, " + x)
</syntaxhighlight>
renders as:
print("Enter your name:")
x = input() # waiting for input
print("Hello, " + x)