comparison docs/pycon2010/pycon2010.rst @ 362:18e8487be095

try again to upload docs
author cat@eee
date Thu, 18 Feb 2010 13:08:15 -0500
parents ce4448ca4088
children 2b2836b783be
comparison
equal deleted inserted replaced
361:3d74a2887a86 362:18e8487be095
13 13
14 Web 2.0 14 Web 2.0
15 ======= 15 =======
16 16
17 .. image:: web-2-0-logos.gif 17 .. image:: web-2-0-logos.gif
18 :height: 300px 18 :height: 250px
19 19
20 But first... 20 But first...
21 ============ 21 ============
22 22
23 .. image:: sargon.jpg 23 .. image:: sargon.jpg
24 :height: 300px 24 :height: 250px
25 25
26 .. image:: akkad.png 26 .. image:: akkad.png
27 :height: 300px 27 :height: 250px
28 28
29 Sargon the Great 29 Sargon the Great
30 Founder of Akkadian Empire 30 Founder of Akkadian Empire
31 31
32 .. twenty-third century BC 32 .. twenty-third century BC
33 33
34 In between 34 In between
35 ========== 35 ==========
36 36
37 .. image:: apple.jpg 37 .. image:: apple.jpg
38 :height: 300px 38 :height: 250px
39 39
40 Command-Line Interface 40 Command-Line Interface
41 Unlike the Akkadian Empire, 41 Unlike the Akkadian Empire,
42 the CLI will never die. 42 the CLI will never die.
43 43
65 .. ``ed`` proves that CLI is sometimes the wrong answer. 65 .. ``ed`` proves that CLI is sometimes the wrong answer.
66 66
67 != Command Line Utilities 67 != Command Line Utilities
68 ========================= 68 =========================
69 69
70 (``ls``, ``grep``, ``ping``, etc.)
71
70 1. Accepts arguments at invocation 72 1. Accepts arguments at invocation
71 2. executes 73 2. executes
72 3. terminates 74 3. terminates
73 75
74 Examples
75 --------
76 * ls
77 * grep
78 * ping
79
80 Use ``sys.argv``, ``optparse`` 76 Use ``sys.argv``, ``optparse``
81 77
82 != "Text User Interfaces", "Consoles" 78 != "Text User Interfaces", "Consoles"
83 ===================================== 79 =====================================
84 80
85 * Use entire (session) screen 81 * Use entire (session) screen
86 * I/O is *not* line-by-line 82 * I/O is *not* line-by-line
87 83
88 .. image:: urwid.png 84 .. image:: urwid.png
89 :height: 300px 85 :height: 250px
90 86
91 Use ``curses``, ``urwid`` 87 Use ``curses``, ``urwid``
92 88
93 Priorities 89 Priorities
94 ========== 90 ==========
95 91
96 .. image:: strategy.png 92 .. image:: strategy.png
97 :height: 300px 93 :height: 250px
98 94
99 A ``cmd`` app: pirate.py 95 A ``cmd`` app: pirate.py
100 ======================== 96 ========================
101 97
102 :: 98 ::
144 140
145 Hooks 141 Hooks
146 ===== 142 =====
147 143
148 .. image:: hook.jpeg 144 .. image:: hook.jpeg
149 :height: 300px 145 :height: 250px
150 146
151 Hooks: pirate3.py 147 Hooks: pirate3.py
152 ================= 148 =================
153 149
154 :: 150 ::
211 207
212 cmd2 208 cmd2
213 ==== 209 ====
214 210
215 .. image:: schematic.png 211 .. image:: schematic.png
216 :height: 300px 212 :height: 250px
217 213
218 Absolutely free 214 Absolutely free
219 =============== 215 ===============
220 216
221 * Script files 217 * Script files
278 separator = ', ' 274 separator = ', '
279 else: 275 else:
280 separator = ' ' 276 separator = ' '
281 chant = separator.join(chant) 277 chant = separator.join(chant)
282 print('{0} and a bottle of {1}'.format(chant, arg)) 278 print('{0} and a bottle of {1}'.format(chant, arg))
283 279
284 sqlpython 280 Serious example: sqlpython
285 ========= 281 ==========================
286 282
287 Created by Luca Canali @ CERN 283 ``cmd``-based app by Luca Canali @ CERN
288 284
289 ``cmd``-based Replacement for Oracle SQL/*Plus 285 Replacement for Oracle SQL/*Plus
290 286
291 287 Now ``cmd2``-based; postgreSQL; MySQL
292 288
293 289 sqlpython features
294 290 ==================
291
292 Everything in ``cmd2``
293
294 Multi connections
295
296 ls, grep
297
298 Output to html, csv, inserts, bar graphs
299
300