# Python book recommendation quick 2023 01 05 2hr window

**URL:** <https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269>\
**Category:** General Discussion\
**Created:** [January 5, 2023, 5:34pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269 "2023-01-05T17:34:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [January 5, 2023, 5:34pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/1 "2023-01-05T17:34:25Z")

</div>

What Python book do you guys recommend?  
(preferably available on Amazon for me)

I saw that the 2009 thread.

> [@Favorite Resources](https://forum.inductiveautomation.com/t/favorite-resources/1108):
>
> Inductive Automation prides itself on building software centered around open and accessible technologies. Of course, this means that in order to be as effective as possible it is necessary to have a good understanding of these technologies. Outside resources such as books and websites can be invaluable. This thread is dedicated to sharing your favorite and most useful resource. To get things started, here are some books that are permanent fixtures on the desks here at Inductive Automation: Get…

Not keen on the title, but [https://cheatography.com/](https://cheatography.com/) referenced by Jordan seems really useful.

I picked up the SQL Cookbook 2nd edition for SQL, and it has helped me with one query since I got it a week ago. I think it is good, but have no real reference since I only have used the one book.  
I should probably go to the library more often.

@pascal.fragnoud do you have a recommendation?  
Did you write a book on Python yet haha?

I was leaning toward :  
Python Pocket Reference: Python In Your Pocket (Pocket Reference (O'Reilly)) Fifth Edition  
published 2014

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 5, 2023, 6:45pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/2 "2023-01-05T18:45:58Z")

</div>

Never read one, so I really couldn't say.  
See if you can find something by Raymond Hettinger maybe ?

Frankly, I'd rather read about computer programming in general (patterns, algorithms, data structures etc) than about one language.

---

<div class="post-metadata">

**Author:** ![alec](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alec/32/41994_2.png) [@alec](https://forum.inductiveautomation.com/u/alec)\
**Post date:** [January 5, 2023, 7:09pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/3 "2023-01-05T19:09:14Z")

</div>

Edited the original post, apparently there is a newer version of the same book.

> **[Python Crash Course, 3rd Edition: Matthes, Eric: 9781718502703: Amazon.com:...](https://www.amazon.com/Python-Crash-Course-Eric-Matthes/dp/1718502702)**
>
> Python Crash Course, 3rd Edition \[Matthes, Eric\] on Amazon.com. \*FREE\* shipping on qualifying offers. Python Crash Course, 3rd Edition

> **[Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to...](https://www.amazon.com/Python-Crash-Course-2nd-Edition/dp/1593279280)**
>
> Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming \[Matthes, Eric\] on Amazon.com. \*FREE\* shipping on qualifying offers. Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [January 5, 2023, 7:32pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/4 "2023-01-05T19:32:44Z")

</div>

I don't know the best choice.  
I went with this after about 2hrs research.  
Thanks for helping me Alec and Pascal.

I am going with The Pragmatic Programmer 20th anniversary  
I saw Raymond Hettinger mention it in a PyBay 2017 video  
and  
Effective Python: 59 Specific Ways to Write Better Python  
The book says Raymond Hettinger contributed

Pascal, Raymond, and the previews were my main factors.

I thought the table of contents/organization were telling.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/5/a53b177c96f36d786aa0823140a3cc0f3d31c586.jpeg)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/0/90b18cd5feba47bc82d6ff7c174f6912415c98f3.jpeg)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/3/d34e0afa1180d24898e7a5ffd8575a5e562a56ef.jpeg)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/a/1a629debbe419015cfccad608178ea254fae8e28.png)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [January 5, 2023, 8:02pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/5 "2023-01-05T20:02:11Z")

</div>

What I think was the biggest leap for me was learning about code smells, what they are, how to avoid and perhaps most importantly WHY they are code smells. This will really help keep your code clean (ie not smelly).

Know when you're doing something wrong and the right way to do it has helped me the most. There's one youtuber I like, ArjanCodes, who has a couple video on Python Code smells that are good. He also has "Code Roasts" where he goes over what looks like decent enough production python code, and then explains the code smells in that and how to improve it. Learning what is bad about code and how to improve, and WHY it is an improvement, I feel is probably one of the biggest things you can do for yourself. He does all his work in python 3 but many of the things are applicable to 2.5/2.7.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [January 5, 2023, 8:13pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/6 "2023-01-05T20:13:34Z")

</div>

Thanks, I'll checkout ArjanCodes videos.

Your text reads like you discovered ArjanCodes on youtube after you had developed a sense for "code smells".  
Where did you learn about that?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 6, 2023, 5:59am UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/7 "2023-01-06T05:59:38Z")

</div>

I like this dude: his videos are about advanced topics and concepts, that actually are useful and that you don't just find easily when typing "how do I do X in python" on google.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [January 6, 2023, 2:55pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/8 "2023-01-06T14:55:09Z")

</div>

`For _ in range(9):`

Arjan used this notation in one of his videos for an example.

I usually say:

`For i in range(9):`

Is this just a preference or is there some value in using the underscore?

* * *

I think I get it. He doesn't use a variable, as he just has the next section of code happen that many times.  
So using underscore is his way to note that.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 6, 2023, 3:32pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/9 "2023-01-06T15:32:35Z")

</div>

An underscore is a legal variable name in python.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [January 6, 2023, 3:44pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/10 "2023-01-06T15:44:12Z")

</div>

I think code smell originated from the book "Clean Code" but I am not sure, however now it is a common term now for code that is showing some common design flaw. Not production breaking flaw necessarily but a flaw that could become a bigger issue down the line if you try to develop on top of it. Not all code smells are equal.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 8, 2023, 2:50pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/11 "2023-01-08T14:50:14Z")

</div>

> [@zacharyw.larson](#):
>
> He doesn't use a variable, as he just has the next section of code happen that many times.  
> So using underscore is his way to note that.

You got that right.  
As Phil said, underscore is a legal name for a variable in python, so you can use it just like any other valid name.  
But, being an underscore, it's often used to say "I'm using a variable here but I'm not gonna use it".

Another example (that's python3 though, don't try this with 2.7):  
Imagine you want the first and last elements from a list.  
You could use

```python
a, *b, c = [1, 2, 3, 4, 5]
# a == 1
# b == [2, 3, 4]
# c == 5

```

But to show that you only care about the first and last element, you could use an underscore:

```python
first, *_, last = [1, 2, 3, 4, 5]

```

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [January 8, 2023, 3:30pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/12 "2023-01-08T15:30:21Z")

</div>

Languages are not much different from each other, (data structures, conditional statements, repetition loops etc), but I am yet to see a good explanation of JYTHON/JAVA integration. How does it work under the hood! I understood it more from some blogs by enthusiasts but couldn't find a proper explanation in any of the books available freely on internet. How they thought of such an amazing concept! This is the key differentiator and the most interesting and practical aspect of Jython in my opinion. It is not a very obvious concept!

If someone can give me a good reference explaining how JYTON/JAVA integration works under the hood, I would be grateful.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [January 9, 2023, 2:15pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/13 "2023-01-09T14:15:49Z")

</div>

I don't know what part is the Java part.

Raymond Hettinger has a really good video on under the hood how the dictionaries evolved that I saw the other day. [Modern Dictionaries by Raymond Hettinger - YouTube](https://youtu.be/p33CVV29OG8)

At 52 minutes he provides some insight how some sections of Python got developed.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 9, 2023, 3:23pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/14 "2023-01-09T15:23:38Z")

</div>

> [@prafull\_j](#):
>
> How does it work under the hood!

You should start with [Jython's own site](https://www.jython.org/). The Documentation links, in particular. If you really want to know how stuff works, I recommend studying [the source code](https://github.com/jython/jython/). A strong background in Java is helpful.

It is all open source.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [January 9, 2023, 4:06pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/15 "2023-01-09T16:06:28Z")

</div>

Thanks. I should spend some serious time with this to understand it properly.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [January 9, 2023, 4:40pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/16 "2023-01-09T16:40:45Z")

</div>

How often does the version change?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 9, 2023, 4:41pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/17 "2023-01-09T16:41:24Z")

</div>

I learned a great deal from those materials when I had a specific task in mind within Ignition. (Jython code modules within my EtherNet/IP Host Device OPC driver, FWIW.)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 9, 2023, 4:45pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/18 "2023-01-09T16:45:12Z")

</div>

> [@zacharyw.larson](#):
>
> the version change

Not often. It was Jython 2.5.2 and 2.5.3 though the entire v7.x line. Since v8.0, it has been v2.7.1 and then v2.7.2.

Ignition applies a few patches to jython, so it is not an exact match to the download from [jython.org](http://jython.org).

---

<div class="post-metadata">

**Author:** ![thecesrom.git](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@thecesrom.git](https://forum.inductiveautomation.com/u/thecesrom.git)\
**Post date:** [January 12, 2023, 12:33am UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/19 "2023-01-12T00:33:35Z")

</div>

This is a good resource, as it uses Python 2 syntax.

> **[Effective Python: 59 Specific Ways to Write Better Python (Effective Software...](https://www.amazon.com/Effective-Python-Specific-Software-Development/dp/0134034287)**
>
> Effective Python: 59 Specific Ways to Write Better Python (Effective Software Development Series): 0884807658059: Computer Science Books @ Amazon.com

---

<div class="post-metadata">

**Author:** ![zachary.roisum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zachary.roisum/32/42809_2.png) [@zachary.roisum](https://forum.inductiveautomation.com/u/zachary.roisum)\
**Post date:** [January 16, 2023, 5:08pm UTC](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269/20 "2023-01-16T17:08:04Z")

</div>

Although not a book, I find W3Schools an excellent reference for Python (and also SQL).

> **[Python Tutorial](https://www.w3schools.com/python/)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

[Next page](https://forum.inductiveautomation.com/t/python-book-recommendation-quick-2023-01-05-2hr-window/68269.md?page=2)
