E-Book, Englisch, 554 Seiten
Romano / Kruger Learn Python Programming
3. Auflage 2024
ISBN: 978-1-80181-552-9
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection
An in-depth introduction to the fundamentals of Python
E-Book, Englisch, 554 Seiten
ISBN: 978-1-80181-552-9
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection
Learn Python Programming, Third Edition is both a theoretical and practical introduction to Python, an extremely flexible and powerful programming language that can be applied to many disciplines. This book will make learning Python easy and give you a thorough understanding of the language. You'll learn how to write programs, build modern APIs, and work with data by using renowned Python data science libraries.
This revised edition covers the latest updates on API management, packaging applications, and testing. There is also broader coverage of context managers and an updated data science chapter.
The book empowers you to take ownership of writing your software and become independent in fetching the resources you need. You will have a clear idea of where to go and how to build on what you have learned from the book.
Through examples, the book explores a wide range of applications and concludes by building real-world Python projects based on the concepts you have learned.
Autoren/Hrsg.
Fachgebiete
Weitere Infos & Material
Table of Contents - A Gentle Introduction to Python
- Built-In Data Types
- Conditionals and Iteration
- Functions, the Building Blocks of Code
- Comprehensions and Generators
- OOP, Decorators, and Iterators
- Exceptions and Context Managers
- Files and Data Persistence
- Cryptography and Tokens
- Testing
- Debugging and Profiling
- GUIs and Scripting
- Data Science in Brief
- Introduction to API Development
- Packaging Python Applications
Preface
The first edition of this book came out on the day of my 40th birthday. It feels like yesterday, but actually it was 6 years ago. In a few weeks, the book became a top seller, and to this day that translates into lovely messages and emails I get from readers all over the world.
A couple of years later, I wrote a second edition. That turned out to be a better book, which kept growing in sales and popularity.
And now here we are, at the third edition, and this time it won't just be me narrating the story, because for this edition I have been joined by my dear friend and colleague, Heinrich Kruger.
Together, we have reworked the book's structure. We removed what we felt didn't fit anymore, and added what we thought would benefit you the most. We have shuffled things around, amended old chapters, and written new ones. We have made sure that both our contributions and our best ideas are on each page you will read. We are both very happy about this.
I always wanted to work on a project like this with Heinrich, for whom I have felt enormous respect since I got to know him. He has brought to this book his unique perspective, his incredible talent as a software developer, and he's helped me with my English too!
Everything has been updated to Python 3.9, but of course most of the code will still work with any recent version of Python 3. The scary chapter about concurrency is gone, and the one on Web programming has been replaced with another which introduces the concept of APIs. We have also added a whole new chapter about packaging Python applications, which we feel is the perfect way to close the book.
We are confident this edition is much better than the previous ones; it's more mature, it tells a better story, and it will take you places.
One thing I am particularly happy about is that the soul of the book is still the same. This is not just a book about Python. This is, first and foremost, a book about programming. A book that aims to convey to you as much information as possible, and sometimes, for practical reasons, it does so by pointing you to the Web to dig deeper, to investigate further.
It is designed to last. It expresses concepts and information in a way that should stand the test of time, for as long as possible. We have put in a great amount of thinking to achieve that.
And it will require you to work hard. The code is available for you to download, and we do encourage you to play with it, expand it, change it, break it, and see things for yourself. We want you to develop critical thinking. We want you to be independent, empowered.
That is the soul of the book, and our hope is that wherever you are in your journey, it will help you go further, become a better programmer, in any way that is possible.
When we received the drafts from the second edition to start working on the third one, I was surprised to notice I could not find myself in those pages. Those pages have shown me how my thinking, and therefore my writing, has changed, in the past few years.
Change is interwoven in the very fabric of this universe. Everything changes, all the time. So, our wish for you is that you never fixate on opinions, that you never grow stale. Instead, we hope our work, and the way we present it to you, will help you stay flexible, smart, pragmatic, and adaptable.
We wish you good luck! And don't forget to enjoy the ride!
Who this book is for
This book is for people who have some programming experience, but not necessarily with Python. Some knowledge of basic programming concepts will come in handy, although it is not a requirement.
Even if you already have some experience with Python, this book can still be useful to you, both as a reference to Python's fundamentals, and for providing a wide range of considerations and suggestions collected over four combined decades of experience.
What this book covers
, , introduces you to fundamental programming concepts and constructs of the Python language. It also guides you through getting Python up and running on your computer.
, , introduces you to Python built-in data types. Python has a very rich set of native data types, and this chapter will give you a description and examples for each of them.
, , teaches you how to control the flow of code by inspecting conditions, applying logic, and performing loops.
, , teaches you how to write functions. Functions are essential to code reuse, to reducing debugging time, and, in general, to writing higher quality code.
, , introduces you to the functional aspects of Python programming. This chapter teaches you how to write comprehensions and generators, which are powerful tools that you can use to write faster, more concise code, and save memory.
, , teaches you the basics of object-oriented programming with Python. It shows you the key concepts and all the potentials of this paradigm. It also shows you one of the most useful features of the language: decorators.
, , introduces the concept of exceptions, which represent errors that occur in applications, and how to handle them. It also covers context managers, which are very useful when dealing with resources.
, , teaches you how to deal with files, streams, data interchange formats, and databases.
, , touches upon the concepts of security, hashes, encryption, and tokens, which are essential for writing secure software.
, , teaches you the fundamentals of testing, and guides you through a few examples on how to test your code, in order to make it more robust, fast, and reliable.
, , shows you the main methods for debugging and profiling code and some examples of how to apply them.
, , guides you through an example from two different points of view: one implementation is a script, and the other one is a Graphical User Interface (GUI) application.
, , illustrates a few key concepts by means of a comprehensive example, using the powerful Jupyter Notebook.
, , introduces API development and type hinting in Python. It also provides different examples on how to consume an API.
, , guides you through the process of preparing a project to be published, and shows you how to upload the result onto the Python Package Index (PyPI).
To get the most out of this book
You are encouraged to follow the examples in this book. You will need a computer, an internet connection, and a browser. The book is written in Python 3.9, but it should also work, for the most part, with any recent version of Python 3. We have given guidelines on how to install Python on your operating system. The procedures to do that normally get out of date quickly, so we recommend you refer to the most up-to-date guide on the Web to find precise setup instructions. We have also explained how to install all the extra libraries used in the various chapters. No particular editor is required to type the code; however, we suggest that those who are interested in following the examples should consider adopting a proper coding environment. We have offered suggestions on this matter in the first chapter.
Download the example code files
The code bundle for the book is hosted on GitHub at https://github.com/PacktPublishing/Learn-Python-Programming-Third-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Download the color images
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781801815093_ColorImages.pdf.
Conventions used
There are a number of text conventions used throughout this book.
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example: "Within the folder, we will create a virtual environment."
A block of code is set as follows:
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:




