Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Python 3 Object-Oriented Programming - Second Edition
Python 3 Object-Oriented Programming - Second Edition

Python 3 Object-Oriented Programming - Second Edition: Building robust and maintainable software with object oriented design patterns in Python

Arrow left icon
Profile Icon Dusty Phillips
Arrow right icon
Free Trial
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.9 (36 Ratings)
Paperback Aug 2015 460 pages 1st Edition
eBook
Mex$902.99
Paperback
Mex$1128.99
Subscription
Free Trial
Arrow left icon
Profile Icon Dusty Phillips
Arrow right icon
Free Trial
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.9 (36 Ratings)
Paperback Aug 2015 460 pages 1st Edition
eBook
Mex$902.99
Paperback
Mex$1128.99
Subscription
Free Trial
eBook
Mex$902.99
Paperback
Mex$1128.99
Subscription
Free Trial

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Python 3 Object-Oriented Programming - Second Edition

Chapter 2. Objects in Python

So, we now have a design in hand and are ready to turn that design into a working program! Of course, it doesn't usually happen this way. We'll be seeing examples and hints for good software design throughout the book, but our focus is object-oriented programming. So, let's have a look at the Python syntax that allows us to create object-oriented software.

After completing this chapter, we will understand:

  • How to create classes and instantiate objects in Python

  • How to add attributes and behaviors to Python objects

  • How to organize classes into packages and modules

  • How to suggest people don't clobber our data

Creating Python classes


We don't have to write much Python code to realize that Python is a very "clean" language. When we want to do something, we just do it, without having to go through a lot of setup. The ubiquitous "hello world" in Python, as you've likely seen, is only one line.

Similarly, the simplest class in Python 3 looks like this:

class MyFirstClass:
    pass

There's our first object-oriented program! The class definition starts with the class keyword. This is followed by a name (of our choice) identifying the class, and is terminated with a colon.

Note

The class name must follow standard Python variable naming rules (it must start with a letter or underscore, and can only be comprised of letters, underscores, or numbers). In addition, the Python style guide (search the web for "PEP 8") recommends that classes should be named using CamelCase notation (start with a capital letter; any subsequent words should also start with a capital).

The class definition line is followed by the class...

Modules and packages


Now, we know how to create classes and instantiate objects, but how do we organize them? For small programs, we can just put all our classes into one file and add a little script at the end of the file to start them interacting. However, as our projects grow, it can become difficult to find the one class that needs to be edited among the many classes we've defined. This is where modules come in. Modules are simply Python files, nothing more. The single file in our small program is a module. Two Python files are two modules. If we have two files in the same folder, we can load a class from one module for use in the other module.

For example, if we are building an e-commerce system, we will likely be storing a lot of data in a database. We can put all the classes and functions related to database access into a separate file (we'll call it something sensible: database.py). Then, our other modules (for example, customer models, product information, and inventory) can import...

Organizing module contents


Inside any one module, we can specify variables, classes, or functions. They can be a handy way to store the global state without namespace conflicts. For example, we have been importing the Database class into various modules and then instantiating it, but it might make more sense to have only one database object globally available from the database module. The database module might look like this:

class Database:
    # the database implementation
    pass

database = Database()

Then we can use any of the import methods we've discussed to access the database object, for example:

from ecommerce.database import database

A problem with the preceding class is that the database object is created immediately when the module is first imported, which is usually when the program starts up. This isn't always ideal since connecting to a database can take a while, slowing down startup, or the database connection information may not yet be available. We could delay creating the...

Who can access my data?


Most object-oriented programming languages have a concept of access control. This is related to abstraction. Some attributes and methods on an object are marked private, meaning only that object can access them. Others are marked protected, meaning only that class and any subclasses have access. The rest are public, meaning any other object is allowed to access them.

Python doesn't do this. Python doesn't really believe in enforcing laws that might someday get in your way. Instead, it provides unenforced guidelines and best practices. Technically, all methods and attributes on a class are publicly available. If we want to suggest that a method should not be used publicly, we can put a note in docstrings indicating that the method is meant for internal use only (preferably, with an explanation of how the public-facing API works!).

By convention, we should also prefix an attribute or method with an underscore character, _. Python programmers will interpret this as "this...

Third-party libraries


Python ships with a lovely standard library, which is a collection of packages and modules that are available on every machine that runs Python. However, you'll soon find that it doesn't contain everything you need. When this happens, you have two options:

  • Write a supporting package yourself

  • Use somebody else's code

We won't be covering the details about turning your packages into libraries, but if you have a problem you need to solve and you don't feel like coding it (the best programmers are extremely lazy and prefer to reuse existing, proven code, rather than write their own), you can probably find the library you want on the Python Package Index (PyPI) at http://pypi.python.org/. Once you've identified a package that you want to install, you can use a tool called pip to install it. However, pip does not come with Python, but Python 3.4 contains a useful tool called ensurepip, which will install it:

python -m ensurepip

This may fail for you on Linux, Mac OS, or other...

Case study


To tie it all together, let's build a simple command-line notebook application. This is a fairly simple task, so we won't be experimenting with multiple packages. We will, however, see common usage of classes, functions, methods, and docstrings.

Let's start with a quick analysis: notes are short memos stored in a notebook. Each note should record the day it was written and can have tags added for easy querying. It should be possible to modify notes. We also need to be able to search for notes. All of these things should be done from the command line.

The obvious object is the Note object; less obvious one is a Notebook container object. Tags and dates also seem to be objects, but we can use dates from Python's standard library and a comma-separated string for tags. To avoid complexity, in the prototype, let's not define separate classes for these objects.

Note objects have attributes for memo itself, tags, and creation_date. Each note will also need a unique integer id so that users...

Exercises


Write some object-oriented code. The goal is to use the principles and syntax you learned in this chapter to ensure you can use it, instead of just reading about it. If you've been working on a Python project, go back over it and see if there are some objects you can create and add properties or methods to. If it's large, try dividing it into a few modules or even packages and play with the syntax.

If you don't have such a project, try starting a new one. It doesn't have to be something you intend to finish, just stub out some basic design parts. You don't need to fully implement everything, often just a print("this method will do something") is all you need to get the overall design in place. This is called top-down design, in which you work out the different interactions and describe how they should work before actually implementing what they do. The converse, bottom-up design, implements details first and then ties them all together. Both patterns are useful at different times...

Summary


In this chapter, we learned how simple it is to create classes and assign properties and methods in Python. Unlike many languages, Python differentiates between a constructor and an initializer. It has a relaxed attitude toward access control. There are many different levels of scope, including packages, modules, classes, and functions. We understood the difference between relative and absolute imports, and how to manage third-party packages that don't come with Python.

In the next chapter, we'll learn how to share implementation using inheritance.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Stop writing scripts and start architecting programs
  • Learn the latest Python syntax and libraries
  • A practical, hands-on tutorial that teaches you all about abstract design patterns and how to implement them in Python 3

Description

Python 3 is more versatile and easier to use than ever. It runs on all major platforms in a huge array of use cases. Coding in Python minimizes development time and increases productivity in comparison to other languages. Clean, maintainable code is easy to both read and write using Python's clear, concise syntax. Object-oriented programming is a popular design paradigm in which data and behaviors are encapsulated in such a way that they can be manipulated together. Many modern programming languages utilize the powerful concepts behind object-oriented programming and Python is no exception. Starting with a detailed analysis of object-oriented analysis and design, you will use the Python programming language to clearly grasp key concepts from the object-oriented paradigm. This book fully explains classes, data encapsulation, inheritance, polymorphism, abstraction, and exceptions with an emphasis on when you can use each principle to develop well-designed software. You'll get an in-depth analysis of many common object-oriented design patterns that are more suitable to Python's unique style. This book will not just teach Python syntax, but will also build your confidence in how to program. You will also learn how to create maintainable applications by studying higher level design patterns. Following this, you'll learn the complexities of string and file manipulation, and how Python distinguishes between binary and textual data. Not one, but two very powerful automated testing systems will be introduced in the book. After you discover the joy of unit testing and just how easy it can be, you'll study higher level libraries such as database connectors and GUI toolkits and learn how they uniquely apply object-oriented principles. You'll learn how these principles will allow you to make greater use of key members of the Python eco-system such as Django and Kivy. This new edition includes all the topics that made Python 3 Object-oriented Programming an instant Packt classic. It's also packed with updated content to reflect recent changes in the core Python library and covers modern third-party packages that were not available on the Python 3 platform when the book was first published.  

Who is this book for?

If you're new to object-oriented programming techniques, or if you have basic Python skills and wish to learn in depth how and when to correctly apply object-oriented programming in Python to design software, this is the book for you.

What you will learn

  • Implement objects in Python by creating classes and defining methods
  • Separate related objects into a taxonomy of classes and describe the properties and behaviors of those objects via the class interface
  • Extend class functionality using inheritance
  • Understand when to use object-oriented features, and more importantly when not to use them
  • Discover what design patterns are and why they are different in Python
  • Uncover the simplicity of unit testing and why it s so important in Python
  • Grasp common concurrency techniques and pitfalls in Python 3
  • Exploit object-oriented programming in key Python technologies such as Kivy and Django.
  • Object-oriented programming concurrently with asyncio

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 20, 2015
Length: 460 pages
Edition : 1st
Language : English
ISBN-13 : 9781784398781
Category :
Languages :

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Aug 20, 2015
Length: 460 pages
Edition : 1st
Language : English
ISBN-13 : 9781784398781
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$12.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 6,500+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$129.99 billed annually
Feature tick icon Unlimited access to Packt's library of 6,500+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts
$179.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 6,500+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Mex$ 3,262.97
Functional Python Programming
Mex$1128.99
Mastering Python Design Patterns
Mex$1004.99
Python 3 Object-Oriented Programming - Second Edition
Mex$1128.99
Total Mex$ 3,262.97 Stars icon
Visually different images

Table of Contents

13 Chapters
Object-oriented Design Chevron down icon Chevron up icon
Objects in Python Chevron down icon Chevron up icon
When Objects Are Alike Chevron down icon Chevron up icon
Expecting the Unexpected Chevron down icon Chevron up icon
When to Use Object-oriented Programming Chevron down icon Chevron up icon
Python Data Structures Chevron down icon Chevron up icon
Python Object-oriented Shortcuts Chevron down icon Chevron up icon
Strings and Serialization Chevron down icon Chevron up icon
The Iterator Pattern Chevron down icon Chevron up icon
Python Design Patterns I Chevron down icon Chevron up icon
Python Design Patterns II Chevron down icon Chevron up icon
Testing Object-oriented Programs Chevron down icon Chevron up icon
Concurrency Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.9
(36 Ratings)
5 star 47.2%
4 star 22.2%
3 star 13.9%
2 star 5.6%
1 star 11.1%
Filter icon Filter
Top Reviews

Filter reviews by




Santhosh Apr 26, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good book for Object oriented python
Amazon Verified review Amazon
adnan baloch Sep 29, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The title page of the book greets the reader with a photo of idyllic scenery with a mountain in the background. This is not just a photo. This is the place where the readers will find themselves in their minds' eyes once they are done with the book. The book's source code consists of over 200 python source files that are guaranteed to delight beginners and intermediate Python users alike. Happily, the files can be downloaded from the publisher's website for free so go ahead and witness that treasure trove for yourself. The paperback edition of this book is a must have for anyone interested in getting to grips with the object oriented features of Python 3. This second edition has the good fortune of incorporating several years of reader feedback that combines with the author's mature and seasoned grasp of the subject matter to deliver content that is highly relevant to the practical application of Python's power in solving real world computing problems. Data structures, design patterns and unit testing chapters will help the readers stand out for any serious Python development positions. New to this edition is an entire chapter devoted to concurrency that serves as pure icing on the cake especially when you factor in the fact that the world has increasingly shifted to a many-core computing era. Don't be surprised if this voluminous 460 page book turns you into an excellent Python teacher.
Amazon Verified review Amazon
Weston Buckhorn Oct 13, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is laser focused on learning OOP for people who have some programming experience but are stuck in the world of procedural programming. This is perfect for old farts who are addicted to crack-languages like the Basic family of languages. I have included a list of the code you can download below because I want people to buy this book.Ch03\3_01_inheriting_from_object.pyCh03\3_02_simple_contact_class_to_inherit_from.pyCh03\3_03_contact_inherit_supplier.pyCh03\3_04_contact_list_inheritance.pyCh03\3_05_dictionary_long_name.pyCh03\3_06_friend_overrides_init.pyCh03\3_07_friend_overrides_init_super.pyCh03\3_08_send_mail.pyCh03\3_09_send_mail_multi.pyCh03\3_10_friend_address_holder.pyCh03\3_11_friend_multi.pyCh03\3_12_contrived_diamond.pyCh03\3_14_contrived_diamond_super.pyCh03\3_15_friend_multi_super.pyCh03\3_16_polymorphic_audio.pyCh03\3_17.1_abc_container.pyCh03\3_17.2_abc_media.pyCh03\3_17_ducktype_flac.pyCh03\3_18_property.pyCh03\3_19_apartment_ugly_prompt.pyCh03\3_20_validation_function.pyCh03\3_21_apartment_nice_prompt.pyCh03\3_22_house.pyCh03\3_23_purchase_and_rental.pyCh03\3_24_house_rental.pyCh03\3_25_remaining_subclasses.pyCh03\3_26_rudimentary_agent.pyCh03\3_27_type_map.pyCh03\3_28_add_property.pyCh03\final_case_study.pyCh04\04_03_method_calls_excepting.pyCh04\4_01_even_integers.pyCh04\4_02_exception_quits.pyCh04\4_04_try_except.pyCh04\4_05_catch_specific_exception.pyCh04\4_06_catch_multiple_exceptions.pyCh04\4_07_catch_multiple_different.pyCh04\4_08_catch_as_keyword.pyCh04\4_09_finally_and_else.pyCh04\4_10_defining_an_exception.pyCh04\4_11_exception_with_custom_args.pyCh04\4_12_handle_custom_exception.pyCh04\4_13_branching_vs_exceptions.pyCh04\4_14_inventory_mock_object.pyCh04\4_15_inventory_handling.pyCh04\4_16_auth_user.pyCh04\4_17_authenticator.pyCh04\4_18_login.pyCh04\4_19_authorizor.pyCh04\4_20_test_auth.pyCh04\__pycache__\auth.cpython-34.pycCh04\auth.pyCh04\auth.pycCh05\5_01_distances_no_objects.pyCh05\5_02_distances_by_object.pyCh05\5_03_object_polygon_init.pyCh05\5_04_pytho_ugly_as_java.pyCh05\5_05_python_pretty_as_python.pyCh05\5_06_setting_name_in_method.pyCh05\5_07_setting_name_property.pyCh05\5_08_property_arguments.pyCh05\5_09_property_decorator_get.pyCh05\5_11_property_decorator_arguments.pyCh05\5_12_property_decorator_get_set.pyCh05\5_13_read_only_setattr.pyCh05\5_14_read_only_getattribute.pyCh05\5_15_cache_getter.pyCh05\5_16_average_property.pyCh05\5_17_zipsearch.pyCh05\5_18_zipprocessor.pyCh05\5_19_zipreplace_inheritance.pyCh05\5_20_scaleimage_inheritance.pyCh05\5_24_most_basic_document.pyCh05\5_25_document_cursor.pyCh05\5_26_document_using_cursor.pyCh05\5_27_string_property.pyCh05\5_28_Character_class.pyCh05\5_29_document_with_character.pyCh05\Document.pyCh05\zip_processor.pyCh05\zip_processor.pycCh06\6_01_empty_object.pyCh06\6_02_pass_tuple_to_function.pyCh06\6_03_named_tuple.pyCh06\6_04_dict_stocks.pyCh06\6_05_random_key_dict.pyCh06\6_06_setdefault_frequency.pyCh06\6_07_defaultdict_frequency.pyCh06\6_08_defaultdict_custom_function.pyCh06\6_09_counter_frequency.pyCh06\6_09_counter_poll.pyCh06\6_09_list_tuple_frequency.pyCh06\6_10_object_comparison.pyCh06\6_11_song_artist_set.pyCh06\6_12_set_operations.pyCh06\6_13_set_operations2.pyCh06\6_14_oop_pairs.pyCh06\6_15_stupid_adding_integer.pyCh06\6_16_dictsorted.pyCh06\6_17_link_parser.pyCh06\6_18_normalize_url.pyCh06\6_19_visited_links_sets.pyCh06\6_20_collect_remaining_links.pyCh06\6_21_print_collected_links.pyCh06\6_22_dict_link_collector.pyCh06\6_23_queue_link_collector.pyCh06\link_collector.pyCh07\7_01_reversible_objects.pyCh07\7_02_enumerate_line_numbers.pyCh07\7_03.1_zip_to_enumerate.pyCh07\7_03_enumerate_max_min.pyCh07\7_05_read_file.pyCh07\7_05_tdf_processor.pyCh07\7_06_write.pyCh07\7_07_with.pyCh07\7_08_context_manager.pyCh07\7_18_bad_kw_default.pyCh07\7_19_link_downloader.pyCh07\7_20_link_downloader_vararg.pyCh07\7_21_kwarg_options.pyCh07\7_22_all_arguments.pyCh07\7_23_unpacking_arguments.pyCh07\7_24_function_object.pyCh07\7_25_timer.pyCh07\7_26_timer_test.pyCh07\7_27_add_function_to_object.pyCh07\7_28_callable_repeat.pyCh07\7_29_send_email.pyCh07\7_30_send_email_dict_headers.pyCh07\7_32_mailing_list_defaultdict_set.pyCh07\7_33_mailing_list_get_emails.pyCh07\7_34_send_mailing.pyCh07\7_35_load_save.pyCh07\7_36_enter_exit.pyCh07\__pycache__\timer.cpython-34.pycCh07\mailing_list.pyCh07\timer.pyCh07\timer.pycCh08\8_01_string_creation.pyCh08\8_02_format_empty.pyCh08\8_03_format_position.pyCh08\8_04_format_some_positions_broken.pyCh08\8_05_brace_escape.pyCh08\8_06_format_kw_args.pyCh08\8_07_unlabelled_kw.pyCh08\8_08_tuple_dict_format.pyCh08\8_09_tuple_in_dict_format.pyCh08\8_10_object_formatting.pyCh08\8_11_no_format.pyCh08\8_12_currency_format.pyCh08\8_13_tabular.pyCh08\8_14_format_datetime.pyCh08\8_15_encode_bytes.pyCh08\8_16_decode_unicode.pyCh08\8_17_bytearray_replace.pyCh08\8_18_bytearray_index.pyCh08\8_23.1_basic_regex.pyCh08\8_23.2_regex_generic.pyCh08\8_23.3_match_group.pyCh08\8_23_stringio.pyCh08\8_24_basic_pickling.pyCh08\8_25_state_pickling.pyCh08\8_26_json_objects.pyCh08\8_27_template_boilerplate.pyCh08\8_28_template_process.pyCh08\8_29_template_processer_complete.pyCh09\09_08_list_comp_exclude.pyCh09\9_01_iterator.pyCh09\9_06_for_loop_converter.pyCh09\9_07_list_comp_converter.pyCh09\9_09_tdf_list_comp.pyCh09\9_10_set_comprehension.pyCh09\9_11_dict_comprehension.pyCh09\9_13_log_processor.pyCh09\9_14_log_delete_warning_expression.pyCh09\9_15_log_delete_warnings_loop.pyCh09\9_16_log_delete_warnings_object.pyCh09\9_17_log_delete_warnings_generator.pyCh09\9_18_log_delete_warnings_yield_from.pyCh09\9_19_yield_from_filesystem.pyCh09\9_20_basic_count_coroutine.pyCh09\9_21_kernel_log.pyCh09\9_22_load_dataset.pyCh09\9_23_generate_colors.pyCh09\9_24_color_distance.pyCh09\9_25_knearest.pyCh09\9_26_write_results.pyCh09\case_study_machine_learn.pyCh09\kivy_color_checker\main.pyCh09\kivy_color_classifier\main.pyCh10\10_02_simple_socket.pyCh10\10_03_simple_client.pyCh10\10_04_logging_decorator.pyCh10\10_05_gzip_decorator.pyCh10\10_06_calling_decorated_sockets.pyCh10\10_09_logging_decorator.pyCh10\10_10_decorator_syntax.pyCh10\10_11_observer_core.pyCh10\10_12_observer_observing.pyCh10\10_13_strategy_tile.pyCh10\10_15_xml_states.pyCh10\10_16_singleton_using_new.pyCh10\10_17_xml_singletonstates.pyCh10\10_18_create_database_for_template.pyCh10\10_19_template_abstract_noimple.pyCh10\10_20_template_abstract_implemented.pyCh10\10_21_template_concretes.pyCh11\11_01_age_calculator.pyCh11\11_02_age_calculator_adapted.pyCh11\11_03_age_calculator_adapt_date.pyCh11\11_04_email_facade.pyCh11\11_05_flyweight_factory.pyCh11\11_06_flyweight_init.pyCh11\11_07_flyweight_check_serial.pyCh11\11_08_car_class.pyCh11\11_09_window_commands.pyCh11\11_10_window_command_invokers.pyCh11\11_11_window_command_commands.pyCh11\11_12_window_command_function.pyCh11\11_13_document_command_callable.pyCh11\11_14_formatters.pyCh11\11_15_formatter_factories.pyCh11\11_16_composite_folder_methods.pyCh11\11_17_component_hierarchy.pyCh11\11_18_add_child.pyCh12\12_01_simplest_unittest.pyCh12\12_02_assertraises_python.pyCh12\12_03_stats.pyCh12\12_04_test_stats.pyCh12\12_05_skipping_tests.pyCh12\12_06_simplestpytest.pyCh12\12_06_simplestpytest.pycCh12\12_07_class_pytest.pyCh12\12_07_class_pytest.pycCh12\12_08_setup_teardown.pyCh12\12_08_setup_teardown.pycCh12\12_09_funcargs.pyCh12\12_09_funcargs.pycCh12\12_10_funcarg_finalizer.pyCh12\12_10_funcarg_finalizer.pycCh12\12_11_echo_server.pyCh12\12_12_pytest_echo.pyCh12\12_12_pytest_echo.pycCh12\12_13_pytest_simple_skip.pyCh12\12_13_pytest_simple_skip.pycCh12\12_14_pytest_importorskip.pyCh12\12_14_pytest_importorskip.pycCh12\12_15_pytest_skipifmark.pyCh12\12_15_pytest_skipifmark.pycCh12\12_16_mock_flightstatus.pyCh12\12_17_mock_redis.pyCh12\12_30_coverage_unittest.pyCh12\__pycache__\stats.cpython-34.pycCh12\__pycache__\test_mock.cpython-34-PYTEST.pycCh12\casestudy\__pycache__\test_vigenere_cipher.cpython-34-PYTEST.pycCh12\casestudy\__pycache__\vigenere_cipher.cpython-34.pycCh12\casestudy\test_vigenere_cipher.pyCh12\casestudy\test_vigenere_cipher.pycCh12\casestudy\vigenere_cipher.pyCh12\casestudy\vigenere_cipher.pycCh12\casestudy\vigenere_cipher1.pyCh12\stats.pyCh12\stats.pycCh12\test_mock.pyCh13\13_01_two_basic_threads.pyCh13\13_02_thread_wait.pyCh13\13_03_parallel.pyCh13\13_04_prime_factor.pyCh13\13_05_post_search.pyCh13\13_06_futures.pyCh13\13_07_basic_async.pyCh13\13_08_asyncio_dns.pyCh13\13_09_async_multiprocessing.pyCh13\13_10_async_client.pyCh13\case_study\compress_bmp.pyCh13\case_study\decompress_to_bmp.pyThere are no code files present for Chapters 1 and 2.
Amazon Verified review Amazon
Ecki Dec 13, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Das Buch ist für Leser mit Basiskenntnissen in Python geeignet.
Amazon Verified review Amazon
Amazon Customer Sep 12, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Helped with some small issues, great read
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.

Modal Close icon
Modal Close icon