Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Python for Programmers

You're reading from   Python for Programmers A Comprehensive Guide for Intermediate to Advanced Python Programmers and Developers

Arrow left icon
Product type Paperback
Published in Aug 2024
Publisher Mercury_Learning
ISBN-13 9781836645030
Length 293 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Mercury Learning and Information Mercury Learning and Information
Author Profile Icon Mercury Learning and Information
Mercury Learning and Information
Oswald Campesato Oswald Campesato
Author Profile Icon Oswald Campesato
Oswald Campesato
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface
1. Chapter 1: Introduction to Python 2. Chapter 2: Conditional Logic in Python FREE CHAPTER 3. Chapter 3: Data Structures in Python 4. Chapter 4: Strings and Arrays 5. Chapter 5: Built-In Functions and Custom Classes 6. Chapter 6: Recursion and Combinatorics 7. Index
Appendix: Introduction to Pandas

TOOLS FOR PYTHON

The Anaconda Python distribution available for Windows, Linux, and Mac is downloadable here:

http://continuum.io/downloads

Anaconda is well-suited for libraries such as NumPy (discussed in Chapter 3) and SciPy (not discussed in this book). Also, if you are a Windows user, Anaconda appears to be a better alternative.

easy_install and pip

Both easy_install and pip are very easy to use when you need to install Python modules. Whenever you need to install a Python module (and there are many in this book), use either easy_install or pip with the following syntax:

easy_install <module-name>

pip install <module-name>

NOTE

Python-based modules are easier to install, whereas modules with code written in C are usually faster but more difficult in terms of installation.

virtualenv

The virtualenv tool enables you to create isolated Python environments, and its home page is here:

http://www.virtualenv.org/en/latest/virtualenv.html

virtualenv addresses the problem of preserving the correct dependencies and versions (and indirectly permissions) for different applications. If you are a Python novice you might not need virtualenv right now, but keep this tool in mind.

IPython

Another very good tool is IPython (which won a Jolt award), and its home page is here:

http://ipython.org/install.html

Type ipython to invoke IPython from the command line:

ipython

The preceding command displays the following output:

Python 3.9.13 (main, May 24 2022, 21:28:12)

Type 'copyright', 'credits' or 'license' for more information

IPython 7.22.0 -- An enhanced Interactive Python. Type '?' for help.


In [1]:

Type a question mark (“?”) at the prompt and you will see some useful information, a portion of which is here:

IPython -- An enhanced Interactive Python

=========================================


IPython offers a fully compatible replacement for the standard Python interpreter, with convenient shell features, special commands, command history mechanism and output results caching.


At your system command line, type 'ipython -h' to see the command line options available. This document only describes interactive features.


GETTING HELP

------------


Within IPython you have various way to access help:


  ?         -> Introduction and overview of IPython's features (this screen).

  object?   -> Details about 'object'.

  object??  -> More detailed, verbose information about 'object'.

  %quickref -> Quick reference of all IPython specific syntax and magics.

  help      -> Access Python's own help system.


If you are in terminal IPython you can quit this screen by pressing `q`.

Finally, simply type quit() at the command prompt and you will exit the ipython shell.

The next section shows you how to check whether or not Python is installed on your machine, and also where you can download Python.

lock icon The rest of the chapter is locked
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Python for Programmers
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon