Learning Python

Learn to code like a professional with Python – an open source, versatile, and powerful programming language

Learning Python

Learning
Fabrizio Romano

Learn to code like a professional with Python – an open source, versatile, and powerful programming language
$39.99
$49.99
RRP $39.99
RRP $49.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

+ Collection
Free Sample

Book Details

ISBN 139781783551712
Paperback442 pages

Book Description

Learning Python has a dynamic and varied nature. It reads easily and lays 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 very different topics, like GUIs, web apps and data science. The book takes you all the way to creating a fully fledged application.

The book begins by exploring the essentials of programming, data structures and teaches you how to manipulate them. It then moves on to controlling the flow of a program and writing reusable and error proof code. You will then explore different programming paradigms that will allow you to find the best approach to any situation, and also learn how to perform performance optimization as well as effective debugging. Throughout, the book steers you through the various types of applications, and it concludes with a complete mini website built upon all the concepts that you learned.

Table of Contents

Chapter 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
Chapter 2: Built-in Data Types
Everything is an object
Mutable or immutable? That is the question
Numbers
Immutable sequences
Mutable sequences
Set types
Mapping types – dictionaries
The collections module
Final considerations
Summary
Chapter 3: Iterating and Making Decisions
Conditional programming
Looping
Putting this all together
A quick peek at the itertools module
Summary
Chapter 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
Chapter 5: Saving Time and Memory
map, zip, and filter
Comprehensions
Generators
Some performance considerations
Don't overdo comprehensions and generators
Name localization
Generation behavior in built-ins
One last example
Summary
Chapter 6: Advanced Concepts – OOP, Decorators, and Iterators
Decorators
Object-oriented programming
Writing a custom iterator
Summary
Chapter 7: Testing, Profiling, and Dealing with Exceptions
Testing your application
Test-driven development
Exceptions
Profiling Python
Summary
Chapter 8: The Edges – GUIs and Scripts
First approach – scripting
Second approach – a GUI application
Where do we go from here?
Summary
Chapter 9: Data Science
IPython and Jupyter notebook
Dealing with data
Where do we go from here?
Summary
Chapter 10: Web Development Done Right
What is the Web?
How does the Web work?
The Django web framework
A regex website
The future of web development
Summary
Chapter 11: Debugging and Troubleshooting
Debugging techniques
Troubleshooting guidelines
Summary
Chapter 12: Summing Up – A Complete Example
The challenge
Our implementation
Implementing the Django interface
Implementing the Falcon API
Where do you go from here?
Summary
A word of farewell

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.
  • Write elegant, reusable, and efficient code in any situation
  • Understand when to use the functional or the object oriented programming approach
  • Create bulletproof, reliable software by writing tests to support your code
  • Explore examples of GUIs, scripting, data science and web applications
  • Learn to be independent, capable of fetching any resource you need, as well as dig deeper

Authors

Table of Contents

Chapter 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
Chapter 2: Built-in Data Types
Everything is an object
Mutable or immutable? That is the question
Numbers
Immutable sequences
Mutable sequences
Set types
Mapping types – dictionaries
The collections module
Final considerations
Summary
Chapter 3: Iterating and Making Decisions
Conditional programming
Looping
Putting this all together
A quick peek at the itertools module
Summary
Chapter 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
Chapter 5: Saving Time and Memory
map, zip, and filter
Comprehensions
Generators
Some performance considerations
Don't overdo comprehensions and generators
Name localization
Generation behavior in built-ins
One last example
Summary
Chapter 6: Advanced Concepts – OOP, Decorators, and Iterators
Decorators
Object-oriented programming
Writing a custom iterator
Summary
Chapter 7: Testing, Profiling, and Dealing with Exceptions
Testing your application
Test-driven development
Exceptions
Profiling Python
Summary
Chapter 8: The Edges – GUIs and Scripts
First approach – scripting
Second approach – a GUI application
Where do we go from here?
Summary
Chapter 9: Data Science
IPython and Jupyter notebook
Dealing with data
Where do we go from here?
Summary
Chapter 10: Web Development Done Right
What is the Web?
How does the Web work?
The Django web framework
A regex website
The future of web development
Summary
Chapter 11: Debugging and Troubleshooting
Debugging techniques
Troubleshooting guidelines
Summary
Chapter 12: Summing Up – A Complete Example
The challenge
Our implementation
Implementing the Django interface
Implementing the Falcon API
Where do you go from here?
Summary
A word of farewell

Book Details

ISBN 139781783551712
Paperback442 pages
Read More