Python Hands-On Guide For Writing Effective And Idiomatic Code
Python’s ease-of-use supports every engineer to become productive instantly, but this usually implies that they are not using all the features it has to offer.
With this hands-on guide, you discover how to write robust, idiomatic Python code by leveraging its best, and probably most overlooked features.
Author Luciano Ramalho takes the reader through Python’s core language features and libraries and demonstrates how to produce code shorter, faster, and improve readability at the same time.
Many expert programmers try to bend Python to implement patterns they acquired from other programming languages, and they never find Python features outside of their experience.
With the help of this book, those Python programmers thoroughly learn how to become an expert using Python 3.
- Python data model: Understand special methods and how they are the key to the consistent behavior of objects
- Data structures: Take full advantage of built-in types, and understand the text vs. bytes duality in the Unicode age
- Functions as objects: View Python functions as first-class objects, and understand how this affects popular design patterns
- Object-oriented idioms: Build classes by learning about references, mutability, interfaces, operator overloading, and multiple inheritance
- Control flow: Leverage context managers, generators, coroutines, and concurrency with the concurrent.futures and asyncio packages
- Metaprogramming: Understand how properties, attribute descriptors, class decorators, and metaclasses work
PiCAN2 - Python-Programmable PiCAN CAN Bus Interface for Raspberry Pi
This PiCAN2 board provides Controller Area Network (CAN) Bus capabilities for the Raspberry Pi. It uses the Microchip MCP2515 CAN Bus controller with MCP2551 CAN Bus transceiver. Connection are made via DB9 or 3-way screw terminal.
There is an easy-to-install SocketCAN driver, and programming can be accomplished in C or Python.
- CAN 2.0 A/B (ISO 11898) at 1 Mb/s
- High speed SPI Interface (10 MHz)
- Standard and extended data and remote frames
- CAN Bus connection via standard 9-way sub-D connector or screw terminal
- Compatible with OBDII and SAE J1939
- Solder bridge to set different configuration for DB9 connector
- 120Ω termination resistor
- Serial LCD ready
- LED indicator
- Four mounting holes, comply with Pi Hat standard
- SocketCAN driver