Chapter first to second--python introduction and Python Basics

Source: Internet
Author: User
Tags pprint

The book "Data wrangling with Python" is mainly about using Pyhon to deal with various types of storage.

Chapter One: Introduction to Python 1, version selection

The Python version chosen for this book is 2.7, not the newest Python3, which says: you want to make sure you can find easy-to-read and easy-to-access resources, and ensure that your operating system and services support the Python version you use.

This statement is also relatively easy to accept, after all, Python3 just haunt the Internet, most of the public resources are based on Python2. But even so, I personally think it is to pay attention to the difference between 3 and 2, with the Times. But that's not the point of the book, so take the extra attention.

2. Python Installation

Download the Python2.7 MSI after the official website can be installed directly, the installation process choose to add path, will automatically add environment variables, my is the WIN10 system, I do not know whether in other systems will have this effect.

If not, then take the initiative to add it in path (my installation path is: D:\Python27)

1), D:\Python27

2), D:\Python27\Lib\site-packages (this is my active according to the book added, the installation is not automatically generated this path)

3), D:\Python27\Scripts

3. Test Python Installation

After the installation is complete and the environment variables are configured, open cmd, enter Python, and if the output below proves the installation was successful.

The above shows my Python version, after >>> can write Python code directly and execute, exit input command: Exit ()

The book gives a set of code (the result of the output is a list of file paths for Pyhon on the computer):

>>> Import Sys
>>> Import Pprint
>>> Pprint.pprint (Sys.path)

Here is a demo of two error inputs:

1), module import error

2), spelling errors

4. Install Pip

Command-line tools for managing Python shared code and libraries (the book says, what is unclear, and so on, and then come back to add!) )

5. Installing the Code Editor

Sublime ... The code used in this book is written in Sublime, and then compiled with the command line, of course, there is a more convenient way, such as a Pycharm,python IDE, you can write code directly and compile, similar to the Java eclipse, but charges, can be cracked, Find your own way. Before it seemed like browsing to install the Python plugin in Eclipse and then compiling it with Eclipse, I didn't know if it was possible, I didn't try ...

Python code has a file name of xxx.py

Chapter II: Python Basics

Not to be continued

Chapter first to second--python introduction and Python Basics

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.