All Projects → PacktPublishing → Expert Python Programming_second Edition

PacktPublishing / Expert Python Programming_second Edition

Licence: bsd-3-clause
Become an ace Python programmer by learning best coding practices and advance-level concepts with Python 3.5

Programming Languages

python
139335 projects - #7 most used programming language

Expert Python Programming, Second Edition

Become an ace Python programmer by learning best coding practices and advance-level concepts with Python 3.5

This is package with code examples for Python Expert Programming, Second Edition book.

Structure of this package

Content of this package is divided into directories that refer exactly to book chapters. Code may differ sligthly from snippets presented in book. Sometimes it contains additional utilities, functions, or comments, that are intended to improve readability. This should help you better understand topics discussed in the book.

Each chapter directory contains NOTES file that explains the order in which scripts should be executed or additional information about its structure.

How to use this package

In order to use code examples, it is recommended to use virtual environments as explained in Chapter 1, Current Status of Python, of the book.

In short, create new environment somwhere on you disk. Make sure you are using at least Python 3.5 version to create virtual environment

$ python3.5 -m venv book-env

Book also covers topic of compatibility issues between Python 2 and Python 3 in certain sections. If you want to run scripts in older versions of Python, use virtualenv tool to create additional environment on your disk. Make sure to name it differently, so it will be clear which environment you are using in given shell session:

$ virtualenv -p python2.7 book-py27-env

If your environment is already created, you are ready to activate it so all installed packages will be isolated from your base system Python environment. If you are using bash, execute the following line:

$ source book-env/bin/activate

If you are working in Windows command line or Power Shell, then type:

> book-env\Scripts\activate

Successful activation will change your shell prompt by adding environment name prefix:

(book-env)$

Now, you can finally use pip to install all packages that are mentioned in book and used in example scripts:

(book-env)$ pip install -r requirements.txt

Want to learn more on Python?

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].