File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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
9292line. When an _empty_ string is returned, it means that we have reached the end of the file and we
9393'break' out of the loop.
9494
95- In the end, we finally `close`the file.
95+ In the end, we finally `close` the file.
9696
9797Now, check the contents of the `poem.txt` file to confirm that the program has indeed written to
9898and 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
264264run, in this case `del a`, you can no longer access the variable `a` - it is as if it never existed
265265before at all.
266266
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
268268about the attributes of the print function, or `dir(str)` for the attributes of the str class.
269269
270270There 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[]
192192.How It Works
193193
194194This 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
196196to the object (it is assigned using `self`) and hence is an object variable.
197197
198198Thus, 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
227227
228228Another possible enhancement would be to allow extra files and directories to be passed to the
229229script 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.
231231
232232The most important refinement would be to not use the `os.system` way of creating archives and
233233instead using the http://docs.python.org/2/library/zipfile.html[zipfile] or
You can’t perform that action at this time.
0 commit comments