File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ loop. This method returns a complete line including the newline character at the
92
92
line. When an _empty_ string is returned, it means that we have reached the end of the file and we
93
93
'break' out of the loop.
94
94
95
- In the end, we finally `close`the file.
95
+ In the end, we finally `close` the file.
96
96
97
97
Now, check the contents of the `poem.txt` file to confirm that the program has indeed written to
98
98
and read from that file.
Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ A note on `del` - this statement is used to *delete* a variable/name and after t
264
264
run, in this case `del a`, you can no longer access the variable `a` - it is as if it never existed
265
265
before at all.
266
266
267
- Note that the `dir()` function works on *any* object. For example, run `dir(' print' )` to learn
267
+ Note that the `dir()` function works on *any* object. For example, run `dir(print)` to learn
268
268
about the attributes of the print function, or `dir(str)` for the attributes of the str class.
269
269
270
270
There is also a http://docs.python.org/2/library/functions.html#vars[`vars()`] function which can
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ include::programs/oop_objvar.txt[]
192
192
.How It Works
193
193
194
194
This is a long example but helps demonstrate the nature of class and object variables. Here,
195
- `population` belongs to the`Robot` class and hence is a class variable. The `name` variable belongs
195
+ `population` belongs to the `Robot` class and hence is a class variable. The `name` variable belongs
196
196
to the object (it is assigned using `self`) and hence is an object variable.
197
197
198
198
Thus, we refer to the `population` class variable as `Robot.population` and not as
Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ a `-v` option to make your program become more talkative or a `-q` to make it _q
227
227
228
228
Another possible enhancement would be to allow extra files and directories to be passed to the
229
229
script at the command line. We can get these names from the `sys.argv` list and we can add them to
230
- our `source` list using the `extend`method provided by the `list` class.
230
+ our `source` list using the `extend` method provided by the `list` class.
231
231
232
232
The most important refinement would be to not use the `os.system` way of creating archives and
233
233
instead using the http://docs.python.org/2/library/zipfile.html[zipfile] or
You can’t perform that action at this time.
0 commit comments