Index. Cache, 20 Callables, 185 call () method, 290 chain() function, 41 Classes attributes descriptors, 145 properties, 143

Size: px
Start display at page:

Download "Index. Cache, 20 Callables, 185 call () method, 290 chain() function, 41 Classes attributes descriptors, 145 properties, 143"

Transcription

1 Index A add_column() method, 284 add() method, 44 addtypeequalityfunc() method, 253 Affero General Public License (AGPL), 260 American Standard Code for Information Interchange (ASCII), and operator, 34 append() method, 44 attach_to_class() method, 277 Attributes, doc attribute, 335 B Backward compatibility policy making incompatible changes, 342 Python 3.0, 344 rules, Berkeley Software Distribution (BSD) license, 261 Bound methods, 149 Built-in id() function, 189 Byte string chr() and ord(), 214 standard strings, 213 struct module, 215 C Cache, 20 Callables, 185 call () method, 290 chain() function, 41 Classes attributes descriptors, 145 properties, 143 creation metaclasses, 137 namespace controlling, 141 plugin framework, 138 runtime, 135 docstrings, 337 inheritance contact class, 116 get and set functions, 116 introspection, 133 MRO (see Method resolution order (MRO)) multiple inheritance, 118 Person and Company classes, 117 Python class, 116 magic methods attributes, 155 automatic subclasses, 154 instantiation creation, 153 string representations, 158 methods assigning functions, 152 bound methods, 149 class methods, 150 static methods, 151 unbound methods, 148 Class methods, 150 clear() method, 46 Collections module default dictionaries, 49 named tuples, 48 ordered dictionaries, 48 sets add() method, 44 append() method, 44 clear() method, 46 difference() method, 47 discard() method, 45 intersection() method,

2 index Collections module (cont.) issubset() method, 47 issuperset() method, 47 in keyword, 44 letters determination, 43 pop() method, 45 remove() method, 45 union() method, 46 update() method, 44, 46 Comma separated values (CSV) files argument checking column name array, 303 keyword arguments, positional arguments, 301 declarative programming (see Declarative programming) enumerate() method, 304 kwargs, 304 looping, 304 reader() method Content class, 311 csv_dialect attribute, 308 Dialect class, 308 iterable object, 306 iter () method, 309 next () method, row class, reader objects, 300 Row class, 306 writer() method contents, 314 Row subclass, 312 title() method, 313 writerow() method, writer objects, 300 Compatibility policy, backward, Conditional expressions and operator, 34 false value, 35 if/else function, 33 or operator, 34 Context managers, 186 Control flow catching exceptions clause, 24 EnvironmentError, 23 except keyword, 22 IOError, 23 OSError, 23 SystemExit, 23 try keyword, 22 TypeError, 24 conditional expressions and operator, 34 false value, 35 if/else function, 33 or operator, 34 count_lines() function, 28 definition, 22 except blocks, 29 exception chains, 26 optimizing loops, 31 UnicodeDecodeError, 30 with statement, 32 copy() method, 209 CounterMeta class, 290 D Declarative programming advantage, 271 base class, 272 class declaration, 271 end-user code, 272 example.py, 282 fields arguments, 275 attach_to_class() method, 277 base class, 276 columns, 275 definition, 272 init () method, 276 title, 276 init.py module, 282 instance methods, 271 managing options codecs.getreader(), 274 component, 273 custom class, 273 dialects, 275 dictionary implementation, 273 encode() method, 273 header row, 274 init () method, 273 open() function, read() method, 274 validation method, 273 metaclasses attach_to_class() method, 280 class-level attributes, 279 dialect class, 279 encoding, 279 hasattr(), 281 inner class, 279 loop, 281 RowMeta, 281 options container, 272 placeholder, 273 string variable, 270 valuable approach,

3 Index deepcopy () method, 211, 212 del () method, 199 Development Python 3000 development, Python language moratorium, discard() method, 45 Distribution licensing AGPL, 260 BSD license, 261 Free Software Foundation, 262 GPL, 259 LGPL, 261 OSI, 262 online documentation, 267 packaging definition, 262 documentation, MANIFEST.in, 264 sdist command, 265 setup.py, 263 tests directory, 263 PyPI, 267 Django and Elixir approach, 269 doc attribute, 335 Docstrings, 335 indentation, multi-line docstrings, one-line docstrings, 336 using triple double quotes, 336 Doctest module code formatting, 244 docstrings, 243 documentation, 246 print() function, 245 repr() function, 245 testmod() function, 247 times2() function, 247 Documentation comments, 234 docstrings, 235 external installation and configuration, 237 reference documents, 237 tutorials, 237 proper naming, 233 utilities formatting, 238 links, 239 Sphinx, 241 Don t Repeat Yourself (DRY), 13, 22 E elif keyword, 5 enumerate() method, 304 F Field library Column class, DateColumn class format object, 296 strptime() method, 297 to_python() method, DecimalColumn, 295 FloatColumn, 294 IntegerColumn, 294 StringField, 293 to_python() method, 292 to_string() method, 292 Functions annotations annotation_processor, 96 coercion, 98 decorators, 100 typesafe() decorator, 98 type safety, 88 arguments flexibility, 60 get_arguments() function, 72, 74 introspection, 68 invoking functions, 66 keyword, 62 positional arguments, 64 preloading, 67 Python s keyword, 60 required arguments, 64 update() function, 74 values, 69 variable keyword arguments, 66 variable positional, 61 variable positional arguments, 65 decorators arguments, 81 closures, 78 create, 86 log_error() function, 77 memoization, syntax, 77 with/without arguments, 83 wrappers, 79 docstrings, 337 generators, 105 introspection definition, 109 docstrings, 111 modules and packages, 110 object types, 109 lambdas, 107 programming language, 59 functools.partial(),

4 index G, H Garbage collection cyclical references del b, 199 del () method, gc.collect(), 200 gc.module, reference counting, 198 weak reference, 201 General Public License (GPL), 259 getattr () method, 194 get() method, 11 getstate () method, 205 I, J, K import () function, 54 Importing code asterisk, 52 fallback, 50 future module, 51 import () function, 54 importlib module, 56 relative imports, 54 import_module() function, 57 import_path() function, 56 indentation, docstrings, init () method, 253, 258, 276 insort() method, 288 intersection() method, 46 Introspection, 22 issubset() method, 47 issuperset() method, 47 Iterables break statement, 175 built-in range() function, 176 generators, 177 init () method, 175 iter () method, 175 next () method, 175 Iteration category, 19 chaining iterables, 41 definition, 35 dictionary comprehensions, 40 for loop, 36 generator expressions, 39 list comprehensions, 38 looping, 20 memory allocation, 20 object-oriented perspective, 19 range() function, 35 sequence unpacking, 36 set comprehensions, 40 zipping iterables, 42 iter () method, 309 L Lesser General Public License (LGPL), 261 M map() function, 42 Mappings, 184 Memoization, 21 Method resolution order (MRO) base class, 119 breadth-first approach, 122 C3 algorithm, 127 C3 function, 123 candidate class, 123 candidate removal, 125 candidate selection, 126 horizontal approach, 120 non first classes, 124 parent classes, 123 purchase() method, 120 simple two-element list, 122 super() function, test() method, 121, 131 TypeError, 128 while True loop, 124 min() function, 39 N namedtuple() function, 48 Namespace dictionary Borg pattern init () method, 190 new () method, dict attribute, 190 self-caching properties cachedproperty(), getattr () method, 194 ORM, 194 Person.get_employer() method, 195 setattr () method, 194 New BSD license, 261 new () method, 291 next () method, 310 Numbers comparison operations, 174 floor () method, 172 index ()method,

5 Index int () method, 172 round () method, 172 sign operations, 173 TypeError, 171 O Object management deep copy method, 211 garbage collection (see Garbage collection) identity, 189 namespace dictionary (see Namespace dictionary) object type, 189 pickling currency() method, 207 dumps() function, 204 getstate () method, 205 load() and loads() functions, 205 setstate () method, 207 shallow copy, 210 value, 189 Object-Relational Mapping (ORM), 194 open() function, 273 open() method, 274 Open Source Initiative (OSI), 260 Operations bitwise operations, 168 bool () method, 161 mathematical operations arithmetic operations, 163 floor division, 164 floor division vs. true division, 165 modulo operation, 165 pow () method, 167 rectangle, 162 variations, 169 Ordered fields Column. init () attach_to_class(), 288 Column object, 286 Dialect object, 287 init () method, 286, 288 insort() method, 288 RowMeta class, 287 Column. new (), 289 CounterMeta. call (), 290 DeclarativeMeta. prepare () add_column() method, 284 Column class, 285 namespace dictionary, 283 RowMeta, 283 options, 291 or operator, 34 os.stat() function, 324 P, Q Pareto Principle, 15 PEP. See Python Enhancement Proposal (PEP) pop() method, 45 Preloading arguments, 67 Py3k (Python 3000), 343 Python backward compatibility, 16 DRY, 13 keyword arguments, 60 loose coupling, 14 Pareto Principle, 15 Python 3.0, 17 robustness principle, 15 samurai principle, 14 Zen of Python bracket syntax, 11 code blocks, 5 code snippet, 5 comp.lang.python, 1 complexity, 4 documentation, 12 elif keyword, 5 encoding, 11 error handling, 10 explicit code, 3 get() method, 11 implementation, 8, 12 interface, 4 is_valid code, 3 iterative development, 12 keyword arguments, 2 namespace handling, 13 PEP-8, 6 readability Counts, 7 robust error-handling system, 8 Unicode strings, 11 validate() method, 9 Python 3.0, 17, 25 backwards compatibility, 344 language moratorium, Python 3000 development, Python Enhancement Proposal (PEP), 1 PEP 257, 323 (see also Docstrings) PEP 258 (Docutils Design Specification), 336 PEP 361, 343 PEP 3000, 343 PEP 3003 (Python language moratorium), 347, 349 PEP 3099, 343 PEP 3100, 343 Python Package Index (PyPI),

6 index R remove() method, 45 Robustness principle, 15 S Samurai principle, 14 scripts, docstrings, 337 self.fail(), 258 Sequences additional attributes and behaviors, 179 built-in len() function, 179 class range, 183 contains () method, 183 delitem () method, 183 getitem () method, len () method, 179 reversed() function, 180 setitem () method, 182 setattr () method, 194 setstate () method, 207 setup() function, 263 Simplified BSD license, 262 sort() method call, 108 Sphinx, 241 startswith() method, 9 strftime() method, 299 string literals, docstrings, 336 String representation, 158 Strings bytes chr() and ord(), 214 standard strings, 213 struct module, 215 formatting custom format, 230 customizable validation function, 225 explicit format() method, 224 format(), 225 keyword arguments, 224 object reference, 226 plain text table of contents, 228 positional arguments, 224 repr () method, 226 standard format, 226 str () method, 226 simple substitution, 221 text encodings, 219 unicode, 219 strptime() method, 297 Struct module, 215 StudlyCaps, 324 Style guidelines code layout blank lines, 318 encodings (PEP 263), 319 indentation, 318 maximum line length, 318 tabs/spaces, 318 comments, 322 consistency, 317 copyright, 330 documentation strings, 323 expressions and statements, whitespace arithmetic operators, 321 binary operators, 321 compound statements, 322 default parameter value, 321 multiclause statements, 322 pet peeves, 320 imports class-containing module, 320 intrapackage, 319 local application/library-specific, 319 related third-party, 319 separate lines, 319 standard library, 319 naming conventions class names, 325, 328 constants, 326 exception names, 325 function and method arguments, 326 function names, 326 global variable names, 326 method names and instance variables, 326 naming styles, 324 nonpublic attributes, 326 package and module names, 325 public attributes, 326 Pythonic guidelines, 327 subclass API, 327 programming recommendations bare except, 329 catching exceptions, 328 class-based exceptions, 328 isinstance(), 329 None, 328 sequences, 330 startswith() and endswith(), 329 str and unicode, 330 string exceptions, 328 ValueError( message ), 328 version bookkeeping,

7 Index T teardown() method, 257 Testing custom test class, 258 definition, 243 doctest module code formatting, 244 docstrings, 243 documentation, 246 print() function, 245 repr() function, 245 testmod() function, 247 times2() function, 247 test-driven development, 243 unittest module addtypeequalityfunc() method, 253 assertequal(), 252 assertion, 249 AssertionError, 251 assertraises(), assertraisesregexp(), 255 comparison methods, 254 identity, 257 main() function, 250 sequence content, 254 setup() method, 249 strings, 254 teardown() method, 257 TestCase class, 248 tests.py, 250 with block, 256 testnumber() method, 250 tests.py module, 250 title() method, 313 to_python() method, 292 to_string() method, 292 Transparency, 21 U Unbound methods, 148 union() method, 46 Unittest module addtypeequalityfunc() method, 253 assertequal(), 252 assertion, 249 AssertionError, 251 assertraises(), assertraisesregexp(), 255 comparison methods, 254 identity, 257 main() function, 250 sequence content, 254 setup() method, 249 strings, 254 teardown() method, 257 TestCase class, 248 tests.py, 250 with block, 256 update() method, 44, 46 UTF-8, 220 V validate() method, 9 Version compatibility, backward compatibility, Voting guidelines copyright, 331 rationale, 331 voting scores, 331 W What You. See Is What You Get (WYSIWYG), 238 What You. See Is What You Mean (WYSIWYM), 238 writerow() method, 312 writerows() method, 314 X, Y XOR operation, 47 Z Zen of Python, 333 zip() function,

Pro Python. Marty Alchin

Pro Python. Marty Alchin Pro Python Marty Alchin Pro Python Copyright 2010 by Marty Alchin All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including

More information

Beyond Blocks: Python Session #1

Beyond Blocks: Python Session #1 Beyond Blocks: Session #1 CS10 Spring 2013 Thursday, April 30, 2013 Michael Ball Beyond Blocks : : Session #1 by Michael Ball adapted from Glenn Sugden is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike

More information

Babu Madhav Institute of Information Technology, UTU 2015

Babu Madhav Institute of Information Technology, UTU 2015 Five years Integrated M.Sc.(IT)(Semester 5) Question Bank 060010502:Programming in Python Unit-1:Introduction To Python Q-1 Answer the following Questions in short. 1. Which operator is used for slicing?

More information

Python Reference (The Right Way) Documentation

Python Reference (The Right Way) Documentation Python Reference (The Right Way) Documentation Release 0.1 Jakub Przywóski Sep 30, 2017 Contents 1 Contents 1 1.1 Introduction............................................... 1 1.2 Definitions................................................

More information

Python in 10 (50) minutes

Python in 10 (50) minutes Python in 10 (50) minutes https://www.stavros.io/tutorials/python/ Python for Microcontrollers Getting started with MicroPython Donald Norris, McGrawHill (2017) Python is strongly typed (i.e. types are

More information

PYTHON FOR KIDS A Pl ayfu l I ntrodu ctio n to Prog r am m i ng J a s o n R. B r i g g s

PYTHON FOR KIDS A Pl ayfu l I ntrodu ctio n to Prog r am m i ng J a s o n R. B r i g g s PYTHON FO R K I D S A P l ay f u l I n t r o d u c t i o n to P r o g r a m m i n g Jason R. Briggs Index Symbols and Numbers + (addition operator), 17 \ (backslash) to separate lines of code, 235 in strings,

More information

CSCE 110 Programming I

CSCE 110 Programming I CSCE 110 Programming I Basics of Python (Part 3): Functions, Lists, For Loops, and Tuples Dr. Tiffani L. Williams Department of Computer Science and Engineering Texas A&M University Spring 2014 Tiffani

More information

pygtrie Release Jul 03, 2017

pygtrie Release Jul 03, 2017 pygtrie Release Jul 03, 2017 Contents 1 Features 3 2 Installation 5 3 Upgrading from 0.9.x 7 4 Trie classes 9 5 PrefixSet class 19 6 Version History 21 Python Module Index 23 i ii Implementation of a

More information

Python I. Some material adapted from Upenn cmpe391 slides and other sources

Python I. Some material adapted from Upenn cmpe391 slides and other sources Python I Some material adapted from Upenn cmpe391 slides and other sources Overview Names & Assignment Data types Sequences types: Lists, Tuples, and Strings Mutability Understanding Reference Semantics

More information

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines. Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals:

There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals: Numeric Types There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals: 1-123 +456 2. Long integers, of unlimited

More information

Table of Contents. Preface... xxi

Table of Contents. Preface... xxi Table of Contents Preface... xxi Chapter 1: Introduction to Python... 1 Python... 2 Features of Python... 3 Execution of a Python Program... 7 Viewing the Byte Code... 9 Flavors of Python... 10 Python

More information

Table of Contents EVALUATION COPY

Table of Contents EVALUATION COPY Table of Contents Introduction... 1-2 A Brief History of Python... 1-3 Python Versions... 1-4 Installing Python... 1-5 Environment Variables... 1-6 Executing Python from the Command Line... 1-7 IDLE...

More information

PYTHON CONTENT NOTE: Almost every task is explained with an example

PYTHON CONTENT NOTE: Almost every task is explained with an example PYTHON CONTENT NOTE: Almost every task is explained with an example Introduction: 1. What is a script and program? 2. Difference between scripting and programming languages? 3. What is Python? 4. Characteristics

More information

Python 3000 and You. Guido van Rossum PyCon March 14, 2008

Python 3000 and You. Guido van Rossum PyCon March 14, 2008 Python 3000 and You Guido van Rossum PyCon March 14, 2008 Why Py3k Open source needs to move or die Matz (creator of Ruby) To fix early, sticky design mistakes e.g. classic classes, int division, print

More information

Part IV. More on Python. Tobias Neckel: Scripting with Bash and Python Compact Max-Planck, February 16-26,

Part IV. More on Python. Tobias Neckel: Scripting with Bash and Python Compact Max-Planck, February 16-26, Part IV More on Python Compact Course @ Max-Planck, February 16-26, 2015 36 More on Strings Special string methods (excerpt) s = " Frodo and Sam and Bilbo " s. islower () s. isupper () s. startswith ("

More information

Python. Executive Summary

Python. Executive Summary Python Executive Summary DEFINITIONS OBJECT: a unit of data of a particular type with characteristic functionality (i.e., methods and/or response to operators). Everything in Python is an object. "atomic"

More information

Index COPYRIGHTED MATERIAL

Index COPYRIGHTED MATERIAL Index COPYRIGHTED MATERIAL Note to the Reader: Throughout this index boldfaced page numbers indicate primary discussions of a topic. Italicized page numbers indicate illustrations. A abstract classes

More information

Part III Appendices 165

Part III Appendices 165 Part III Appendices 165 Appendix A Technical Instructions Learning Outcomes This material will help you learn how to use the software you need to do your work in this course. You won t be tested on it.

More information

GIS 4653/5653: Spatial Programming and GIS. More Python: Statements, Types, Functions, Modules, Classes

GIS 4653/5653: Spatial Programming and GIS. More Python: Statements, Types, Functions, Modules, Classes GIS 4653/5653: Spatial Programming and GIS More Python: Statements, Types, Functions, Modules, Classes Statement Syntax The if-elif-else statement Indentation and and colons are important Parentheses and

More information

Webgurukul Programming Language Course

Webgurukul Programming Language Course Webgurukul Programming Language Course Take One step towards IT profession with us Python Syllabus Python Training Overview > What are the Python Course Pre-requisites > Objectives of the Course > Who

More information

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

COMP519 Web Programming Lecture 21: Python (Part 5) Handouts

COMP519 Web Programming Lecture 21: Python (Part 5) Handouts COMP519 Web Programming Lecture 21: Python (Part 5) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool Functions

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

Interactive use. $ python. >>> print 'Hello, world!' Hello, world! >>> 3 $ Ctrl-D

Interactive use. $ python. >>> print 'Hello, world!' Hello, world! >>> 3 $ Ctrl-D 1/60 Interactive use $ python Python 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin Type "help", "copyright", "credits" or "license" for more information.

More information

About Python. Python Duration. Training Objectives. Training Pre - Requisites & Who Should Learn Python

About Python. Python Duration. Training Objectives. Training Pre - Requisites & Who Should Learn Python About Python Python course is a great introduction to both fundamental programming concepts and the Python programming language. By the end, you'll be familiar with Python syntax and you'll be able to

More information

Fluent Python. Luciano Ramalho. Tokyo O'REILLY. Beijing. Sebastopol. Farnham. Boston

Fluent Python. Luciano Ramalho. Tokyo O'REILLY. Beijing. Sebastopol. Farnham. Boston Fluent Python Luciano Ramalho Beijing Boston Farnham Sebastopol Tokyo O'REILLY Table of Contents Preface xv Part I. Prologue 1. The Python Data Model 3 A Pythonic Card Deck 4 How Special Methods Are Used

More information

Python Tutorial. Day 1

Python Tutorial. Day 1 Python Tutorial Day 1 1 Why Python high level language interpreted and interactive real data structures (structures, objects) object oriented all the way down rich library support 2 The First Program #!/usr/bin/env

More information

Python Essential Reference, Second Edition - Chapter 5: Control Flow Page 1 of 8

Python Essential Reference, Second Edition - Chapter 5: Control Flow Page 1 of 8 Python Essential Reference, Second Edition - Chapter 5: Control Flow Page 1 of 8 Chapter 5: Control Flow This chapter describes related to the control flow of a program. Topics include conditionals, loops,

More information

And Parallelism. Parallelism in Prolog. OR Parallelism

And Parallelism. Parallelism in Prolog. OR Parallelism Parallelism in Prolog And Parallelism One reason that Prolog is of interest to computer scientists is that its search mechanism lends itself to parallel evaluation. In fact, it supports two different kinds

More information

Assignment 6: Motif Finding Bio5488 2/24/17. Slide Credits: Nicole Rockweiler

Assignment 6: Motif Finding Bio5488 2/24/17. Slide Credits: Nicole Rockweiler Assignment 6: Motif Finding Bio5488 2/24/17 Slide Credits: Nicole Rockweiler Assignment 6: Motif finding Input Promoter sequences PWMs of DNA-binding proteins Goal Find putative binding sites in the sequences

More information

Interactive use. $ python. >>> print 'Hello, world!' Hello, world! >>> 3 $ Ctrl-D

Interactive use. $ python. >>> print 'Hello, world!' Hello, world! >>> 3 $ Ctrl-D 1/58 Interactive use $ python Python 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin Type "help", "copyright", "credits" or "license" for more information.

More information

Introduction to Python

Introduction to Python Introduction to Python Version 1.1.5 (12/29/2008) [CG] Page 1 of 243 Introduction...6 About Python...7 The Python Interpreter...9 Exercises...11 Python Compilation...12 Python Scripts in Linux/Unix & Windows...14

More information

streamio Documentation

streamio Documentation streamio Documentation Release 0.1.0.dev James Mills April 17, 2014 Contents 1 About 3 1.1 Examples................................................. 3 1.2 Requirements...............................................

More information

Python INTRODUCTION: Understanding the Open source Installation of python in Linux/windows. Understanding Interpreters * ipython.

Python INTRODUCTION: Understanding the Open source Installation of python in Linux/windows. Understanding Interpreters * ipython. INTRODUCTION: Understanding the Open source Installation of python in Linux/windows. Understanding Interpreters * ipython * bpython Getting started with. Setting up the IDE and various IDEs. Setting up

More information

Python 3000 and You. Guido van Rossum EuroPython July 7, 2008

Python 3000 and You. Guido van Rossum EuroPython July 7, 2008 Python 3000 and You Guido van Rossum EuroPython July 7, 2008 Why Py3k Open source needs to move or die Matz (creator of Ruby) To fix early, sticky design mistakes e.g. classic classes, int division, print

More information

Advanced Python. Executive Summary, Session 1

Advanced Python. Executive Summary, Session 1 Advanced Python Executive Summary, Session 1 OBJECT: a unit of data of a particular type with characteristic functionality (i.e., methods and/or use with operators). Everything in Python is an object.

More information

Lecture 27. Lecture 27: Regular Expressions and Python Identifiers

Lecture 27. Lecture 27: Regular Expressions and Python Identifiers Lecture 27 Lecture 27: Regular Expressions and Python Identifiers Python Syntax Python syntax makes very few restrictions on the ways that we can name our variables, functions, and classes. Variables names

More information

PTN-105 Python programming. Course Outline. Prerequisite: basic Linux/UNIX and programming skills. Delivery Method: Instructor-led training (ILT)

PTN-105 Python programming. Course Outline. Prerequisite: basic Linux/UNIX and programming skills. Delivery Method: Instructor-led training (ILT) PTN-105 Python programming Prerequisite: basic Linux/UNIX and programming skills. Delivery Method: Instructor-led training (ILT) Course Length: 5 days Course Outline Module 1. Introduction Why python?

More information

Index. object lifetimes, and ownership, use after change by an alias errors, use after drop errors, BTreeMap, 309

Index. object lifetimes, and ownership, use after change by an alias errors, use after drop errors, BTreeMap, 309 A Arithmetic operation floating-point arithmetic, 11 12 integer numbers, 9 11 Arrays, 97 copying, 59 60 creation, 48 elements, 48 empty arrays and vectors, 57 58 executable program, 49 expressions, 48

More information

Introduction to Python programming, II

Introduction to Python programming, II Grid Computing Competence Center Introduction to Python programming, II Riccardo Murri Grid Computing Competence Center, Organisch-Chemisches Institut, University of Zurich Nov. 16, 2011 Today s class

More information

Programming in Python 3

Programming in Python 3 Programming in Python 3 A Complete Introduction to the Python Language Mark Summerfield.4.Addison-Wesley Upper Saddle River, NJ Boston Indianapolis San Francisco New York Toronto Montreal London Munich

More information

CNRS ANF PYTHON Objects everywhere

CNRS ANF PYTHON Objects everywhere CNRS ANF PYTHON Objects everywhere Marc Poinot Numerical Simulation Dept. Outline Python Object oriented features Basic OO concepts syntax More on Python classes multiple inheritance reuse introspection

More information

egrapher Language Reference Manual

egrapher Language Reference Manual egrapher Language Reference Manual Long Long: ll3078@columbia.edu Xinli Jia: xj2191@columbia.edu Jiefu Ying: jy2799@columbia.edu Linnan Wang: lw2645@columbia.edu Darren Chen: dsc2155@columbia.edu 1. Introduction

More information

Modules and scoping rules

Modules and scoping rules C H A P T E R 1 1 Modules and scoping rules 11.1 What is a module? 106 11.2 A first module 107 11.3 The import statement 109 11.4 The module search path 110 11.5 Private names in modules 112 11.6 Library

More information

DaMPL. Language Reference Manual. Henrique Grando

DaMPL. Language Reference Manual. Henrique Grando DaMPL Language Reference Manual Bernardo Abreu Felipe Rocha Henrique Grando Hugo Sousa bd2440 flt2107 hp2409 ha2398 Contents 1. Getting Started... 4 2. Syntax Notations... 4 3. Lexical Conventions... 4

More information

pybdg Documentation Release 1.0.dev2 Outernet Inc

pybdg Documentation Release 1.0.dev2 Outernet Inc pybdg Documentation Release 1.0.dev2 Outernet Inc April 17, 2016 Contents 1 Source code 3 2 License 5 3 Documentation 7 Python Module Index 15 i ii Bitloads, or bit payloads, are compact payloads containing

More information

Python Training. Complete Practical & Real-time Trainings. A Unit of SequelGate Innovative Technologies Pvt. Ltd.

Python Training. Complete Practical & Real-time Trainings. A Unit of SequelGate Innovative Technologies Pvt. Ltd. Python Training Complete Practical & Real-time Trainings A Unit of. ISO Certified Training Institute Microsoft Certified Partner Training Highlights : Complete Practical and Real-time Scenarios Session

More information

DEBUGGING TIPS. 1 Introduction COMPUTER SCIENCE 61A

DEBUGGING TIPS. 1 Introduction COMPUTER SCIENCE 61A DEBUGGING TIPS COMPUTER SCIENCE 61A 1 Introduction Every time a function is called, Python creates what is called a stack frame for that specific function to hold local variables and other information.

More information

Data Structures I: Linked Lists

Data Structures I: Linked Lists Lab 4 Data Structures I: Linked Lists Lab Objective: Analyzing and manipulating data are essential skills in scientific computing. Storing, retrieving, and rearranging data take time. As a dataset grows,

More information

COMP519 Web Programming Lecture 20: Python (Part 4) Handouts

COMP519 Web Programming Lecture 20: Python (Part 4) Handouts COMP519 Web Programming Lecture 20: Python (Part 4) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool Contents

More information

Course Title: Python + Django for Web Application

Course Title: Python + Django for Web Application Course Title: Python + Django for Web Application Duration: 6 days Introduction This course offer Python + Django framework ( MTV ) training with hands on session using Eclipse+Pydev Environment. Python

More information

PTN-102 Python programming

PTN-102 Python programming PTN-102 Python programming COURSE DESCRIPTION Prerequisite: basic Linux/UNIX and programming skills. Delivery Method Instructor-led training (ILT) Duration Four days Course outline Chapter 1: Introduction

More information

What we already know. more of what we know. results, searching for "This" 6/21/2017. chapter 14

What we already know. more of what we know. results, searching for This 6/21/2017. chapter 14 What we already know chapter 14 Files and Exceptions II Files are bytes on disk. Two types, text and binary (we are working with text) open creates a connection between the disk contents and the program

More information

THE EXPERT S VOICE IN OPEN SOURCE. Pro. Python. Advanced coding techniques and tools. Marty Alchin

THE EXPERT S VOICE IN OPEN SOURCE. Pro. Python. Advanced coding techniques and tools. Marty Alchin THE EXPERT S VOICE IN OPEN SOURCE Pro Python Advanced coding techniques and tools Marty Alchin Pro Python Marty Alchin Pro Python Copyright 2010 by Marty Alchin All rights reserved. No part of this work

More information

CIS192 Python Programming

CIS192 Python Programming CIS192 Python Programming Introduction Robert Rand University of Pennsylvania September 16, 2015 Robert Rand (University of Pennsylvania) CIS 192 September 16, 2015 1 / 21 Outline 1 Object Orientation

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

Context-Oriented Programming with Python

Context-Oriented Programming with Python Context-Oriented Programming with Python Martin v. Löwis Hasso-Plattner-Institut an der Universität Potsdam Agenda Meta-Programming Example: HTTP User-Agent COP Syntax Implicit Layer Activation Django

More information

Basic Python 3 Programming (Theory & Practical)

Basic Python 3 Programming (Theory & Practical) Basic Python 3 Programming (Theory & Practical) Length Delivery Method : 5 Days : Instructor-led (Classroom) Course Overview This Python 3 Programming training leads the student from the basics of writing

More information

CIS192: Python Programming

CIS192: Python Programming CIS192: Python Programming Introduction Harry Smith University of Pennsylvania January 18, 2017 Harry Smith (University of Pennsylvania) CIS 192 Lecture 1 January 18, 2017 1 / 34 Outline 1 Logistics Rooms

More information

Intermediate Python 3.x

Intermediate Python 3.x Intermediate Python 3.x This 4 day course picks up where Introduction to Python 3 leaves off, covering some topics in more detail, and adding many new ones, with a focus on enterprise development. This

More information

CS Programming Languages: Python

CS Programming Languages: Python CS 3101-1 - Programming Languages: Python Lecture 5: Exceptions / Daniel Bauer (bauer@cs.columbia.edu) October 08 2014 Daniel Bauer CS3101-1 Python - 05 - Exceptions / 1/35 Contents Exceptions Daniel Bauer

More information

GE PROBLEM SOVING AND PYTHON PROGRAMMING. Question Bank UNIT 1 - ALGORITHMIC PROBLEM SOLVING

GE PROBLEM SOVING AND PYTHON PROGRAMMING. Question Bank UNIT 1 - ALGORITHMIC PROBLEM SOLVING GE8151 - PROBLEM SOVING AND PYTHON PROGRAMMING Question Bank UNIT 1 - ALGORITHMIC PROBLEM SOLVING 1) Define Computer 2) Define algorithm 3) What are the two phases in algorithmic problem solving? 4) Why

More information

CIS192 Python Programming

CIS192 Python Programming CIS192 Python Programming Object-Oriented Programming Robert Rand University of Pennsylvania February 10, 2016 Robert Rand (University of Pennsylvania) CIS 192 February 10, 2016 1 / 25 Outline 1 Object

More information

At full speed with Python

At full speed with Python At full speed with Python João Ventura v0.1 Contents 1 Introduction 2 2 Installation 3 2.1 Installing on Windows............................ 3 2.2 Installing on macos............................. 5 2.3

More information

Software Development Python (Part B)

Software Development Python (Part B) Software Development Python (Part B) Davide Balzarotti Eurecom 1 List Comprehension It is a short way to construct a list based on the content of other existing lists Efficient Elegant Concise List comprehensions

More information

Lotus IT Hub. Module-1: Python Foundation (Mandatory)

Lotus IT Hub. Module-1: Python Foundation (Mandatory) Module-1: Python Foundation (Mandatory) What is Python and history of Python? Why Python and where to use it? Discussion about Python 2 and Python 3 Set up Python environment for development Demonstration

More information

Programming in Python 3

Programming in Python 3 Programming in Python 3 Programming transforms your computer from a home appliance to a power tool Al Sweigart, The invent with Python Blog Programming Introduction Write programs that solve a problem

More information

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix PGJC4_JSE8_OCA.book Page ix Monday, June 20, 2016 2:31 PM Contents Figures Tables Examples Foreword Preface xix xxi xxiii xxvii xxix 1 Basics of Java Programming 1 1.1 Introduction 2 1.2 Classes 2 Declaring

More information

Brief Contents. Acknowledgments... xv. Introduction Chapter 1: Starting Your Project Chapter 2: Modules, Libraries, and Frameworks...

Brief Contents. Acknowledgments... xv. Introduction Chapter 1: Starting Your Project Chapter 2: Modules, Libraries, and Frameworks... Brief Contents Acknowledgments... xv Introduction... 1 Chapter 1: Starting Your Project.... 5 Chapter 2: Modules, Libraries, and Frameworks... 15 Chapter 3: Documentation and Good API Practice... 33 Chapter

More information

Snakemine: Redmine API wrapper Documentation

Snakemine: Redmine API wrapper Documentation Snakemine: Redmine API wrapper Documentation Release 1.0b1 Mark Lee Sep 27, 2017 Contents 1 Installation 3 2 Example 5 3 License 7 4 Contributing 9 5 Contributors 11 6 API Documentation 13 6.1 Package:

More information

PYTHON FOR MEDICAL PHYSICISTS. Radiation Oncology Medical Physics Cancer Care Services, Royal Brisbane & Women s Hospital

PYTHON FOR MEDICAL PHYSICISTS. Radiation Oncology Medical Physics Cancer Care Services, Royal Brisbane & Women s Hospital PYTHON FOR MEDICAL PHYSICISTS Radiation Oncology Medical Physics Cancer Care Services, Royal Brisbane & Women s Hospital TUTORIAL 1: INTRODUCTION Thursday 1 st October, 2015 AGENDA 1. Reference list 2.

More information

Exceptions & a Taste of Declarative Programming in SQL

Exceptions & a Taste of Declarative Programming in SQL Exceptions & a Taste of Declarative Programming in SQL David E. Culler CS8 Computational Structures in Data Science http://inst.eecs.berkeley.edu/~cs88 Lecture 12 April 18, 2016 Computational Concepts

More information

The current topic: Python. Announcements. Python. Python

The current topic: Python. Announcements. Python. Python The current topic: Python Announcements! Introduction! reasons for studying languages! language classifications! simple syntax specification Object-oriented programming: Python Types and values Syntax

More information

Chapter 3 : Informatics Practices. Class XI ( As per CBSE Board) Python Fundamentals. Visit : python.mykvs.in for regular updates

Chapter 3 : Informatics Practices. Class XI ( As per CBSE Board) Python Fundamentals. Visit : python.mykvs.in for regular updates Chapter 3 : Informatics Practices Class XI ( As per CBSE Board) Python Fundamentals Introduction Python 3.0 was released in 2008. Although this version is supposed to be backward incompatibles, later on

More information

Java Overview An introduction to the Java Programming Language

Java Overview An introduction to the Java Programming Language Java Overview An introduction to the Java Programming Language Produced by: Eamonn de Leastar (edeleastar@wit.ie) Dr. Siobhan Drohan (sdrohan@wit.ie) Department of Computing and Mathematics http://www.wit.ie/

More information

6. Data Types and Dynamic Typing (Cont.)

6. Data Types and Dynamic Typing (Cont.) 6. Data Types and Dynamic Typing (Cont.) 6.5 Strings Strings can be delimited by a pair of single quotes ('...'), double quotes ("..."), triple single quotes ('''...'''), or triple double quotes ("""...""").

More information

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division CS 164 Spring 2005 P. N. Hilfinger Project #2: Static Analyzer for Pyth Due: Wednesday, 6 April

More information

Mock Documentation. Release Michael Foord

Mock Documentation. Release Michael Foord Mock Documentation Release 0.7.2 Michael Foord June 06, 2011 CONTENTS 1 API Documentation 3 1.1 The Mock Class................................... 3 1.2 Patch Decorators...................................

More information

TH IRD EDITION. Python Cookbook. David Beazley and Brian K. Jones. O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Tokyo

TH IRD EDITION. Python Cookbook. David Beazley and Brian K. Jones. O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Tokyo TH IRD EDITION Python Cookbook David Beazley and Brian K. Jones O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Tokyo Table of Contents Preface xi 1. Data Structures and Algorithms 1 1.1. Unpacking

More information

Part I Basic Concepts 1

Part I Basic Concepts 1 Introduction xiii Part I Basic Concepts 1 Chapter 1 Integer Arithmetic 3 1.1 Example Program 3 1.2 Computer Program 4 1.3 Documentation 5 1.4 Input 6 1.5 Assignment Statement 7 1.5.1 Basics of assignment

More information

Complete Python call :

Complete Python call : Module 1 (Baics Python Rs.4000 ) 30 hours CHAPTER Instant Hacking: The Basics Installing Python Windows Linux and UNIX Macintosh Other Distributions Keeping In Touch and Up to Date The Interactive Interpreter

More information

Introduction to C++ with content from

Introduction to C++ with content from Introduction to C++ with content from www.cplusplus.com 2 Introduction C++ widely-used general-purpose programming language procedural and object-oriented support strong support created by Bjarne Stroustrup

More information

Lecture 21. Programming with Subclasses

Lecture 21. Programming with Subclasses Lecture 21 Programming with Subclasses Announcements for This Lecture Assignments Prelim 2 A4 is now graded Mean: 90.4 Median: 93 Std Dev: 10.6 Mean: 9 hrs Median: 8 hrs Std Dev: 4.1 hrs A5 is also graded

More information

Lecture #15: Generic Functions and Expressivity. Last modified: Wed Mar 1 15:51: CS61A: Lecture #16 1

Lecture #15: Generic Functions and Expressivity. Last modified: Wed Mar 1 15:51: CS61A: Lecture #16 1 Lecture #15: Generic Functions and Expressivity Last modified: Wed Mar 1 15:51:48 2017 CS61A: Lecture #16 1 Consider the function find: Generic Programming def find(l, x, k): """Return the index in L of

More information

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17 List of Programs xxv List of Figures xxix List of Tables xxxiii Preface to second version xxxv PART 1 Structured Programming 1 1 Getting started 3 1.1 Programming 3 1.2 Editing source code 5 Source code

More information

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program Objectives Chapter 2: Basic Elements of C++ In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

More information

Chapter 2: Basic Elements of C++

Chapter 2: Basic Elements of C++ Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

More information

Objectives. Chapter 4: Control Structures I (Selection) Objectives (cont d.) Control Structures. Control Structures (cont d.) Relational Operators

Objectives. Chapter 4: Control Structures I (Selection) Objectives (cont d.) Control Structures. Control Structures (cont d.) Relational Operators Objectives Chapter 4: Control Structures I (Selection) In this chapter, you will: Learn about control structures Examine relational and logical operators Explore how to form and evaluate logical (Boolean)

More information

[CHAPTER] 1 INTRODUCTION 1

[CHAPTER] 1 INTRODUCTION 1 FM_TOC C7817 47493 1/28/11 9:29 AM Page iii Table of Contents [CHAPTER] 1 INTRODUCTION 1 1.1 Two Fundamental Ideas of Computer Science: Algorithms and Information Processing...2 1.1.1 Algorithms...2 1.1.2

More information

WA1278 Introduction to Java Using Eclipse

WA1278 Introduction to Java Using Eclipse Lincoln Land Community College Capital City Training Center 130 West Mason Springfield, IL 62702 217-782-7436 www.llcc.edu/cctc WA1278 Introduction to Java Using Eclipse This course introduces the Java

More information

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction Chapter 2: Basic Elements of C++ C++ Programming: From Problem Analysis to Program Design, Fifth Edition 1 Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers

More information

Friday, 11 April 14. Advanced methods for creating decorators Graham Dumpleton PyCon US - April 2014

Friday, 11 April 14. Advanced methods for creating decorators Graham Dumpleton PyCon US - April 2014 Advanced methods for creating decorators Graham Dumpleton PyCon US - April 2014 Intermission Rant about the history of this talk and why this topic matters. Python decorator syntax @function_wrapper def

More information

Lecture #12: Quick: Exceptions and SQL

Lecture #12: Quick: Exceptions and SQL UC Berkeley EECS Adj. Assistant Prof. Dr. Gerald Friedland Computational Structures in Data Science Lecture #12: Quick: Exceptions and SQL Administrivia Open Project: Starts Monday! Creative data task

More information

django-crucrudile Documentation

django-crucrudile Documentation django-crucrudile Documentation Release 0.9.1 Hugo Geoffroy (pstch) July 27, 2014 Contents 1 Installation 1 1.1 From Python package index....................................... 1 1.2 From source...............................................

More information

Python Mock Tutorial Documentation

Python Mock Tutorial Documentation Python Mock Tutorial Documentation Release 0.1 Javier Collado Nov 14, 2017 Contents 1 Introduction 3 2 Mock 5 2.1 What is a mock object?.......................................... 5 2.2 What makes mock

More information

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017 Overview of OOP Dr. Zhang COSC 1436 Summer, 2017 7/18/2017 Review Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in square brackets: l = [1, 2, "a"] (access by index, is mutable

More information

RTL Reference 1. JVM. 2. Lexical Conventions

RTL Reference 1. JVM. 2. Lexical Conventions RTL Reference 1. JVM Record Transformation Language (RTL) runs on the JVM. Runtime support for operations on data types are all implemented in Java. This constrains the data types to be compatible to Java's

More information

contacts= { bill : , rich : , jane : } print contacts { jane : , bill : , rich : }

contacts= { bill : , rich : , jane : } print contacts { jane : , bill : , rich : } Chapter 8 More Data Structures We have seen the list data structure and its uses. We will now examine two, more advanced data structures: the set and the dictionary. In particular, the dictionary is an

More information

Want to read more? You can buy this book at oreilly.com in print and ebook format. Buy 2 books, get the 3rd FREE!

Want to read more? You can buy this book at oreilly.com in print and ebook format. Buy 2 books, get the 3rd FREE! Want to read more? You can buy this book at oreilly.com in print and ebook format. Buy 2 books, get the 3rd FREE! Use discount code: OPC10 All orders over $29.95 qualify for free shipping within the US.

More information