ProgrammingWiki
Jaberg (talk | contribs)
(added cairo link [using an external editor])
Tono555 (talk | contribs)
m (Reverted edits by BehindTheScenes0 (talk) to last version by Jesdisciple)
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
  +
{{movedToProgrammer'sWiki}}
There are already tons of excellent tutorials for Python n00bs. Some of them are listed below.
+
{{none|There are already tons of excellent tutorials for Python beginners. Some of them are listed below.
To complement, my hope is that this wiki will bring together more miniature tutorials that
+
To complement, my hope is that this wiki will bring together miniature tutorials that
 
address the little things that make Python work better.
 
address the little things that make Python work better.
   
  +
==Muddles (not Guides)==
==PyGTK==
 
  +
* [[PythonGeneral]]
[PyGTK:Cairo]
 
  +
* [[PythonCsound]]
 
* [[PyGTK]]
  +
* [[PythonXML]]
   
 
==External Resources==
 
==External Resources==
Line 12: Line 16:
   
 
===Other interesting stuff===
 
===Other interesting stuff===
* http://en.wikipedia.org/wiki/Python_syntax
+
* http://en.wikipedia.org/wiki/Python_syntax Python Syntax, including functional-programming in Python
   
 
==Including Sample Code in a Wiki==
 
==Including Sample Code in a Wiki==
Line 27: Line 31:
   
 
This command adds a single space to the beginning of each line of your file. Since empty lines cause new boxes to be created, you'll probably want to adjust the output code to taste.
 
This command adds a single space to the beginning of each line of your file. Since empty lines cause new boxes to be created, you'll probably want to adjust the output code to taste.
  +
  +
==Easier Editting Externally==
  +
  +
For even easier editing, you can use an external (read: sane) text editor. There are apparently [[http://en.wikipedia.org/wiki/Wikipedia:Text_editor_support#How_to_open_articles_in_your_text_editor lots of ways]]. I did the [[http://meta.wikimedia.org/wiki/Help:External_editors ee.pl]] method, and it worked.
  +
  +
In vim, you can add a line to your vimrc that will add one space to any block of text that you highlight, if you press backslash-p.
  +
  +
:map <leader>p :!sed -e 's/^/ /'<CR>}}

Latest revision as of 00:06, 16 June 2019

MediaWiki logo
This page has been moved to the Programmer's Wiki.
Please do not make any changes or additions to this page.

Any modifications, if still appropriate, should be made on Python at the Programmer's Wiki.

There are already tons of excellent tutorials for Python beginners. Some of them are listed below.

To complement, my hope is that this wiki will bring together miniature tutorials that address the little things that make Python work better.

Muddles (not Guides)

External Resources

Basic Bookmarks

Other interesting stuff

Including Sample Code in a Wiki

To put code in one of these cute boxes, you have to indent each line of wiki-text by one space:

def function():
    print "hello"

Fortunately, cutting and pasting out of the cute box results in properly formatted Python code. To quickly format your code for cut-and-paste into the wiki on a linux computer, you can use the sed command.

$ sed -e 's/^/ /' < file.py

This command adds a single space to the beginning of each line of your file. Since empty lines cause new boxes to be created, you'll probably want to adjust the output code to taste.

Easier Editting Externally

For even easier editing, you can use an external (read: sane) text editor. There are apparently [lots of ways]. I did the [ee.pl] method, and it worked.

In vim, you can add a line to your vimrc that will add one space to any block of text that you highlight, if you press backslash-p.

:map <leader>p :!sed -e 's/^/ /'<CR>