From 678fa3b97468a903fc256d95c58f54db5a531a64 Mon Sep 17 00:00:00 2001 From: Patrick Callahan Date: Thu, 1 Sep 2016 02:28:23 -0400 Subject: Remove Python 2 resources from Python 3 page (#2350) There were several resources here that teach Python 2, but not Python 3. I removed them so that a reader will only see resources that apply to Python 3. --- python3.html.markdown | 5 ----- 1 file changed, 5 deletions(-) (limited to 'python3.html.markdown') diff --git a/python3.html.markdown b/python3.html.markdown index 6b3486a6..09b041b8 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -887,12 +887,9 @@ 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/) * [Ideas for Python Projects](http://pythonpracticeprojects.com) * [The Official Docs](http://docs.python.org/3/) * [Hitchhiker's Guide to Python](http://docs.python-guide.org/en/latest/) -* [A Crash Course in Python for Scientists](http://nbviewer.ipython.org/5920182) * [Python Course](http://www.python-course.eu/index.php) * [First Steps With Python](https://realpython.com/learn/python-first-steps/) * [A curated list of awesome Python frameworks, libraries and software](https://github.com/vinta/awesome-python) @@ -903,5 +900,3 @@ print(say(say_please=True)) # Can you buy me a beer? Please! I am poor :( ### 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) -- cgit v1.2.3 From 7beaa529b912ccda6e26eee85acae50e79c6d6d5 Mon Sep 17 00:00:00 2001 From: Patrick Callahan Date: Thu, 1 Sep 2016 17:27:33 -0400 Subject: [python3/en] Adding "Dive Into Python 3" (#2353) The previous version of this file had the original Dive Into Python, which was written with Python 2 in mind. It has come to my attention that the author of the original has published an updated version designed for Python 3, so I added this version back in. --- python3.html.markdown | 2 ++ 1 file changed, 2 insertions(+) (limited to 'python3.html.markdown') diff --git a/python3.html.markdown b/python3.html.markdown index 09b041b8..dc534f74 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -896,7 +896,9 @@ print(say(say_please=True)) # Can you buy me a beer? Please! I am poor :( * [30 Python Language Features and Tricks You May Not Know About](http://sahandsaba.com/thirty-python-language-features-and-tricks-you-may-not-know.html) * [Official Style Guide for Python](https://www.python.org/dev/peps/pep-0008/) * [Python 3 Computer Science Circles](http://cscircles.cemc.uwaterloo.ca/) +* [Dive Into Python 3](http://www.diveintopython3.net/index.html) ### 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 3](https://www.amazon.com/gp/product/1430224150?ie=UTF8&tag=diveintomark-20&creativeASIN=1430224150) -- cgit v1.2.3 From 48ca03c3f9cfa1dc18ece421e98bf62072d519f0 Mon Sep 17 00:00:00 2001 From: PhoenixYip Date: Tue, 6 Sep 2016 16:38:47 +0800 Subject: correction for the set comprehension in py3 (#2358) --- python3.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python3.html.markdown') diff --git a/python3.html.markdown b/python3.html.markdown index dc534f74..5298553f 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -602,7 +602,7 @@ list(filter(lambda x: x > 5, [3, 4, 5, 6, 7])) # => [6, 7] [x for x in [3, 4, 5, 6, 7] if x > 5] # => [6, 7] # You can construct set and dict comprehensions as well. -{x for x in 'abcddeef' if x in 'abc'} # => {'d', 'e', 'f'} +{x for x in 'abcddeef' if x not in 'abc'} # => {'d', 'e', 'f'} {x: x**2 for x in range(5)} # => {0: 0, 1: 1, 2: 4, 3: 9, 4: 16} -- cgit v1.2.3 From 2067ad6a5203d7799f734f5f956b10473dd56e00 Mon Sep 17 00:00:00 2001 From: Patrick Callahan Date: Tue, 6 Sep 2016 12:57:47 -0400 Subject: [Eng/Python3] add new book: "Learn Python 3.0 VISUALLY" (#2360) * add new book * sanitized link --- python3.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'python3.html.markdown') diff --git a/python3.html.markdown b/python3.html.markdown index 5298553f..a56960a7 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -902,3 +902,4 @@ 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 3](https://www.amazon.com/gp/product/1430224150?ie=UTF8&tag=diveintomark-20&creativeASIN=1430224150) +* [Learn Python 3.0 VISUALLY](https://www.amazon.com/Learn-Python-3-0-VISUALLY-Interactive-ebook/dp/B00YI58B9U/) -- cgit v1.2.3 From 048163b7bff3406db6eee8b8ac0de38dedbb3b4a Mon Sep 17 00:00:00 2001 From: Subhrajyoti Sen Date: Wed, 21 Sep 2016 20:37:24 +0530 Subject: Update python3.html.markdown (#2381) --- python3.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'python3.html.markdown') diff --git a/python3.html.markdown b/python3.html.markdown index a56960a7..764262d9 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -897,6 +897,7 @@ print(say(say_please=True)) # Can you buy me a beer? Please! I am poor :( * [Official Style Guide for Python](https://www.python.org/dev/peps/pep-0008/) * [Python 3 Computer Science Circles](http://cscircles.cemc.uwaterloo.ca/) * [Dive Into Python 3](http://www.diveintopython3.net/index.html) +* [A Crash Course in Python for Scientists](http://nbviewer.jupyter.org/gist/anonymous/5924718) ### Dead Tree -- cgit v1.2.3 From 5bebeff0c32bb1ff1edbe7d1fdc68c82cbf44e11 Mon Sep 17 00:00:00 2001 From: ven Date: Tue, 4 Oct 2016 15:40:48 +0200 Subject: Update python3.html.markdown --- python3.html.markdown | 6 ------ 1 file changed, 6 deletions(-) (limited to 'python3.html.markdown') diff --git a/python3.html.markdown b/python3.html.markdown index 764262d9..341f0a39 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -898,9 +898,3 @@ print(say(say_please=True)) # Can you buy me a beer? Please! I am poor :( * [Python 3 Computer Science Circles](http://cscircles.cemc.uwaterloo.ca/) * [Dive Into Python 3](http://www.diveintopython3.net/index.html) * [A Crash Course in Python for Scientists](http://nbviewer.jupyter.org/gist/anonymous/5924718) - -### 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 3](https://www.amazon.com/gp/product/1430224150?ie=UTF8&tag=diveintomark-20&creativeASIN=1430224150) -* [Learn Python 3.0 VISUALLY](https://www.amazon.com/Learn-Python-3-0-VISUALLY-Interactive-ebook/dp/B00YI58B9U/) -- cgit v1.2.3 From 8905c0c5bc7f6a7947a4fd0bcef8cf085ed08366 Mon Sep 17 00:00:00 2001 From: Srinivas Gorur-Shandilya Date: Thu, 20 Oct 2016 09:57:55 -0400 Subject: [python3] updated docs on division for python3 (#2473) * updated docs on division for python3 prev. docs were confusing, did not show how to actually divide. * modified language about python division * fixed grammar --- python3.html.markdown | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'python3.html.markdown') diff --git a/python3.html.markdown b/python3.html.markdown index 341f0a39..43e90299 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -38,7 +38,7 @@ Note: This article applies to Python 3 specifically. Check out [here](http://lea 8 - 1 # => 7 10 * 2 # => 20 -# Except division which returns floats, real numbers, by default +# Except division which defaults to rounding down 35 / 5 # => 7.0 # Result of integer division truncated down both for positive and negative. @@ -47,8 +47,12 @@ Note: This article applies to Python 3 specifically. Check out [here](http://lea -5 // 3 # => -2 -5.0 // 3.0 # => -2.0 -# When you use a float, results are floats -3 * 2.0 # => 6.0 +# When one of the inputs is a float, result is a float +10.0 / 3 # => 3.3333333333333335 + +# to force this behavior on integers, use +from __future__ import division +10 / 3 # => 3.3333333333333335 # Modulo operation 7 % 3 # => 1 -- cgit v1.2.3 From e68bf145bce6386972777745205d362f6e6d3f27 Mon Sep 17 00:00:00 2001 From: Harry Moreno Date: Thu, 20 Oct 2016 17:08:44 -0400 Subject: Add python3 class notes (#2479) * explain that you can place the human and bat classes into seperate files * explain how to import specific functions from other files --- python3.html.markdown | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python3.html.markdown') diff --git a/python3.html.markdown b/python3.html.markdown index 43e90299..9ce7790b 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -765,8 +765,13 @@ if __name__ == '__main__': print(b.say('hello')) print(b.fly) +# To take advantage of modularization by file you could place the classes above in their own files, +# say, human.py and bat.py +# to import functions from other files use the following format # from "filename-without-extension" import "function-or-class" + +# superhero.py from human import Human from bat import Bat -- cgit v1.2.3