The Python apprentice : a practical and thorough introduction to the Python programming language
Learn the Python skills and culture you need to become a productive member of any Python project. About This Book Taking a practical approach to studying Python A clear appreciation of the sequence-oriented parts of Python Emphasis on the way in which Python code is structured Learn how to produce b...
Saved in:
Main Authors: | , |
---|---|
Format: | eBook |
Language: | English |
Published: |
Birmingham, UK :
Packt Publishing,
2017.
|
Subjects: | |
ISBN: | 9781523112203 1523112204 9781788298667 1788298667 9781788293181 |
Physical Description: | 1 online resource (1 volume) : illustrations |
LEADER | 13018cam a2200421 i 4500 | ||
---|---|---|---|
001 | kn-ocn993258585 | ||
003 | OCoLC | ||
005 | 20240717213016.0 | ||
006 | m o d | ||
007 | cr cn||||||||| | ||
008 | 170710s2017 enka o 000 0 eng d | ||
040 | |a UMI |b eng |e rda |e pn |c UMI |d OCLCF |d IDEBK |d STF |d OCLCQ |d TOH |d UPM |d OIP |d KNOVL |d COO |d UOK |d CEF |d KSU |d WYU |d C6I |d UAB |d CZL |d OCLCO |d OCLCQ |d OCLCO |d OCLCQ |d DXU | ||
020 | |a 9781523112203 |q (electronic bk.) | ||
020 | |a 1523112204 |q (electronic bk.) | ||
020 | |z 9781788298667 | ||
020 | |z 1788298667 | ||
020 | |z 9781788293181 | ||
035 | |a (OCoLC)993258585 |z (OCoLC)1097165382 | ||
100 | 1 | |a Smallshire, Robert, |e author. | |
245 | 1 | 4 | |a The Python apprentice : |b a practical and thorough introduction to the Python programming language / |c Robert Smallshire, Austin Bingham. |
264 | 1 | |a Birmingham, UK : |b Packt Publishing, |c 2017. | |
300 | |a 1 online resource (1 volume) : |b illustrations | ||
336 | |a text |b txt |2 rdacontent | ||
337 | |a computer |b c |2 rdamedia | ||
338 | |a online resource |b cr |2 rdacarrier | ||
506 | |a Plný text je dostupný pouze z IP adres počítačů Univerzity Tomáše Bati ve Zlíně nebo vzdáleným přístupem pro zaměstnance a studenty | ||
520 | |a Learn the Python skills and culture you need to become a productive member of any Python project. About This Book Taking a practical approach to studying Python A clear appreciation of the sequence-oriented parts of Python Emphasis on the way in which Python code is structured Learn how to produce bug-free code by using testing tools Who This Book Is For The Python Apprentice is for anyone who wants to start building, creating and contributing towards a Python project. No previous knowledge of Python is required, although at least some familiarity with programming in another language is helpful. What You Will Learn Learn the language of Python itself Get a start on the Python standard library Learn how to integrate 3rd party libraries Develop libraries on your own Become familiar with the basics of Python testing In Detail Experienced programmers want to know how to enhance their craft and we want to help them start as apprentices with Python. We know that before mastering Python you need to learn the culture and the tools to become a productive member of any Python project. Our goal with this book is to give you a practical and thorough introduction to Python programming, providing you with the insight and technical craftsmanship you need to be a productive member of any Python project. Python is a big language, and it's not our intention with this book to cover everything there is to know. We just want to make sure that you, as the developer, know the tools, basic idioms and of course the ins and outs of the language, the standard library and other modules to be able to jump into most projects. Style and approach We introduce topics gently and then revisit them on multiple occasions to add the depth required to support your progression as a Python developer. We've worked hard to structure the syllabus to avoid forward references. On only a few occasions do we require you to accept techniques on trust, before explaining them later; where we do, it's to deliberately establish good habits. | ||
505 | 0 | |a Cover -- Copyright -- Credits -- About the Authors -- www.PacktPub.com -- Customer Feedback -- Table of Contents -- Preface -- Chapter 1: Getting started -- Obtaining and installing Python 3 -- Windows -- macOS -- Linux -- Starting Python command line REPL -- Leaving the REPL -- Windows -- Unix -- Code structure and significant indentation -- Python culture -- Importing standard library modules -- Getting help() -- Counting fruit with math.factorial() -- Different types of numbers -- Scalar data types: integers, floats, None and bool -- int -- float -- Special floating point values -- Promotion to float -- None -- bool -- Relational operators -- Rich comparison operators -- Control flow: if-statements and while-loops -- Conditional control flow: The if-statement -- if...else -- if...elif...else -- Conditional repetition: the while-loop -- Exiting loops with break -- Summary -- Chapter 2: Strings and Collections -- str -- an immutable sequence of Unicode code points -- String quoting styles -- Moment of zen -- Concatenation of adjacent strings -- Multiline strings and newlines -- Raw strings -- The str constructor -- Strings as sequences -- String methods -- Strings with Unicode -- The bytes type - an immutable sequence of bytes -- Literal bytes -- Converting between bytes and str -- list -- a sequence of objects -- The dict type -- associating keys with values -- The For-loops -- iterating over series of items -- Putting it all together -- Summary -- Chapter 3: Modularity -- Organizing code in a .py file -- Running Python programs from the operating system shell -- Importing modules into the REPL -- Defining functions -- Organizing our module into functions -- The __name__ type and executing modules from the command line -- The Python execution model -- The difference between modules, scripts, and programs. | |
505 | 8 | |a Setting up a main function with command line argument -- Accepting command line arguments -- Moment of zen -- Docstrings -- Comments -- Shebang -- Executable Python programs on Linux and Mac -- Executable Python programs on Windows -- Summary -- Chapter 4: Built-in types and the object model -- The nature of Python object references -- Reassigning a reference -- Assigning one reference to another -- Exploring value vs. identity with id() -- Testing for equality of identity with is -- Mutating without mutating -- References to mutable objects -- Equality of value (equivalence) versus equality of identity -- Argument passing semantics -- pass by object-reference -- Modifying external objects in a function -- Binding new objects in a function -- Argument passing is reference binding -- Python return semantics -- Function arguments in detail -- Default parameter values -- Keyword arguments -- When are default arguments evaluated? -- The Python type system -- Dynamic typing in Python -- Strong typing in Python -- Variable declaration and scoping -- The LEGB rule -- Scopes in action -- Identical names in global and local scope -- The global keyword -- Moment of zen -- Everything is an object -- Inspecting a function -- Summary -- Chapter 5: Exploring Built-in Collection types -- tuple -- an immutable sequence of objects -- Literal tuples -- Tuple element access -- The length of a tuple -- Iterating over a tuple -- Concatenating and repetition of tuples -- Nested tuples -- Single-element tuples -- Empty tuples -- Optional parentheses -- Returning and unpacking tuples -- Swapping variables with tuple unpacking -- The tuple constructor -- Membership tests -- Strings in action -- The length of a string -- Concatenating strings -- Joining strings -- Splitting strings -- Moment of zen -- Partitioning strings -- String formatting -- Other string methods. | |
505 | 8 | |a Range -- a collection of evenly spaced integers -- Starting value -- Step argument -- Not using range: enumerate() -- list in action -- Negative indexing for lists (and other sequences) -- Slicing lists -- Copying lists -- Shallow copies -- Repeating lists -- Finding list elements with index() -- Membership testing with count() and in -- Removing list elements by index with del -- Removing list elements by value with remove() -- Inserting into a list -- Concatenating lists -- Rearranging list elements -- Out-of-place rearrangement -- Dictionaries -- Copying dictionaries -- Updating dictionaries -- Iterating over dictionary keys -- Iterating over dictionary values -- Iterating over key-value pairs -- Membership testing for dictionary keys -- Removing dictionary items -- Mutability of dictionaries -- Pretty printing -- set -- an unordered collection of unique elements -- The set constructor -- Iterating over sets -- Membership testing of sets -- Adding elements to sets -- Removing elements from sets -- Copying sets -- Set algebra operations -- Union -- Intersection -- Difference -- Symmetric difference -- Subset relationships -- Collection protocols -- Container protocol -- Sized protocol -- Iterable protocol -- Sequence protocol -- Other protocols -- Summary -- Chapter 6: Exceptions -- Exceptions and control flow -- Handling exceptions -- Handling multiple exceptions -- Programmer errors -- Empty blocks -- the pass statement -- Exception objects -- Imprudent return codes -- Re-raising exceptions -- Exceptions are part of your function's API -- Exceptions raised by Python -- Catching exceptions -- Raising exceptions explicitly -- Guard clauses -- Exceptions, APIs, and protocols -- IndexError -- ValueError -- KeyError -- Choosing not to guard against TypeError -- Pythonic style -- EAFP versus LBYL -- Clean-up actions -- Moment of zen. | |
505 | 8 | |a Platform-specific code -- Summary -- Chapter 7: Comprehensions, iterables, and generators -- Comprehensions -- List comprehensions -- List comprehension syntax -- Elements of a list comprehension -- Set comprehensions -- Dictionary comprehensions -- Comprehension complexity -- Filtering comprehensions -- Combining filtering and transformation -- Moment of zen -- Iteration protocols -- An example of the iteration protocols -- A more practical example of the iteration protocols -- Generator functions -- The yield keyword -- Generators are iterators -- When is generator code executed? -- Maintaining explicit state in the generator function -- The first stateful generator: take() -- The second stateful generator: distinct() -- Understand these generators! -- Lazy generator pipelines -- Laziness and the infinite -- Generating the Lucas series -- Generator expressions -- [Generator objects only run once] -- Generator objects only run once -- Iteration without memory -- Optional parentheses -- Using an if-clause in generator expressions -- Batteries included iteration tools -- Introducing itertools -- Sequences of booleans -- Merging sequences with zip -- More than two sequences with zip() -- Lazily concatenating sequences with chain() -- Pulling it all together -- Summary -- Generators -- Iteration tools -- Chapter 8: Defining new types with classes -- Defining classes -- Instance methods -- Instance initializers -- A lack of access modifiers -- Validation and invariants -- Adding a second class -- Collaborating classes -- Moment of zen -- Booking seats -- Allocating seats to passengers -- Naming methods for implementation details -- Implementing relocate_passenger() -- Counting available seats -- Sometimes the only object you need is a function -- Making Flight create boarding cards -- Polymorphism and duck-typing -- Refactoring Aircraft. | |
505 | 8 | |a Inheritance and implementation sharing -- A base class for aircraft -- Inheriting from Aircraft -- Hoisting common functionality into a base class -- Summary -- Chapter 9: Files and Resource Management -- Files -- Binary and text modes -- The important of encoding -- Opening a file for writing -- Writing to files -- Closing files -- The file outside of Python -- Reading files -- Readline line by line -- Reading multiple lines at once -- Appending to files -- File objects as iterators -- Context Managers -- Managing resources with finally -- The with-blocks -- Moment of zen -- Binary files -- The BMP file format -- Bitwise operators -- Writing a BMP file -- [Generating fractal images] -- Generating fractal images -- Reading binary files -- File-like objects -- You've already seen file-like objects! -- Using file-like objects -- Other resources -- Summary -- Chapter 10: Unit testing with the Python standard library -- Test cases -- Fixtures -- Assertions -- Unit testing example: text analysis -- Running the initial tests -- Making the test pass -- Using fixtures to create temporary files -- Using the new fixtures -- Using assertions to test behavior -- Counting lines -- Counting characters -- Testing for exceptions -- Testing for file existence -- Moment of zen -- Summary -- Chapter 11: Debugging with PDB -- Debugging commands -- Palindrome debugging -- Bug hunting with PDB -- Finding infinite loops with sampling -- Setting explicit breaks -- Stepping through execution -- Fixing the bug -- Summary -- Afterword -- Just the Beginning -- Virtual Environments -- Creating a virtual environment -- Activating a virtual environment -- Deactivating a virtual environment -- Other tools for working with virtual environments -- Packaging and Distribution -- Configuring a package with distutils -- Installing with distutils -- Packaging with distutils. | |
590 | |a Knovel |b Knovel (All titles) | ||
650 | 0 | |a Python (Computer program language) | |
655 | 7 | |a elektronické knihy |7 fd186907 |2 czenas | |
655 | 9 | |a electronic books |2 eczenas | |
700 | 1 | |a Bingham, Austin, |e author. | |
856 | 4 | 0 | |u https://proxy.k.utb.cz/login?url=https://app.knovel.com/hotlink/toc/id:kpPA000033/python-apprentice?kpromoter=marc |y Full text |