Book description
Learn core concepts of Python and unleash its power to script highest quality Python programs
About This Book
- Develop a strong set of programming skills with Pyhton that you will be able to express in any situation, on every platform, thanks to Python's portability
- Stop writing scripts and start architecting programs by applying object-oriented programming techniques in Python
- Learn the trickier aspects of Python and put it in a structured context for deeper understanding of the language
Who This Book Is For
This course is meant for programmers who wants to learn Python programming from a basic to an expert level. The course is mostly self-contained and introduces Python programming to a new reader and can help him become an expert in this trade.
What You Will Learn
- Get Python up and running on Windows, Mac, and Linux in no time
- Grasp the fundamental concepts of coding, along with the basics of data structures and control flow
- Understand when to use the functional or the object-oriented programming approach
- Extend class functionality using inheritance
- Exploit object-oriented programming in key Python technologies, such as Kivy and Django
- Understand how and when to use the functional programming paradigm
- Use the multiprocessing library, not just locally but also across multiple machines
In Detail
Python is a dynamic and powerful programming language, having its application in a wide range of domains. It has an easy-to-use, simple syntax, and a powerful library, which includes hundreds of modules to provide routines for a wide range of applications, thus making it a popular language among programing enthusiasts.This course will take you on a journey from basic programming practices to high-end tools and techniques giving you an edge over your peers. It follows an interesting learning path, divided into three modules. As you complete each one, you'll have gained key skills and get ready for the material in the next module.The first module will begin with exploring all the essentials of Python programming in an easy-to-understand way. This will lay a good foundation for those who are interested in digging deeper. It has a practical and example-oriented approach through which both the introductory and the advanced topics are explained.
Starting with the fundamentals of programming and Python, it ends by exploring topics, like GUIs, web apps, and data science.In the second module you will learn about object oriented programming techniques in Python. Starting with a detailed analysis of object-oriented technique and design, you will use the Python programming language to clearly grasp key concepts from the object-oriented paradigm. This module 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.With a good foundation of Python you will move onto the third module which is a comprehensive tutorial covering advanced features of the Python language.
Start by creating a project-specific environment using venv. This will introduce you to various Pythonic syntax and common pitfalls before moving onto functional features and advanced concepts, thereby gaining an expert level knowledge in programming and teaching how to script highest quality Python programs.
Style and approach
This course follows a theory-cum-practical approach having all the ingredients that will help you jump into the field of Python programming as a novice and grow-up as an expert. The aim is to create a smooth learning path that will teach you how to get started with Python and carry out expert-level programming techniques at the end of course.
Table of contents
-
Python: Journey from Novice to Expert
- Table of Contents
- Python: Journey from Novice to Expert
- Python: Journey from Novice to Expert
- Credits
- Preface
-
1. Module 1
-
1. Introduction and First Steps – Take a Deep Breath
- A proper introduction
- Enter the Python
- About Python
- What are the drawbacks?
- Who is using Python today?
- Setting up the environment
- Installing Python
- How you can run a Python program
- How is Python code organized
- Python's execution model
- Guidelines on how to write good code
- The Python culture
- A note on the IDEs
- Summary
- 2. Built-in Data Types
- 3. Iterating and Making Decisions
-
4. Functions, the Building Blocks of Code
- Why use functions?
- Scopes and name resolution
- Input parameters
- Return values
- A few useful tips
- Recursive functions
- Anonymous functions
- Function attributes
- Built-in functions
- One final example
- Documenting your code
- Importing objects
- Summary
- 5. Saving Time and Memory
-
6. Advanced Concepts – OOP, Decorators, and Iterators
- Decorators
-
Object-oriented programming
- The simplest Python class
- Class and object namespaces
- Attribute shadowing
- I, me, and myself – using the self variable
- Initializing an instance
- OOP is about code reuse
- Accessing a base class
- Multiple inheritance
- Static and class methods
- Private methods and name mangling
- The property decorator
- Operator overloading
- Polymorphism – a brief overview
- Writing a custom iterator
- Summary
- 7. Testing, Profiling, and Dealing with Exceptions
- 8. The Edges – GUIs and Scripts
- 9. Data Science
- 10. Web Development Done Right
- 11. Debugging and Troubleshooting
- 12. Summing Up – A Complete Example
-
1. Introduction and First Steps – Take a Deep Breath
-
2. Module 2
- 1. Object-oriented Design
- 2. Objects in Python
- 3. When Objects Are Alike
- 4. Expecting the Unexpected
- 5. When to Use Object-oriented Programming
- 6. Python Data Structures
- 7. Python Object-oriented Shortcuts
- 8. Strings and Serialization
- 9. The Iterator Pattern
- 10. Python Design Patterns I
- 11. Python Design Patterns II
- 12. Testing Object-oriented Programs
- 13. Concurrency
-
3. Module 3
- 1. Getting Started – One Environment per Project
-
2. Pythonic Syntax, Common Pitfalls, and Style Guide
-
Code style – or what is Pythonic code?
- Formatting strings – printf-style or str.format?
-
PEP20, the Zen of Python
- Beautiful is better than ugly
- Explicit is better than implicit
- Simple is better than complex
- Flat is better than nested
- Sparse is better than dense
- Readability counts
- Practicality beats purity
- Errors should never pass silently
- In the face of ambiguity, refuse the temptation to guess
- One obvious way to do it
- Now is better than never
- Hard to explain, easy to explain
- Namespaces are one honking great idea
- Conclusion
- Explaining PEP8
- Verifying code quality, pep8, pyflakes, and more
- Common pitfalls
- Summary
-
Code style – or what is Pythonic code?
-
3. Containers and Collections – Storing Data the Right Way
- Time complexity – the big O notation
- Core collections
-
Advanced collections
- ChainMap – the list of dictionaries
- counter – keeping track of the most occurring elements
- deque – the double ended queue
- defaultdict – dictionary with a default value
- namedtuple – tuples with field names
- enum – a group of constants
- OrderedDict – a dictionary where the insertion order matters
- heapq – the ordered list
- bisect – the sorted list
- Summary
-
4. Functional Programming – Readability Versus Brevity
- Functional programming
- list comprehensions
- dict comprehensions
- set comprehensions
- lambda functions
- functools
-
itertools
- accumulate – reduce with intermediate results
- chain – combining multiple results
- combinations – combinatorics in Python
- permutations – combinations where the order matters
- compress – selecting items using a list of Booleans
- dropwhile/takewhile – selecting items using a function
- count – infinite range with decimal steps
- groupby – grouping your sorted iterable
- islice – slicing any iterable
- Summary
- 5. Decorators – Enabling Code Reuse by Decorating
- 6. Generators and Coroutines – Infinity, One Step at a Time
- 7. Async IO – Multithreading without Threads
- 8. Metaclasses – Making Classes (Not Instances) Smarter
- 9. Documentation – How to Use Sphinx and reStructuredText
- 10. Testing and Logging – Preparing for Bugs
- 11. Debugging – Solving the Bugs
- 12. Performance – Tracking and Reducing Your Memory and CPU Usage
- 13. Multiprocessing – When a Single CPU Core Is Not Enough
- 14. Extensions in C/C++, System Calls, and C/C++ Libraries
- 15. Packaging – Creating Your Own Libraries or Applications
- A. Bibliography
- Index
Product information
- Title: Python: Journey from Novice to Expert
- Author(s):
- Release date: August 2016
- Publisher(s): Packt Publishing
- ISBN: 9781787120761
You might also like
book
Getting Started with Python
Harness the power of Python objects and data structures to implement algorithms for analyzing your data …
book
Data Wrangling with Python
How do you take your data analysis skills beyond Excel to the next level? By learning …
book
Python: Real-World Data Science
Unleash the power of Python and its robust data science capabilities About This Book Unleash the …
book
Python One-Liners
Python One-Liners will teach you how to read and write “one-liners”: concise statements of useful functionality …