| At line 45 removed 2 lines |
| All variables are local unless declared with {{global}} |
|
| At line 66 changed one line |
| Logical operators (work like lisp!) |
| Logical operators (works like lisp!) |
| At line 81 added one line |
| All variables are local unless declared with {{global}} |
| At line 83 added one line |
|
| At line 109 changed one line |
| {{{+=}}} works on all data types |
| |{{{+=}}} | works on all data types |
| |{{{"""string"""}}} | to embed newlines in string |
| | {{{pass}}} | is statement that does nothing (used where statements are required) |
| At line 111 removed one line |
| Use {{{"""string"""}}} to embed newlines in string |
| At line 113 removed 3 lines |
| {{{pass}}} is statement that does nothing (used where statements are required) |
|
|
| At line 122 changed 2 lines |
| {{{import file1}}} # imports into the file "file1.py" |
| {{{import file1, file2, file3 |
| {{{import file1 # imports file "file1.py" |
| import file1, file2, file3 |
| At line 128 changed one line |
| {{{from file1 import *}}} # imports into the current package |
| {{{from file1 import * # imports into the current package |
| At line 130 changed one line |
| {{{from file1 import (obj1, obj2, …)}}} |
| from file1 import (obj1, obj2, …)}}} |
| At line 133 changed one line |
| {{{ file1.obj1}}} |
|
| {{{file1.obj1}}} |
| |
| At line 135 removed one line |
| {{{obj1}}} |
| At line 136 added 2 lines |
| {{{obj1}}} |
|
| At line 156 added one line |
| |
| At line 158 added 14 lines |
| !Dictionary |
|
| {{{dict = {} |
| dict[‘key’] = value |
| value = dict['key'] |
| dict.clear() |
| len(dict) |
| dict.get(‘key’) |
| dict.has_key(‘key’) |
| dict.keys() |
| key in dict |
| del dict['key']}}} |
|
|
| At line 177 changed one line |
| def getcv1(): |
| @classmethod |
| def getcv1(cls): |
| At line 179 changed one line |
| def setcv1(val): |
| @classmethod |
| def setcv1(cls, val): |
| At line 197 changed 12 lines |
| |
|
| !Dictionary |
|
| {{{dict = {} |
| dict[‘key’] = value |
| dict.clear() |
| len(dict) |
| dict.get(‘key’) |
| dict.has_key(‘key’) |
| dict.keys()}}} |
|
| |
| At line 226 added one line |
| !ODBC |
| At line 228 added 18 lines |
| {{{import pyodbc |
|
| conn = pyodbc.connect('DSN=XXX;UID=YYY;PWD=ZZZ;DATABASE=MyDatabase') |
|
| cursor = conn.cursor() |
|
| cursor.execute("SELECT * from my_table") |
|
| while 1: |
| row = cursor.fetchone() |
| if not row: |
| break |
| print row.name}}} |
|
| [https://code.google.com/p/pyodbc/wiki/GettingStarted] |
|
|
|