Skip to content

Commit 13b1a98

Browse files
committed
session 10
1 parent 9e9411e commit 13b1a98

File tree

5 files changed

+869
-55
lines changed

5 files changed

+869
-55
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
sample data for persistence/serializatiion examples
5+
6+
This version is nested, with more stucture
7+
- can be saved with pickle, JSON, xml...
8+
"""
9+
10+
AddressBook = [ {'first_name': "Chris",
11+
'last_name': "Barker",
12+
'address' : {'line_1':"835 NE 33rd St",
13+
'line_2' : "",
14+
'city' : "Seattle",
15+
'state': "WA",
16+
'zip': "96543"},
17+
'email' : "[email protected]",
18+
'home_phone' : "206-555-1234",
19+
'office_phone' : "123-456-7890",
20+
'cell_phone' : "234-567-8901",
21+
},
22+
23+
{'first_name': "Fred",
24+
'last_name': "Jones",
25+
'address' : {'line_1':"123 SE 13th St",
26+
'line_2' : "Apt. 43",
27+
'city' : "Tacoma",
28+
'state': "WA",
29+
'zip': "93465"},
30+
'email' : "FredJones@some_company.com",
31+
'home_phone' : "510-555-1234",
32+
'office_phone' : "564-466-7990",
33+
'cell_phone' : "403-561-8911",
34+
},
35+
36+
{'first_name': "Nancy",
37+
'last_name': "Wilson",
38+
'address' : {'line_1':"8654 Walnut St",
39+
'line_2' : "Suite 567",
40+
'city' : "Pasadena",
41+
'state': "CA",
42+
'zip': "12345"},
43+
'email' : "[email protected]",
44+
'home_phone' : "423-321-9876",
45+
'office_phone' : "123-765-9877",
46+
'cell_phone' : "432-567-8466",
47+
},
48+
]
49+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
sample data for persistence/serialization examples
5+
this version is flat for saving in CSV, ini, etc.
6+
"""
7+
8+
AddressBook = [ {'first_name': "Chris",
9+
'last_name': "Barker",
10+
'address_line_1':"835 NE 33rd St",
11+
'address_line_2' : "",
12+
'address_city' : "Seattle",
13+
'address_state': "WA",
14+
'address_zip': "96543",
15+
'email' : "[email protected]",
16+
'home_phone' : "206-555-1234",
17+
'office_phone' : "123-456-7890",
18+
'cell_phone' : "234-567-8901",
19+
},
20+
21+
{'first_name': "Fred",
22+
'last_name': "Jones",
23+
'address_line_1':"123 SE 13th St",
24+
'address_line_2' : "Apt. 43",
25+
'address_city' : "Tacoma",
26+
'address_state': "WA",
27+
'address_zip': "93465",
28+
'email' : "FredJones@some_company.com",
29+
'home_phone' : "510-555-1234",
30+
'office_phone' : "564-466-7990",
31+
'cell_phone' : "403-561-8911",
32+
},
33+
34+
{'first_name': "Nancy",
35+
'last_name': "Wilson",
36+
'address_line_1':"8654 Walnut St",
37+
'address_line_2' : "Suite 567",
38+
'address_city' : "Pasadena",
39+
'address_state': "CA",
40+
'address_zip': "12345",
41+
'email' : "[email protected]",
42+
'home_phone' : "423-321-9876",
43+
'office_phone' : "123-765-9877",
44+
'cell_phone' : "432-567-8466",
45+
},
46+
]
47+

Examples/Session10/example.cfg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Section1]
2+
int = 15
3+
bool = true
4+
float = 3.1415
5+
6+
[Section2]
7+
int = 32
8+
bool = False
9+
float = 1.4235

slides_sources/source/session09.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,7 @@ Dependencies:
961961
Pretty straightforward:
962962

963963
1. Is there a system package?
964+
964965
* use it (apt-get install the_package)
965966

966967
2. Try ``pip install``: it may just work!
@@ -981,13 +982,15 @@ Pretty straightforward:
981982
Sometimes simpler:
982983

983984
1) A lot of packages have Windows binaries:
985+
984986
- Usually for python.org builds
985987
- Excellent source: http://www.lfd.uci.edu/~gohlke/pythonlibs/
986988
- Make sure you get 32 or 64 bit consistent
987989

988990
2) But if no binaries:
989-
- Hope the dependencies are available!
990-
- Set up the compiler
991+
992+
- Hope the dependencies are available!
993+
- Set up the compiler
991994

992995
MS now has a compiler just for python!
993996

0 commit comments

Comments
 (0)