Automate the boring stuff with Python : practical programming for total beginners
Item Preview
Share or Embed This Item
texts
Automate the boring stuff with Python : practical programming for total beginners
- Publication date
- 2015
- Topics
- Python (Computer program language), Computer programming, COMPUTERS -- Programming Languages -- General
- Publisher
- [San Francisco, CA] : No Starch Press
- Language
- English
1 online resource (1 volume) :
Basic programming skills for total beginners
Print version record
Includes index
Place of publication taken from publisher's Web site
About the Author ; Brief Contents ; Contents in Detail ; Acknowledgments ; Introduction; Whom Is This Book For?; Conventions; What Is Programming?; What Is Python?; Programmers Don't Need to Know Much Math; Programming Is a Creative Activity; About This Book; Downloading and Installing Python; Starting IDLE; The Interactive Shell; How to Find Help; Asking Smart Programming Questions; Summary; Part I: Python Programming Basics; Chapter 1: Python Basics; Entering Expressions into the Interactive Shell; The Integer, Floating-Point, and String Data Types; String Concatenation and Replication
Storing Values in VariablesAssignment Statements; Variable Names; Your First Program; Dissecting Your Program; Comments; The print() Function; The input() Function; Printing the User's Name; The len() Function; The str(), int(), and float() Functions; Summary; Practice Questions; Chapter 2: Flow Control; Boolean Values; Comparison Operators; Boolean Operators; Binary Boolean Operators; The not Operator; Mixing Boolean and Comparison Operators; Elements of Flow Control; Conditions; Blocks of Code; Program Execution; Flow Control Statements; if Statements; else Statements; elif Statements
While Loop Statementsbreak Statements; continue Statements; for Loops and the range() Function; Importing Modules; from import Statements; Ending a Program Early with sys.exit(); Summary; Practice Questions; Chapter 3: Functions; def Statements with Parameters; Return Values and return Statements; The None Value; Keyword Arguments and print(); Local and Global Scope; Local Variables Cannot Be Used in the Global Scope; Local Scopes Cannot Use Variables in Other Local Scopes; Global Variables Can Be Read from a Local Scope; Local and Global Variables with the Same Name; The global Statement
Exception HandlingA Short Program: Guess the Number; Summary; Practice Questions; Practice Projects; The Collatz Sequence; Input Validation; Chapter 4: Lists; The List Data Type; Getting Individual Values in a List with Indexes; Negative Indexes; Getting Sublists with Slices; Getting a List's Length with len(); Changing Values in a List with Indexes; List Concatenation and List Replication; Removing Values from Lists with del Statements; Working with Lists; Using for Loops with Lists; The in and not in Operators; The Multiple Assignment Trick; Augmented Assignment Operators; Methods
Finding a Value in a List with the index() MethodAdding Values to Lists with the append() and insert() Methods; Removing Values from Lists with remove() ; Sorting the Values in a List with the sort() Method; Example Program: Magic 8 Ball with a List; List-like Types: Strings and Tuples; Mutable and Immutable Data Types; The Tuple Data Type; Converting Types with the list() and tuple() Functions; References; Passing References; The copy Module's copy() and deepcopy() Functions; Summary; Practice Questions; Practice Projects; Comma Code; Character Picture Grid
Basic programming skills for total beginners
Print version record
Includes index
Place of publication taken from publisher's Web site
About the Author ; Brief Contents ; Contents in Detail ; Acknowledgments ; Introduction; Whom Is This Book For?; Conventions; What Is Programming?; What Is Python?; Programmers Don't Need to Know Much Math; Programming Is a Creative Activity; About This Book; Downloading and Installing Python; Starting IDLE; The Interactive Shell; How to Find Help; Asking Smart Programming Questions; Summary; Part I: Python Programming Basics; Chapter 1: Python Basics; Entering Expressions into the Interactive Shell; The Integer, Floating-Point, and String Data Types; String Concatenation and Replication
Storing Values in VariablesAssignment Statements; Variable Names; Your First Program; Dissecting Your Program; Comments; The print() Function; The input() Function; Printing the User's Name; The len() Function; The str(), int(), and float() Functions; Summary; Practice Questions; Chapter 2: Flow Control; Boolean Values; Comparison Operators; Boolean Operators; Binary Boolean Operators; The not Operator; Mixing Boolean and Comparison Operators; Elements of Flow Control; Conditions; Blocks of Code; Program Execution; Flow Control Statements; if Statements; else Statements; elif Statements
While Loop Statementsbreak Statements; continue Statements; for Loops and the range() Function; Importing Modules; from import Statements; Ending a Program Early with sys.exit(); Summary; Practice Questions; Chapter 3: Functions; def Statements with Parameters; Return Values and return Statements; The None Value; Keyword Arguments and print(); Local and Global Scope; Local Variables Cannot Be Used in the Global Scope; Local Scopes Cannot Use Variables in Other Local Scopes; Global Variables Can Be Read from a Local Scope; Local and Global Variables with the Same Name; The global Statement
Exception HandlingA Short Program: Guess the Number; Summary; Practice Questions; Practice Projects; The Collatz Sequence; Input Validation; Chapter 4: Lists; The List Data Type; Getting Individual Values in a List with Indexes; Negative Indexes; Getting Sublists with Slices; Getting a List's Length with len(); Changing Values in a List with Indexes; List Concatenation and List Replication; Removing Values from Lists with del Statements; Working with Lists; Using for Loops with Lists; The in and not in Operators; The Multiple Assignment Trick; Augmented Assignment Operators; Methods
Finding a Value in a List with the index() MethodAdding Values to Lists with the append() and insert() Methods; Removing Values from Lists with remove() ; Sorting the Values in a List with the sort() Method; Example Program: Magic 8 Ball with a List; List-like Types: Strings and Tuples; Mutable and Immutable Data Types; The Tuple Data Type; Converting Types with the list() and tuple() Functions; References; Passing References; The copy Module's copy() and deepcopy() Functions; Summary; Practice Questions; Practice Projects; Comma Code; Character Picture Grid
Notes
Page 158: The
findall()
example has an error. It's marked with #Changed in the code below.>>> phoneNumRegex = re.compile(r'(\d\d\d)-(\d\d\d)-(\d\d\d\d)') # has groups
>>> phoneNumRegex.findall('Cell: 415-555-9999 Work: 212-555-0000')
[('415', '555', '9999'), ('212', '555', '0000')] #Changed
The paragraph below should also be updated:
2. When called on a regex that has groups, such as
(\d\d\d)-(\d\d\d)-(\d\d\d\d)
, the method findall()
returns a list of tuples of strings (one string for each group), such as [('415', '555', '9999'), ('212', '555', '0000')].
Page 212: The backupToZip.py program has an error. It's marked with #Changed in the code below.
# Add all the files in this folder to the ZIP file.
for filename in filenames:
newBase = os.path.basename(folder) + '_' #Changed
if filename.startswith(newBase) and filename.endswith('.zip')
continue # don't backup the backup ZIP files
backupZip.write(os.path.join(foldername, filename))
backupZip.close()
print('Done.')
backupToZip('C:\\delicious')
- Addeddate
- 2018-12-31 15:19:41
- External-identifier
-
urn:asin:1593275994
- Foldoutcount
- 0
- Identifier
- automatetheboringstuffwithpython_new
- Identifier-ark
- ark:/13960/t0gv31z8q
- Isbn
- 9781593275990
1593275994
9781593276850
1593276850
- Ocr
- ABBYY FineReader 11.0 (Extended OCR)
- Ocr_converted
- abbyy-to-hocr 1.1.11
- Ocr_module_version
- 0.0.14
- Openlibrary_edition
- OL25763874M
- Openlibrary_work
- OL17192141W
- Page_number_confidence
- 95.04
- Pages
- 505
- Ppi
- 300
- Scanner
- Internet Archive HTML5 Uploader 1.6.3
- Worldcat (source edition)
- 909425995
- Year
- 2015
- Full catalog record
- MARCXML
comment
Reviews
There are no reviews yet. Be the first one to
write a review.
7,135 Views
91 Favorites
DOWNLOAD OPTIONS
IN COLLECTIONS
Folkscanomy Computer: Inbox and MiscellaneousUploaded by The_Professor on