From 82e288d62cbed64b1a9711346937da742add46ec Mon Sep 17 00:00:00 2001 From: myd7349 Date: Fri, 12 Sep 2014 16:40:00 +0800 Subject: [PATCH 1/4] Update modules.asciidoc Dear friend: I found that 'dir('print')' in Python 3.4 will get the same output as 'dir(str)'. 'dir(print)', however, works well. --- modules.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.asciidoc b/modules.asciidoc index 4e7244bb..5a9237c8 100644 --- a/modules.asciidoc +++ b/modules.asciidoc @@ -264,7 +264,7 @@ A note on `del` - this statement is used to *delete* a variable/name and after t run, in this case `del a`, you can no longer access the variable `a` - it is as if it never existed before at all. -Note that the `dir()` function works on *any* object. For example, run `dir('print')` to learn +Note that the `dir()` function works on *any* object. For example, run `dir(print)` to learn about the attributes of the print function, or `dir(str)` for the attributes of the str class. There is also a http://docs.python.org/2/library/functions.html#vars[`vars()`] function which can From 186fa6733b39ea6e8a58cda03d4fd7877b4c0fe0 Mon Sep 17 00:00:00 2001 From: myd7349 Date: Fri, 12 Sep 2014 16:43:12 +0800 Subject: [PATCH 2/4] Update problem_solving.asciidoc --- problem_solving.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problem_solving.asciidoc b/problem_solving.asciidoc index 5cb80a3f..2f61ec4b 100644 --- a/problem_solving.asciidoc +++ b/problem_solving.asciidoc @@ -227,7 +227,7 @@ a `-v` option to make your program become more talkative or a `-q` to make it _q Another possible enhancement would be to allow extra files and directories to be passed to the script at the command line. We can get these names from the `sys.argv` list and we can add them to -our `source` list using the `extend`method provided by the `list` class. +our `source` list using the `extend` method provided by the `list` class. The most important refinement would be to not use the `os.system` way of creating archives and instead using the http://docs.python.org/2/library/zipfile.html[zipfile] or From 3a678b015f3c8263a1636e09e557e66588193ec2 Mon Sep 17 00:00:00 2001 From: myd7349 Date: Fri, 12 Sep 2014 16:47:07 +0800 Subject: [PATCH 3/4] Update oop.asciidoc --- oop.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oop.asciidoc b/oop.asciidoc index c3858d0c..3c22f1c7 100644 --- a/oop.asciidoc +++ b/oop.asciidoc @@ -192,7 +192,7 @@ include::programs/oop_objvar.txt[] .How It Works This is a long example but helps demonstrate the nature of class and object variables. Here, -`population` belongs to the`Robot` class and hence is a class variable. The `name` variable belongs +`population` belongs to the `Robot` class and hence is a class variable. The `name` variable belongs to the object (it is assigned using `self`) and hence is an object variable. Thus, we refer to the `population` class variable as `Robot.population` and not as From c738dc8dc05378e6561015e7425c35eec44a12f2 Mon Sep 17 00:00:00 2001 From: myd7349 Date: Fri, 12 Sep 2014 16:51:46 +0800 Subject: [PATCH 4/4] Update io.asciidoc --- io.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io.asciidoc b/io.asciidoc index 63ca688a..91683f2b 100644 --- a/io.asciidoc +++ b/io.asciidoc @@ -92,7 +92,7 @@ loop. This method returns a complete line including the newline character at the line. When an _empty_ string is returned, it means that we have reached the end of the file and we 'break' out of the loop. -In the end, we finally `close`the file. +In the end, we finally `close` the file. Now, check the contents of the `poem.txt` file to confirm that the program has indeed written to and read from that file.