Cargando…

Python essentials : modernize existing Python code and plan code migrations to Python using this definitive guide /

This book is designed for Python 2 developers who want to get to grips with Python 3 in a short period of time. It covers the key features of Python, assuming you are familiar with the fundamentals of Python 2.

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Lott, Steven F. (Autor)
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham, UK : Packt Publishing, 2015.
Colección:Community experience distilled.
Temas:
Acceso en línea:Texto completo (Requiere registro previo con correo institucional)
Tabla de Contenidos:
  • Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Getting Started; Installation or upgrade; Installing Python on Windows; Considering some alternatives; Upgrading to Python 3.4 in Mac OS X; Adding the Tkinter package; Upgrading to Python 3.4 in Linux; Using the Read-Evaluate-Print Loop (REPL); Confirming that things are working; Doing simple arithmetic; Assigning results to variables; Using import to add features; Interacting with the help subsystem; Using the pydoc program; Creating simple script files
  • Simplified syntax rulesThe Python ecosystem; The idea of extensibility via add-ons; Using the Python Package Index
  • PyPI; Using pip to gather modules; Using easy_install to add modules; Installing modules manually; Looking at other Python interpreters; Summary; Chapter 2: Simple Data Types; Introducing the built-in operators; Making comparisons; Using integers; Using the bit-oriented operators; Using rational numbers; Using decimal numbers; Using floating-point numbers; Using complex numbers; The numeric tower; The math libraries; Using bits and Boolean values; Working with sequences
  • Slicing and dicing a sequenceUsing string and bytes values; Writing string literals; Using raw string literals; Using byte string literals; Using the string operators; Converting between Unicode and bytes; Using string methods; Accessing the details of a string; Parsing strings into substrings; Using the tuple collection; The None object; The consequences of immutability; Using the built-in conversion functions; Summary; Chapter 3: Expressions and Output; Expressions, operators, and data types; Using operators on non-numeric data; The print() function; Examining syntax rules
  • Splitting, partitioning, and joining stringsUsing the format() method to make more readable output; Summary of the standard string libraries; Using the re module to parse strings; Using regular expressions; Creating a regular expression string; Working with Unicode, ASCII and bytes; Using the locale module for personalization; Summary; Chapter 4: Variables, Assignment and Scoping Rules; Simple assignment and variables; Multiple assignment; Using repeated assignment; Using the head, *tail assignment; Augmented assignment; The input() function; Python language concepts
  • Object types versus variable declarationsAvoiding confusion when naming variables; Garbage collection via reference counting; The little-used del statement; The Python namespace concept; Globals and locals; Summary; Chapter 5: Logic, Comparisons, and Conditions; Boolean data and the bool() function; Comparison operators; Combining comparisons to simplify the logic; Testing float values; Comparing object IDs with the is operator; Equality and object hash values; Logic operators
  • and, or, not, if-else; Short-circuit (or non-strict) evaluation; The if-elif-else statement; Adding elif clauses