Learn to use Python productively in real-life scenarios at work and in everyday life
If you have mastered the basics of Python and are wanting to explore the language in more depth, this book is for you. By means of concrete examples used in different applications, the book illustrates many aspects of programming (e.g. algorithms, recursion, data structures) and helps problem-solving strategies. Including general ideas and solutions, the specifics of Python and how these can be practically applied are discussed.
Python 3 for Science and Engineering Applications includes:
practical and goal-oriented learning
basic Python techniques
modern Python 3.6+ including comprehensions, decorators and generators
complete code available online
more than 40 exercises, solutions documented online
no additional packages or installation required, 100% pure
Python Topics cover:
identifying large prime numbers and computing Pi
writing and understanding recursive functions with memorisation
computing in parallel and utilising all system cores
processing text data and encrypting messages
comprehending backtracking and solving Sudokus
analysing and simulating games of chance to develop optimal winning strategies
handling genetic code and generating extremely long palindromes
Downloads
Software
This is the second edition of a book aimed at engineers, scientists, and hobbyists who want to interface PCs with hardware projects using graphical user interfaces. Desktop and web-based applications are covered.
The programming language used is Python 3, which is one of the most popular languages around: speed of programming being a key feature. The book has been revised and updated with an emphasis on getting the user to produce practical designs with ease – a text editor is all that is required to produce Python programs.
Hardware interfacing is achieved using an Arduino Uno as a remote slave. A full description and source code of the communication interface is given in the book. The slave provides digital and analog input and outputs. Multiple Unos can be included in one project with all control code written in Python and running on a PC One project involves a PIC microcontroller with the code provided that can be loaded into the PIC using the Uno.
The web applications and server are all implemented in Python, allowing you to access your electronic hardware over the Internet. The Raspberry Pi computer can be used as your web server. An introductory chapter is provided to get you started with using Linux.
The book is written for use with Debian or variations including Mint or Ubuntu. All of the programs in the book are freely available, ready to use and experiment with by way of a download from Elektor.
An Ultra-Rapid Programming Course
This book serves as the very first step to for novices to learn Python programming. The book is divided into ten chapters. In the first chapter, readers are introduced to the basics of Python. It has the detailed instructions for installation on various platforms such as macOS, Windows, FreeBSD, and Linux. It also covers the other aspects of Python programming such as IDEs and Package Manager. The second chapter is where the readers get an opportunity to have a detailed hands-on with Python programming. It covers a group of built-in data structures popularly known as Python Collections. The third chapter covers the important concepts of strings, functions, and recursion.
The fourth chapter focuses on the Object-Oriented Programming with Python. The fifth chapter discusses most commonly used custom data structures such as stack and queue. The sixth chapter spurs the creativity of the readers with Python’s Turtle graphics library. The seventh chapter explores animations and game development using the Pygame library. The eighth chapter covers handling data stored in a variety of file formats. The ninth chapter covers the area of Image processing with Wand library in Python. The tenth and the final chapter presents an array of assorted handy topics in Python.
The entire book follows a step-by-step approach. The explanation of the topic is always followed by a detailed code example. The code examples are also explained in suitable detail and they are followed by the output in the form of text or screenshot wherever possible. Readers will become comfortable with Python programming language by closely following the concepts and the code examples in this book. The book also has references to external resources for readers to explore further.
A download of the software code, and links to tutorial videos can be found on the Elektor website.
Program and build Arduino-based ham station utilities, tools, and instruments
In addition to a detailed introduction to the exciting world of the Arduino microcontroller and its many variants, this book introduces you to the shields, modules, and components you can connect to the Arduino. Many of these components are discussed in detail and used in the projects included in this book to help you understand how these components can be incorporated into your own Arduino projects. Emphasis has been placed on designing and creating a wide range of amateur radio-related projects that can easily be built in just a few days.
This book is written for ham radio operators and Arduino enthusiasts of all skill levels, and includes discussions about the tools, construction methods, and troubleshooting techniques used in creating amateur radio-related Arduino projects. This book teaches you how to create feature-rich Arduino-based projects, with the goal of helping you to advance beyond this book, and design and build your own ham radio Arduino projects.
In addition, this book describes in detail the design, construction, programming, and operation of the following projects:
CW Beacon and Foxhunt Keyer
Mini Weather Station
RF Probe with LED Bar Graph
DTMF Tone Encoder
DTMF Tone Decoder
Waveform Generator
Auto Power On/Off
Bluetooth CW Keyer
Station Power Monitor
AC Current Monitor
This book assumes a basic knowledge of electronics and circuit construction. Basic knowledge of how to program the Arduino using its IDE will also be beneficial.
This book is about teaching the Python programming language using the Raspberry Pi 4 computer. The book makes an introduction to Raspberry Pi 4 and then teaches Python with the topics: variables, strings, arrays, matrices, tuples, lists, dictionaries, user functions, flow of control, printing, keyboard input, graphics, GUI, object oriented programming and many more topics.
The book is aimed for beginners, students, practising engineers, hobbyists, and for anyone else who may want to learn to program in Python.
The book includes many example programs and case studies. All the example programs and case studies have been tested fully by the author and are all working. The example programs aim to teach the various programming concepts of Python. The case studies cover the use of Python in the analysis and design of electronic circuits. Some of the case study topics are:
Resistor colour code identification
Resistive potential divider circuits
Resistive attenuator design
Zener diode voltage regulator design
RC and RLC transient circuits
Circuit frequency response
Saving data on external memory stick
Mesh and node circuit analysis using matrices
Resonance in RLC circuits
Transistor Biasing analysis
Transistor amplifier design
Design of active filters
Interfacing hardware with GPIO, I²C and SPI
Using Wi-Fi with Python and TCP/IP and UDP programs
Using Bluetooth from Python
Full program listings of all the programs used in the book are available at the Elektor website of the book. Readers should be able just to copy and use these programs in their Raspberry Pi projects without any modifications.
Program and build Arduino-based ham station utilities, tools, and instruments
In addition to a detailed introduction to the exciting world of the Arduino microcontroller and its many variants, this book introduces you to the shields, modules, and components you can connect to the Arduino. Many of these components are discussed in detail and used in the projects included in this book to help you understand how these components can be incorporated into your own Arduino projects. Emphasis has been placed on designing and creating a wide range of amateur radio-related projects that can easily be built in just a few days.
This book is written for ham radio operators and Arduino enthusiasts of all skill levels, and includes discussions about the tools, construction methods, and troubleshooting techniques used in creating amateur radio-related Arduino projects. This book teaches you how to create feature-rich Arduino-based projects, with the goal of helping you to advance beyond this book, and design and build your own ham radio Arduino projects.
In addition, this book describes in detail the design, construction, programming, and operation of the following projects:
CW Beacon and Foxhunt Keyer
Mini Weather Station
RF Probe with LED Bar Graph
DTMF Tone Encoder
DTMF Tone Decoder
Waveform Generator
Auto Power On/Off
Bluetooth CW Keyer
Station Power Monitor
AC Current Monitor
This book assumes a basic knowledge of electronics and circuit construction. Basic knowledge of how to program the Arduino using its IDE will also be beneficial.
Erschließen Sie sich eine Welt des interaktiven Lernens mit der robusten Hardware und Software des Science Kit R3. Mit dem Arduino Nano RP2040 Connect, dem Arduino Science Carrier R3 und einer beeindruckenden Auswahl an Sensoren haben Sie alles, was Sie für eine aufregende Bildungsreise benötigen. Unterdessen schließt die Science Journal-App mühelos die Lücke zwischen Theorie und Praxis und erleichtert die Datenerfassung, -aufzeichnung und -interpretation in Echtzeit.
Das Kit verbessert die Lernerfahrung, indem es durch spannende praktische Experimente ein besseres Verständnis komplexer physikalischer Konzepte fördert. Es fördert die wissenschaftliche Kompetenz und schärft die Fähigkeiten zum kritischen Denken durch die Bereitstellung realer Anwendungsszenarien. Mit dem intuitiven Inhaltsleitfaden können sowohl Lehrer als auch Schüler problemlos durch wissenschaftliche Untersuchungen navigieren.
Features
Praktisches experimentelles Lernen: Führen Sie physikalische Experimente durch und verwandeln Sie abstrakte physikalische Konzepte in greifbare und interaktive Erfahrungen.
Echtzeit-Datenerfassung & Analyse: Durch die Integration der Science Journal-App ermöglicht das Kit den Schülern das Sammeln, Aufzeichnen und Interpretieren von Echtzeitdaten mit mobilen Geräten und stärkt so ihre Datenkompetenz und wissenschaftlichen Untersuchungsfähigkeiten.
Lehrer- und schülerfreundliches Design: Ausgestattet mit einem vorinstallierten Programm erfordert das Kit keine Vorkenntnisse in Codierung oder Elektronik. Es verfügt außerdem über eine Bluetooth-Konnektivität für eine einfache Datenübertragung vom Arduino-Board auf die Mobilgeräte der Schüler.
Umfassendes Sensor-Ökosystem: Das Kit wird mit mehreren Sensoren geliefert, die eine breite Palette an Datenerfassungsmöglichkeiten bieten und es an sich ändernde Bildungsbedürfnisse anpassen.
Kostenlose geführte Kurse – Explore Physics: Enthält einen intuitiven Kursführer, der Lehrer und Schüler bei der Verwendung des Kits, der Präsentation und Analyse von Daten sowie der Bewertung experimenteller Ergebnisse unterstützt. Diese Kurse helfen den Studierenden auch dabei, ihre wissenschaftlichen Entdeckungen effektiv zu kommunizieren.
Umfassende Unterrichtsunterstützung: Mit seiner intuitiven Anleitung erleichtert das Arduino Science Kit R3 den Unterrichtsprozess für Lehrer. Es gibt nicht nur Anweisungen zur Verwendung des Kits, sondern hilft auch bei der Präsentation, Analyse und Auswertung von Daten und stellt so sicher, dass Schüler ihre wissenschaftlichen Entdeckungen effektiv kommunizieren.
Technische Daten
Hardware
Arduino Nano RP2040 Connect
Arduino Science Carrier R3
Integrierte Sensoren:
Luftqualität, Temperatur, Luftfeuchtigkeit & Druck
IMU: 6-Achsen-Linearbeschleunigungsmesser, Gyroskop und Magnetometer
Nähe, Umgebungslicht, Lichtfarbe
Spannungs- oder elektrische Potenzialdifferenz
Elektrischer Strom
Elektrischer Widerstand
Funktionsgeneratoren zum Sehen und Hören der Auswirkung von Frequenz, Amplitude und Phase auf eine Schallwelle
Umgebungsgeräuschintensitätssensor
Schnittstellen
2x Grove-Analogeingänge (für externen Temperaturfühler)
2x Grove I²C-Ports (für externen Distanz- und Ping-Echo-Sensor)
1x Batterie-JST-Anschluss
2x Ausgangsanschlüsse, die mit einem niedrigeren Leistungssignal von Funktionsgeneratoren (zukünftige Generation) verbunden sind
1x 3,3 V Ausgangsanschluss und Masse
2x Lautsprecheranschlüsse verbunden mit Funktionsgeneratoren
Sonstige
50 cm langes doppelseitiges Kabel (blau): Krokodilklemmen an einem Ende, Bananenstecker am anderen
20 cm doppelseitiges Kabel (schwarz): Krokodilklemmen an einem Ende, Bananenstecker am anderen
20 cm doppelseitiges Kabel (rot): Krokodilklemmen an einem Ende, Bananenstecker am anderen
VELCRO-Streifen
Silikonständer
Externer Temperaturfühlersensor
Ultraschall-Abstandssensor
Grove-Kabel 4-poliges Gehäuse mit Schloss x2 (L=200 mm)
USB-C-Kabel
50 cm doppelseitiges Kabel (gelb): Krokodilklemmen an einem Ende, Bananenstecker am anderen
2x Lautsprecher
Kabel für Batteriehalter mit JST-Stecker
Batteriehalter für vier 1V5 AA-Batterien
Learn programming for Alexa devices, extend it to smart home devices and control the Raspberry Pi
The book is split into two parts: the first part covers creating Alexa skills and the second part, designing Internet of Things and Smart Home devices using a Raspberry Pi.
The first chapters describe the process of Alexa communication, opening an Amazon account and creating a skill for free. The operation of an Alexa skill and terminology such as utterances, intents, slots, and conversations are explained. Debugging your code, saving user data between sessions, S3 data storage and Dynamo DB database are discussed.
In-skill purchasing, enabling users to buy items for your skill as well as certification and publication is outlined. Creating skills using AWS Lambda and ASK CLI is covered, along with the Visual Studio code editor and local debugging. Also covered is the process of designing skills for visual displays and interactive touch designs using Alexa Presentation Language.
The second half of the book starts by creating a Raspberry Pi IoT 'thing' to control a robot from your Alexa device. This covers security issues and methods of sending and receiving MQTT messages between an Alexa device and the Raspberry Pi.
Creating a smart home device is described including forming a security profile, linking with Amazon, and writing a Lambda function that gets triggered by an Alexa skill. Device discovery and on/off control is demonstrated.
Next, readers discover how to control a smart home Raspberry Pi display from an Alexa skill using Simple Queue Service (SQS) messaging to switch the display on and off or change the color.
A node-RED design is discussed from the basic user interface right up to configuring MQTT nodes. MQTT messages sent from a user are displayed on a Raspberry Pi.
A chapter discusses sending a proactive notification such as a weather alert from a Raspberry Pi to an Alexa device. The book concludes by explaining how to create Raspberry Pi as a stand-alone Alexa device.
For Raspberry Pi, ESP32 and nRF52 with Python, Arduino and Zephyr
Bluetooth Low Energy (BLE) radio chips are ubiquitous from Raspberry Pi to light bulbs. BLE is an elaborate technology with a comprehensive specification, but the basics are quite accessible.
A progressive and systematic approach will lead you far in mastering this wireless communication technique, which is essential for working in low power scenarios.
In this book, you’ll learn how to:
Discover BLE devices in the neighborhood by listening to their advertisements.
Create your own BLE devices advertising data.
Connect to BLE devices such as heart rate monitors and proximity reporters.
Create secure connections to BLE devices with encryption and authentication.
Understand BLE service and profile specifications and implement them.
Reverse engineer a BLE device with a proprietary implementation and control it with your own software.
Make your BLE devices use as little power as possible.
This book shows you the ropes of BLE programming with Python and the Bleak library on a Raspberry Pi or PC, with C++ and NimBLE-Arduino on Espressif’s ESP32 development boards, and with C on one of the development boards supported by the Zephyr real-time operating system, such as Nordic Semiconductor's nRF52 boards.
Starting with a very little amount of theory, you’ll develop code right from the beginning. After you’ve completed this book, you’ll know enough to create your own BLE applications.
Nahezu alle Menschen werden zunehmend mit den Anwendungen der „Künstlichen Intelligenz“ (KI oder AI für engl. Artificial Intelligence) konfrontiert. Musik- oder Videoempfehlungen, Navigationssysteme, Einkaufsvorschläge etc. basieren auf Verfahren, die diesem Bereich zugeordnet werden können.
Der Begriff „Künstliche Intelligenz“ wurde 1956 auf einer internationalen Konferenz, dem Dartmouth Summer Research Project geprägt. Eine grundlegende Idee war dabei, die Funktionsweise des menschlichen Gehirns zu modellieren und darauf basierend fortschrittliche Computersysteme zu konstruieren. Bald sollte klar sein, wie der menschliche Verstand funktioniert. Die Übertragung auf eine Maschine wurde nur noch als ein kleiner Schritt angesehen. Diese Vorstellung erwies sich als etwas zu optimistisch. Dennoch sind die Fortschritte der modernen KI, beziehungsweise ihrem Teilgebiet dem sogenannten „Machine Learning“, nicht mehr zu übersehen.
Um die Methoden des Machine Learnings näher kennenzulernen, sollen in diesem Buch mehrere verschiedene Systeme zum Einsatz kommen. Neben dem PC werden sowohl der Raspberry Pi als auch der „Maixduino“ in den einzelnen Projekten ihre Fähigkeiten beweisen. Zusätzlich zu Anwendungen wie Objekt- und Gesichtserkennung entstehen dabei auch praktisch einsetzbare Systeme wie etwa Flaschendetektoren, Personenzähler oder ein „Sprechendes Auge“.
Letzteres ist in der Lage, automatisch erkannte Objekte oder Gesichter akustisch zu beschreiben. Befindet sich beispielsweise ein Fahrzeug im Sichtfeld der angeschlossenen Kamera, so wird die Information „I see a car!“ über elektronisch erzeugte Sprache ausgegeben. Derartige Geräte sind hochinteressante Beispiele dafür, wie etwa auch blinde oder stark sehbehinderte Menschen von KI-Systemen profitieren können.
Nahezu alle Menschen werden zunehmend mit den Anwendungen der „Künstlichen Intelligenz“ (KI oder AI für engl. Artificial Intelligence) konfrontiert. Musik- oder Videoempfehlungen, Navigationssysteme, Einkaufsvorschläge etc. basieren auf Verfahren, die diesem Bereich zugeordnet werden können.
Der Begriff „Künstliche Intelligenz“ wurde 1956 auf einer internationalen Konferenz, dem Dartmouth Summer Research Project geprägt. Eine grundlegende Idee war dabei, die Funktionsweise des menschlichen Gehirns zu modellieren und darauf basierend fortschrittliche Computersysteme zu konstruieren. Bald sollte klar sein, wie der menschliche Verstand funktioniert. Die Übertragung auf eine Maschine wurde nur noch als ein kleiner Schritt angesehen. Diese Vorstellung erwies sich als etwas zu optimistisch. Dennoch sind die Fortschritte der modernen KI, beziehungsweise ihrem Teilgebiet dem sogenannten „Machine Learning“, nicht mehr zu übersehen.
Um die Methoden des Machine Learnings näher kennenzulernen, sollen in diesem Buch mehrere verschiedene Systeme zum Einsatz kommen. Neben dem PC werden sowohl der Raspberry Pi als auch der „Maixduino“ in den einzelnen Projekten ihre Fähigkeiten beweisen. Zusätzlich zu Anwendungen wie Objekt- und Gesichtserkennung entstehen dabei auch praktisch einsetzbare Systeme wie etwa Flaschendetektoren, Personenzähler oder ein „Sprechendes Auge“.
Letzteres ist in der Lage, automatisch erkannte Objekte oder Gesichter akustisch zu beschreiben. Befindet sich beispielsweise ein Fahrzeug im Sichtfeld der angeschlossenen Kamera, so wird die Information „I see a car!“ über elektronisch erzeugte Sprache ausgegeben. Derartige Geräte sind hochinteressante Beispiele dafür, wie etwa auch blinde oder stark sehbehinderte Menschen von KI-Systemen profitieren können.
For Raspberry Pi, ESP32 and nRF52 with Python, Arduino and Zephyr
Bluetooth Low Energy (BLE) radio chips are ubiquitous from Raspberry Pi to light bulbs. BLE is an elaborate technology with a comprehensive specification, but the basics are quite accessible.
A progressive and systematic approach will lead you far in mastering this wireless communication technique, which is essential for working in low power scenarios.
In this book, you’ll learn how to:
Discover BLE devices in the neighborhood by listening to their advertisements.
Create your own BLE devices advertising data.
Connect to BLE devices such as heart rate monitors and proximity reporters.
Create secure connections to BLE devices with encryption and authentication.
Understand BLE service and profile specifications and implement them.
Reverse engineer a BLE device with a proprietary implementation and control it with your own software.
Make your BLE devices use as little power as possible.
This book shows you the ropes of BLE programming with Python and the Bleak library on a Raspberry Pi or PC, with C++ and NimBLE-Arduino on Espressif’s ESP32 development boards, and with C on one of the development boards supported by the Zephyr real-time operating system, such as Nordic Semiconductor's nRF52 boards.
Starting with a very little amount of theory, you’ll develop code right from the beginning. After you’ve completed this book, you’ll know enough to create your own BLE applications.