A Site on Downloding Any Book's For Free (Educational)

Search

Wednesday, November 18, 2020

Python Book: Beginning Python, Advanced Python, and Python

 

Python Book: Beginning Python, Advanced Python, and Python


278 Pages · 2013 · 1.3 MB · 131,479 Downloads· English







This document is a self learning document for a course in Python programming. This course contains (1) a part for beginners, (2) a discussion of several advanced topics that are of interest to Python programmers, and (3) a Pythonworkbook with lots of exercises.


A Python Book: Beginning Python, Advanced
Python, and Python Exercises


Author:
Dave Kuhlman
Contact:
dkuhlman@davekuhlman.org
Address:
http://www.davekuhlman.org





Revision

1.3a
Date
December 15, 2013
Copyright
Copyright (c) 2009 Dave Kuhlman. All Rights Reserved. This document is subject
to the provisions of the Open Source MIT License
http://www.opensource.org/licenses/mit­license.php.
Abstract
This document is a self­learning document for a course in Python programming.
This course contains (1) a part for beginners, (2) a discussion of several advanced
topics that are of interest to Python programmers, and (3) a Python workbook with
lots of exercises.

Preface

This book is a collection of materials that I've used when conducting Python training and
also materials from my Web site that are intended for self­instruction.
You may prefer a machine readable copy of this book. You can find it in various formats
here:
● HTML – http://www.davekuhlman.org/python_book_01.html
● PDF ­­ http://www.davekuhlman.org /python_book_01.pdf
● ODF/OpenOffice ­­ http://www.davekuhlman.org /python_book_01.odt
And, let me thank the students in my Python classes. Their questions and suggestions
were a great help in the preparation of these materials.



Part 1 ­­ Beginning Python


1.1 Introductions Etc

introduction

Practical matters: restrooms, breakroom, lunch and break times, etc.
Starting the Python interactive interpreter. Also, IPython and Idle.
Running scripts
Editors ­­ Choose an editor which you can configure so that it indents with 4 spaces, not
tab characters. For a list of editors for Python, see:
http://wiki.python.org/moin/PythonEditors. A few possible editors:
● SciTE ­­ http://www.scintilla.org/SciTE.html.
● MS Windows only ­­ (1) TextPad ­­ http://www.textpad.com; (2) UltraEdit ­­
http://www.ultraedit.com/.
● Jed ­­ See http://www.jedsoft.org/jed/.
● Emacs ­­ See http://www.gnu.org/software/emacs/ and
http://www.xemacs.org/faq/xemacs­faq.html.
● jEdit ­­ Requires a bit of customization for Python ­­ See http://jedit.org.
● Vim ­­ http://www.vim.org/
● Geany ­­ http://www.geany.org/
● And many more.
Interactive interpreters:
● python
● ipython
● Idle
IDEs ­­ Also see
http://en.wikipedia.org/wiki/List_of_integrated_development_environments_for_Python:
● PyWin ­­ MS Windows only. Available at:
http://sourceforge.net/projects/pywin32/.
● WingIDE ­­ See http://wingware.com/wingide/.
● Eclipse ­­ http://eclipse.org/. There is a plug­in that supports Python.
● Kdevelop ­­ Linux/KDE ­­ See http://www.kdevelop.org/.
● Eric ­­ Linux KDE? ­­ See http://eric­ide.python­projects.org/index.html
● Emacs and SciTE will evaluate a Python buffer within the editor.

2 Part 2 ­­ Advanced Python

2.1 Introduction ­­ Python 201 ­­ (Slightly) Advanced Python Topics

This document is intended as notes for a course on (slightly) advanced Python topics.
2.2 Regular Expressions
For more help on regular expressions, see:
● re ­ Regular expression operations http://docs.python.org/library/re.html
● Regular Expression HOWTO ­­ http://docs.python.org/howto/regex.html
2.2.1 Defining regular expressions
A regular expression pattern is a sequence of characters that will match sequences of
characters in a target.
The patterns or regular expressions can be defined as follows:
● Literal characters must match exactly. For example, "a" matches "a".
● Concatenated patterns match concatenated targets. For example, "ab" ("a"
followed by "b") matches "ab".
● Alternate patterns (separated by a vertical bar) match either of the alternative
patterns. For example, "(aaa)|(bbb)" will match either "aaa" or "bbb".
● Repeating and optional items:
○ "abc*" matches "ab" followed by zero or more occurances of "c", for example,
"ab", "abc", "abcc", etc.
○ "abc+" matches "ab" followed by one or more occurances of "c", for example,
"abc", "abcc", etc, but not "ab".
○ "abc?" matches "ab" followed by zero or one occurances of "c", for example,
"ab" or "abc".
● Sets of characters ­­ Characters and sequences of characters in square brackets
form a set; a set matches any character in the set or range. For example, "[abc]"
matches "a" or "b" or "c". And, for example, "[_a­z0­9]" matches an underscore
or any lower­case letter or any digit.
● Groups ­­ Parentheses indicate a group with a pattern. For example, "ab(cd)*ef" is
a pattern that matches "ab" followed by any number of occurances of "cd"
followed by "ef", for example, "abef", "abcdef", "abcdcdef", etc.
● There are special names for some sets of characters, for example "\d" (any digit),


No comments:

Post a Comment

Followers

PdfBook

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum rhoncus vehicula tortor, vel cursus elit. Donec nec nisl felis. Pellentesque ultrices sem sit amet eros interdum, id elementum nisi ermentum.Vestibulum rhoncus vehicula tortor, vel cursus elit. Donec nec nisl felis. Pellentesque ultrices sem sit amet eros interdum, id elementum nisi fermentum.




Comments

Contact Form

Name

Email *

Message *