Beginning Programming with Python for Dummies

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Learn Python--the fun and easy way--and get in the programming game today! Python is one of the fastest growing programming languages, and no wonder. It requires three to five times less time than developing in Java, is a great building block for learning both procedural and object-oriented programming concepts, and is an ideal language for data analysis. Beginning Programming with Python For Dummies is the perfect guide to this dynamic and powerful programming language--even if you've never coded before! Author John Paul Mueller draws on his vast programming knowledge and experience to guide you step-by-step through the syntax and logic of programming with Python and provides several real-world programming examples to give you hands-on experience trying out what you've learned. Provides a solid understanding of basic computer programming concepts and helps familiarize you with syntax and logic Explains the fundamentals of procedural and object-oriented programming Shows how Python is being used for data analysis and other applications Includes short, practical programming samples to apply your skills to real-world programming scenarios Whether you've never written a line of code or are just trying to pick up Python, there's nothing to fear with the fun and friendly Beginning Programming with Python For Dummies leading the way.

Author(s): John Paul Mueller
Publisher: For Dummies
Year: 2014

Language: English
Pages: 408

Title Page
Copyright Page
Contents at a Glance
Table of Contents
Introduction
About This Book
Foolish Assumptions
Icons Used in This Book
Beyond the Book
Where to Go from Here
Part I: Getting Started with Python
Chapter 1: Talking to Your Computer
Understanding Why You Want to Talk to Your Computer
Knowing that an Application is a Form of Communication
Thinking about procedures you use daily
Writing procedures down
Seeing applications as being like any other procedure
Understanding that computers take things literally
Defining What an Application Is
Understanding that computers use a special language
Helping humans speak to the computer
Understanding Why Python is So Cool
Unearthing the reasons for using Python
Deciding how you can personally benefit from Python
Discovering which organizations use Python
Finding useful Python applications
Comparing Python to other languages
Chapter 2: Getting Your Own Copy of Python
Downloading the Version You Need
Installing Python
Working with Windows
Working with the Mac
Working with Linux
Accessing Python on Your Machine
Using Windows
Using the Mac
Using Linux
Testing Your Installation
Chapter 3: Interacting with Python
Opening the Command Line
Starting Python
Using the command line to your advantage
Using Python environment variables to your advantage
Typing a Command
Telling the computer what to do
Telling the computer you’re done
Seeing the result
Using Help
Getting into help mode
Asking for help
Leaving help mode
Obtaining help directly
Closing the Command Line
Chapter 4: Writing Your First Application
Understanding the Integrated DeveLopment Environment (IDLE)
Starting IDLE
Using standard commands
Understanding color coding
Getting GUI help
Configuring IDLE
Creating the Application
Opening a new window
Typing the command
Saving the file
Running the Application
Understanding the Use of Indentation
Adding Comments
Understanding comments
Using comments to leave yourself reminders
Using comments to keep code from executing
Loading and Running Existing Applications
Using the command line or terminal window
Using the Edit window
Using the Python Shell window or Python command line
Closing IDLE
Part II: Talking the Talk
Chapter 5: Storing and Modifying Information
Storing Information
Seeing variables as storage boxes
Using the right box to store the data
Defining the Essential Python Data Types
Putting information into variables
Understanding the numeric types
Understanding Boolean values
Understanding strings
Working with Dates and Times
Chapter 6: Managing Information
Controlling How Python Views Data
Making comparisons
Understanding how computers make comparisons
Working with Operators
Defining the operators
Understanding operator precedence
Creating and Using Functions
Viewing functions as code packages
Understanding code reusability
Defining a function
Accessing functions
Sending information to functions
Returning information from functions
Comparing function output
Getting User Input
Chapter 7: Making Decisions
Making Simple Decisions Using the if Statement
Understanding the if statement
Using the if statement in an application
Choosing Alternatives Using the if
Understanding the if
Using the if
Using the if
Using Nested Decision Statements
Using multiple if or if
Combining other types of decisions
Chapter 8: Performing Repetitive Tasks
Processing Data Using the for Statement
Understanding the for statement
Creating a basic for loop
Controlling execution with the break statement
Controlling execution with the continue statement
Controlling execution with the pass clause
Controlling execution with the else statement
Processing Data Using the while Statement
Understanding the while statement
Using the while statement in an application
Nesting Loop Statements
Chapter 9: Dealing with Errors
Knowing Why Python Doesn’t Understand You
Considering the Sources of Errors
Classifying when errors occur
Distinguishing error types
Catching Exceptions
Basic exception handling
Handling more specific to less specific exceptions
Nested exception handling
Raising Exceptions
Raising exceptions during exceptional conditions
Passing error information to the caller
Creating and Using Custom Exceptions
Using the finally Clause
Part III: Performing Common Tasks
Chapter 10: Interacting with Modules
Creating Code Groupings
Importing Modules
Using the import statement
Using the from
Finding Modules on Disk
Viewing the Module Content
Using the Python Module Documentation
Opening the pydoc application
Using the quick-access links
Typing a search term
Viewing the results
Chapter 11: Working with Strings
Understanding That Strings Are Different
Defining a character using numbers
Using characters to create strings
Creating Stings with Special Characters
Selecting Individual Characters
Slicing and Dicing Strings
Locating a Value in a String
Formatting Strings
Chapter 12: Managing Lists
Organizing Information in an Application
Defining organization using lists
Understanding how computers view lists
Creating Lists
Accessing Lists
Looping Through Lists
Modifying Lists
Searching Lists
Sorting Lists
Working with the Counter Object
Chapter 13: Collecting All Sorts of Data
Understanding Collections
Working with Tuples
Working with Dictionaries
Creating and using a dictionary
Replacing the switch statement with a dictionary
Creating Stacks Using Lists
Working with queues
Working with deques
Chapter 14: Creating and Using Classes
Understanding the Class as a Packaging Method
Considering the Parts of a Class
Creating the class definition
Considering the built-in class attributes
Working with methods
Working with constructors
Working with variables
Using methods with variable argument lists
Overloading operators
Creating a Class
Using the Class in an Application
Extending Classes to Make New Classes
Building the child class
Testing the class in an application
Part IV: Performing Advanced Tasks
Chapter 15: Storing Data in Files
Understanding How Permanent Storage Works
Creating Content for Permanent Storage
Creating a File
Reading File Content
Updating File Content
Deleting a File
Chapter 16: Sending an E-Mail
Understanding What Happens When You Send E-Mail
Viewing e-mail as you do a letter
Defining the parts of the envelope
Defining the parts of the letter
Creating the E-mail Message
Working with a text message
Working with an HTML message
Seeing the E-mail Output
Part V: The Part of Tens
Chapter 17: Ten Amazing Programming Resources
Working with the Python Documentation Online
Using the LearnPython.org Tutorial
Performing Web Programming Using Python
Getting Additional Libraries
Creating Applications Faster Using an IDE
Checking Your Syntax with Greater Ease
Using XML to Your Advantage
Getting Past the Common Python Newbie Errors
Understanding Unicode
Making Your Python Application Fast
Chapter 18: Ten Ways to Make a Living with Python
Working in QA
Becoming the IT Staff for a Smaller Organization
Performing Specialty Scripting for Applications
Administering a Network
Teaching Programming Skills
Helping People Decide on Location
Performing Data Mining
Interacting with Embedded Systems
Carrying Out Scientific Tasks
Performing Real-Time Analysis of Data
Chapter 19: Ten Interesting Tools
Tracking Bugs with Roundup Issue Tracker
Creating a Virtual Environment Using VirtualEnv
Installing Your Application Using PyInstaller
Building Developer Documentation Using pdoc
Developing Application Code Using Komodo Edit
Debugging Your Application Using pydbgr
Entering an Interactive Environment using IPython
Testing Python Applications using PyUnit
Tidying Your Code Using Isort
Providing Version Control Using Mercurial
Chapter 20: Ten Libraries You Need to Know About
Developing a Secure Environment Using PyCrypto
Interacting with Databases Using SQLAlchemy
Seeing the World Using Google Maps
Adding a Graphical User Interface Using TkInter
Providing a Nice Tabular Data Presentation Using PrettyTable
Enhancing Your Application with Sound Using PyAudio
Manipulating Images using PyQtGraph
Locating Your Information Using IRLib
Creating an Interoperable Java Environment Using JPype
Accessing Local Network Resources Using Twisted Matrix
Accessing Internet Resources Using Libraries
Index
About the Author