Skip to content

Commit 8860b8c

Browse files
committed
update
1 parent aad56d7 commit 8860b8c

File tree

235 files changed

+20287
-5936
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+20287
-5936
lines changed

Readings/Automate-Boring-Stuff-with-Python.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ Here’s what I get when I try these functions in the interactive shell:
192192
\>>> **os.path.getsize('C:\\\\Windows\\\\System32\\\\calc.exe')**
193193
776192
194194

195-
> > > **os.listdir('C:\\\\Windows\\\\System32')**
196-
> > > \['0409', '12520437.cpx', '12520850.cpx', '5U877.ax', 'aaclient.dll',
195+
> > > **os.listdir('C:\\\\Windows\\\\System32')** > > > \['0409', '12520437.cpx', '12520850.cpx', '5U877.ax', 'aaclient.dll',
197196
> > > --_snip_\--
198197
> > > 'xwtpdui.dll', 'xwtpw32.dll', 'zh-CN', 'zh-HK', 'zh-TW', 'zipfldr.dll'\]
199198
@@ -295,8 +294,7 @@ Make sure to separate the four lines with line breaks. Then enter the following
295294

296295
\>>> **sonnetFile = open('sonnet29.txt')**
297296

298-
> > > **sonnetFile.readlines()**
299-
> > > \[When, in disgrace with fortune and men's eyes,\\n', ' I all alone beweep my
297+
> > > **sonnetFile.readlines()** > > > \[When, in disgrace with fortune and men's eyes,\\n', ' I all alone beweep my
300298
> > > outcast state,\\n', And trouble deaf heaven with my bootless cries,\\n', And
301299
> > > look upon myself and curse my fate,'\]
302300
@@ -346,18 +344,15 @@ Your programs can use the `shelve` module to later reopen and retrieve the data
346344

347345
> > > **type(shelfFile)**
348346
> > > <class 'shelve.DbfilenameShelf'>
349-
> > > **shelfFile\['cats'\]**
350-
> > > \['Zophie', 'Pooka', 'Simon'\] >>> **shelfFile.close()**
347+
> > > **shelfFile\['cats'\]** > > > \['Zophie', 'Pooka', 'Simon'\] >>> **shelfFile.close()**
351348
352349
Here, we open the shelf files to check that our data was stored correctly. Entering `shelfFile['cats']` returns the same list that we stored earlier, so we know that the list is correctly stored, and we call `close()`.
353350

354351
Just like dictionaries, shelf values have `keys()` and `values()` methods that will return list-like values of the keys and values in the shelf. Since these methods return list-like values instead of true lists, you should pass them to the `list()` function to get them in list form. Enter the following into the interactive shell:
355352

356353
\>>> **shelfFile = shelve.open('mydata')**
357354

358-
> > > **list(shelfFile.keys())**
359-
> > > \['cats'\] >>> **list(shelfFile.values())**
360-
> > > \[\['Zophie', 'Pooka', 'Simon'\]\] >>> **shelfFile.close()**
355+
> > > **list(shelfFile.keys())** > > > \['cats'\] >>> **list(shelfFile.values())** > > > \[\['Zophie', 'Pooka', 'Simon'\]\] >>> **shelfFile.close()**
361356
362357
Plaintext is useful for creating files that you’ll read in a text editor such as Notepad or TextEdit, but if you want to save data from your Python programs, use the `shelve` module.
363358

@@ -381,8 +376,7 @@ And since Python scripts are themselves just text files with the _.py_ file exte
381376

382377
\>>> **import myCats**
383378

384-
> > > **myCats.cats**
385-
> > > \[{'name': 'Zophie', 'desc': 'chubby'}, {'name': 'Pooka', 'desc': 'fluffy'}\] >>> **myCats.cats\[0\]**
379+
> > > **myCats.cats** > > > \[{'name': 'Zophie', 'desc': 'chubby'}, {'name': 'Pooka', 'desc': 'fluffy'}\] >>> **myCats.cats\[0\]**
386380
> > > {'name': 'Zophie', 'desc': 'chubby'}
387381
> > > **myCats.cats\[0\]\['name'\]**
388382
> > > 'Zophie'

Readings/right.html

Lines changed: 159 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,163 @@
1-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
22
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5+
<title>C:/Users/bryan/Downloads/PYTHON-REPO/Readings</title>
6+
<link
7+
rel="stylesheet"
8+
href="https://cdn.jsdelivr.net/gh/bgoonz/GIT-CDN-FILES/right.css"
9+
/>
10+
</head>
311

4-
<head>
5-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6-
<title>C:/Users/bryan/Downloads/PYTHON-REPO/Readings</title>
7-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/bgoonz/GIT-CDN-FILES/right.css">
8-
</head>
12+
<body>
13+
<table
14+
border="0"
15+
cellspacing="1"
16+
cellpadding="2"
17+
summary="file table"
18+
class="file-table centered"
19+
>
20+
<tr>
21+
<td colspan="4" class="header-row"><b>Folders</b></td>
22+
</tr>
23+
<tr>
24+
<td><a href="../right.html" target="rframe">&lt;Go Back&gt;</a></td>
25+
</tr>
26+
</table>
27+
<br />
928

10-
<body>
29+
<table
30+
border="0"
31+
cellspacing="1"
32+
cellpadding="2"
33+
summary="file table"
34+
class="file-table centered"
35+
>
36+
<tr>
37+
<th><b>File</b></th>
38+
<th><b>File</b></th>
39+
<th><b>File</b></th>
40+
<th><b>File</b></th>
41+
</tr>
42+
<tr>
43+
<td>
44+
<a
45+
href="(Tutorial)%20Reading%20and%20Writing%20Files%20in%20Python.html"
46+
>(Tutorial...n.html</a
47+
>&nbsp;
48+
</td>
49+
<td>
50+
<a href="Controlling%20the%20Web%20with%20Python.html"
51+
>Controlli...n.html</a
52+
>&nbsp;
53+
</td>
54+
<td><a href="30-python-snippets.md">30-python...ets.md</a>&nbsp;</td>
55+
<td><a href="python-basics.md">python-basics.md</a>&nbsp;</td>
56+
</tr>
57+
<tr class="row2">
58+
<td>
59+
<a
60+
href="10%20External%20Python%20packages%20you%20are%20going%20to%20love.html"
61+
>10 Extern...e.html</a
62+
>&nbsp;
63+
</td>
64+
<td>
65+
<a
66+
href="How%20to%20build%20a%20URL%20crawler%20to%20map%20a%20website%20using%20Python.html"
67+
>How to bu...n.html</a
68+
>&nbsp;
69+
</td>
70+
<td>
71+
<a
72+
href="A%20quick%20yet%20complete%20tour%20of%20lists%20in%20Python3%20in%20just%20seven%20minutes.md"
73+
>A quick y...tes.md</a
74+
>&nbsp;
75+
</td>
76+
<td>
77+
<a
78+
href="The%20Python%20RegEx%20Cheat%20Sheet%20for%20Budding%20Programmers.md"
79+
>The Pytho...ers.md</a
80+
>&nbsp;
81+
</td>
82+
</tr>
83+
<tr>
84+
<td><a href="30-python-snippets.html">30-python...s.html</a>&nbsp;</td>
85+
<td><a href="python-basics.html">python-basics.html</a>&nbsp;</td>
86+
<td>
87+
<a href="An%20A-Z%20of%20useful%20Python%20tricks.md"
88+
>An A-Z of...cks.md</a
89+
>&nbsp;
90+
</td>
91+
<td><a href="beginners.pdf">beginners.pdf</a>&nbsp;</td>
92+
</tr>
93+
<tr class="row2">
94+
<td>
95+
<a
96+
href="A%20quick%20yet%20complete%20tour%20of%20lists%20in%20Python3%20in%20just%20seven%20minutes.html"
97+
>A quick y...s.html</a
98+
>&nbsp;
99+
</td>
100+
<td>
101+
<a
102+
href="The%20Python%20RegEx%20Cheat%20Sheet%20for%20Budding%20Programmers.html"
103+
>The Pytho...s.html</a
104+
>&nbsp;
105+
</td>
106+
<td>
107+
<a href="Automate-Boring-Stuff-with-Python.md">Automate-...hon.md</a
108+
>&nbsp;
109+
</td>
110+
<td>
111+
<a href="importing-data-python.pdf">importing...on.pdf</a>&nbsp;
112+
</td>
113+
</tr>
114+
<tr>
115+
<td>
116+
<a href="An%20A-Z%20of%20useful%20Python%20tricks.html"
117+
>An A-Z of...s.html</a
118+
>&nbsp;
119+
</td>
120+
<td>
121+
<a
122+
href="(Tutorial)%20Reading%20and%20Writing%20Files%20in%20Python.md"
123+
>(Tutorial...hon.md</a
124+
>&nbsp;
125+
</td>
126+
<td>
127+
<a href="Controlling%20the%20Web%20with%20Python.md"
128+
>Controlli...hon.md</a
129+
>&nbsp;
130+
</td>
131+
<td>
132+
<a href="jupyter-notebook-cheat-sheet.pdf">jupyter-n...et.pdf</a
133+
>&nbsp;
134+
</td>
135+
</tr>
136+
<tr class="row2">
137+
<td>
138+
<a href="Automate-Boring-Stuff-with-Python.html">Automate-...n.html</a
139+
>&nbsp;
140+
</td>
141+
<td>
142+
<a
143+
href="10%20External%20Python%20packages%20you%20are%20going%20to%20love.md"
144+
>10 Extern...ove.md</a
145+
>&nbsp;
146+
</td>
147+
<td>
148+
<a
149+
href="How%20to%20build%20a%20URL%20crawler%20to%20map%20a%20website%20using%20Python.md"
150+
>How to bu...hon.md</a
151+
>&nbsp;
152+
</td>
153+
<td><a href="numpy.pdf">numpy.pdf</a>&nbsp;</td>
154+
</tr>
155+
</table>
11156

12-
<table border="0" cellspacing="1" cellpadding="2" summary="file table" class="file-table centered">
13-
<tr><td colspan="4" class="header-row"><b>Folders</b></td></tr>
14-
<tr><td><a href="../right.html" target="rframe">&lt;Go Back&gt;</a></td></tr>
15-
</table>
16-
<br>
17-
18-
<table border="0" cellspacing="1" cellpadding="2" summary="file table" class="file-table centered">
19-
<tr><th><b>File</b></th><th><b>File</b></th><th><b>File</b></th><th><b>File</b></th></tr>
20-
<tr><td><a href="(Tutorial)%20Reading%20and%20Writing%20Files%20in%20Python.html" >(Tutorial...n.html</a>&nbsp;</td><td><a href="Controlling%20the%20Web%20with%20Python.html" >Controlli...n.html</a>&nbsp;</td><td><a href="30-python-snippets.md" >30-python...ets.md</a>&nbsp;</td><td><a href="python-basics.md" >python-basics.md</a>&nbsp;</td></tr>
21-
<tr class="row2"><td><a href="10%20External%20Python%20packages%20you%20are%20going%20to%20love.html" >10 Extern...e.html</a>&nbsp;</td><td><a href="How%20to%20build%20a%20URL%20crawler%20to%20map%20a%20website%20using%20Python.html" >How to bu...n.html</a>&nbsp;</td><td><a href="A%20quick%20yet%20complete%20tour%20of%20lists%20in%20Python3%20in%20just%20seven%20minutes.md" >A quick y...tes.md</a>&nbsp;</td><td><a href="The%20Python%20RegEx%20Cheat%20Sheet%20for%20Budding%20Programmers.md" >The Pytho...ers.md</a>&nbsp;</td></tr>
22-
<tr><td><a href="30-python-snippets.html" >30-python...s.html</a>&nbsp;</td><td><a href="python-basics.html" >python-basics.html</a>&nbsp;</td><td><a href="An%20A-Z%20of%20useful%20Python%20tricks.md" >An A-Z of...cks.md</a>&nbsp;</td><td><a href="beginners.pdf" >beginners.pdf</a>&nbsp;</td></tr>
23-
<tr class="row2"><td><a href="A%20quick%20yet%20complete%20tour%20of%20lists%20in%20Python3%20in%20just%20seven%20minutes.html" >A quick y...s.html</a>&nbsp;</td><td><a href="The%20Python%20RegEx%20Cheat%20Sheet%20for%20Budding%20Programmers.html" >The Pytho...s.html</a>&nbsp;</td><td><a href="Automate-Boring-Stuff-with-Python.md" >Automate-...hon.md</a>&nbsp;</td><td><a href="importing-data-python.pdf" >importing...on.pdf</a>&nbsp;</td></tr>
24-
<tr><td><a href="An%20A-Z%20of%20useful%20Python%20tricks.html" >An A-Z of...s.html</a>&nbsp;</td><td><a href="(Tutorial)%20Reading%20and%20Writing%20Files%20in%20Python.md" >(Tutorial...hon.md</a>&nbsp;</td><td><a href="Controlling%20the%20Web%20with%20Python.md" >Controlli...hon.md</a>&nbsp;</td><td><a href="jupyter-notebook-cheat-sheet.pdf" >jupyter-n...et.pdf</a>&nbsp;</td></tr>
25-
<tr class="row2"><td><a href="Automate-Boring-Stuff-with-Python.html" >Automate-...n.html</a>&nbsp;</td><td><a href="10%20External%20Python%20packages%20you%20are%20going%20to%20love.md" >10 Extern...ove.md</a>&nbsp;</td><td><a href="How%20to%20build%20a%20URL%20crawler%20to%20map%20a%20website%20using%20Python.md" >How to bu...hon.md</a>&nbsp;</td><td><a href="numpy.pdf" >numpy.pdf</a>&nbsp;</td></tr>
26-
</table>
27-
28-
<p class="summary-style">
29-
Folders: 1<br>
30-
Files: 24<br>
31-
Size of all files: 2353858 KB</p>
32-
33-
</body>
34-
</html>
157+
<p class="summary-style">
158+
Folders: 1<br />
159+
Files: 24<br />
160+
Size of all files: 2353858 KB
161+
</p>
162+
</body>
163+
</html>

0 commit comments

Comments
 (0)