From 92096a65ed309e84439f84f7b410a044386a2959 Mon Sep 17 00:00:00 2001 From: Michael Herman Date: Sun, 5 Jul 2015 08:35:31 -0600 Subject: python/en - added two resources --- python.html.markdown | 2 ++ 1 file changed, 2 insertions(+) (limited to 'python.html.markdown') diff --git a/python.html.markdown b/python.html.markdown index ace3f794..354fd9a1 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -630,10 +630,12 @@ print say(say_please=True) # Can you buy me a beer? Please! I am poor :( * [Hitchhiker's Guide to Python](http://docs.python-guide.org/en/latest/) * [Python Module of the Week](http://pymotw.com/2/) * [A Crash Course in Python for Scientists](http://nbviewer.ipython.org/5920182) +* [First Steps With Python](https://realpython.com/learn/python-first-steps/) ### Dead Tree * [Programming Python](http://www.amazon.com/gp/product/0596158106/ref=as_li_qf_sp_asin_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596158106&linkCode=as2&tag=homebits04-20) * [Dive Into Python](http://www.amazon.com/gp/product/1441413022/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1441413022&linkCode=as2&tag=homebits04-20) * [Python Essential Reference](http://www.amazon.com/gp/product/0672329786/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0672329786&linkCode=as2&tag=homebits04-20) +* [Real Python](https://realpython.com/) -- cgit v1.2.3 From c6caa7664c53d8decb2076987f601a7c99fd6951 Mon Sep 17 00:00:00 2001 From: Michael Herman Date: Sun, 5 Jul 2015 21:12:12 -0600 Subject: Update python.html.markdown --- python.html.markdown | 2 -- 1 file changed, 2 deletions(-) (limited to 'python.html.markdown') diff --git a/python.html.markdown b/python.html.markdown index 354fd9a1..b89fe57d 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -637,5 +637,3 @@ print say(say_please=True) # Can you buy me a beer? Please! I am poor :( * [Programming Python](http://www.amazon.com/gp/product/0596158106/ref=as_li_qf_sp_asin_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596158106&linkCode=as2&tag=homebits04-20) * [Dive Into Python](http://www.amazon.com/gp/product/1441413022/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1441413022&linkCode=as2&tag=homebits04-20) * [Python Essential Reference](http://www.amazon.com/gp/product/0672329786/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0672329786&linkCode=as2&tag=homebits04-20) -* [Real Python](https://realpython.com/) - -- cgit v1.2.3 From d995a0ae2792b3e6acc832438b84e9fed570d0e4 Mon Sep 17 00:00:00 2001 From: Mark Miller <725mrm@gmail.com> Date: Thu, 16 Jul 2015 16:45:25 -0500 Subject: Changed %s formatting to {n} style. If line 117 is accurate, then {n} style string formatting is the preferred style, and it should be reflected in the examples. --- python.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'python.html.markdown') diff --git a/python.html.markdown b/python.html.markdown index b89fe57d..3b233f7f 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -327,8 +327,8 @@ prints: mouse is a mammal """ for animal in ["dog", "cat", "mouse"]: - # You can use % to interpolate formatted strings - print "%s is a mammal" % animal + # You can use {0} to interpolate formatted strings. (See above.) + print "{0} is a mammal".format(animal) """ "range(number)" returns a list of numbers @@ -387,7 +387,7 @@ else: # Optional clause to the try/except block. Must follow all except blocks # Use "def" to create new functions def add(x, y): - print "x is %s and y is %s" % (x, y) + print "x is {0} and y is {1}".format(x, y) return x + y # Return values with a return statement # Calling functions with parameters @@ -497,7 +497,7 @@ class Human(object): # An instance method. All methods take "self" as the first argument def say(self, msg): - return "%s: %s" % (self.name, msg) + return "{0}: {1}".format(self.name, msg) # A class method is shared among all instances # They are called with the calling class as the first argument -- cgit v1.2.3 From 8a968db2bc0f596e2e9d865b73d909b02ff774d6 Mon Sep 17 00:00:00 2001 From: Al Sweigart Date: Thu, 23 Jul 2015 11:24:40 -0700 Subject: Added links to the free book "Automate the Boring Stuff with Python" to the "Free Online" section. --- python.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'python.html.markdown') diff --git a/python.html.markdown b/python.html.markdown index 3b233f7f..88e0deb1 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -624,6 +624,7 @@ print say(say_please=True) # Can you buy me a beer? Please! I am poor :( ### Free Online +* [Automate the Boring Stuff with Python](https://automatetheboringstuff.com) * [Learn Python The Hard Way](http://learnpythonthehardway.org/book/) * [Dive Into Python](http://www.diveintopython.net/) * [The Official Docs](http://docs.python.org/2.6/) -- cgit v1.2.3