Learning Python is primarily to respond to the call of the Times, and more and more people use Python to crawl 1024 of small images .... Yuck, using Python to do data mining learning.
After learning C # and JavaScript, I decided to enter the pit python.
Experience, why: "Life is too short, I use Python"
I'm using a Windows system, so Linux and Mac are beyond.
I'm going to learn python in the context of my existing language learning experience.
Step1: Installation Environment
To tell the truth, the word environment always reminds me of the environment configuration of Java, the real egg hurts. I can always be in the condition of Microsoft Father all do well under the conditions of clothes to Zhang Hand mouth life, spoiled accustomed to.
However, Python does this is very good, go directly to the official website to download the corresponding installation program, learning to use 3.x, after all, the new language will have new features.
: https://www.python.org/downloads/
Then, after installation, open the command line and enter Python:
The instructions are in place.
The following >>> represents the interactive environment into Python, input: print (' Hello World ')
Congratulations, you have written the first Python program.
Hurry up and update your resume: Learn about Python ...
From 0 to run a Hello world, in addition to JavaScript, Python should be the most convenient. Goodwill +1
Step2:python file Run
Can not always later on the black box to write a Python program, this can still climb to 1024 small pictures?
That's a good question.
We write the code into a file and run it in this environment. This is the right way to go, as we write an HTML page, using a browser to open such a routine.
We create the lesson.py file under the D-Disk Python folder (any. py file is created anywhere in any folder)
As you can see, the Python file has the extension. py, that's right, the butthole, too open, coincides with our intention to crawl 1024 small images.
Next, we navigate to the folder where you run the file and enter the Python lesson.py
Step3:ide
Then write the program can not take a text editor to write it, smart tips how to do? What about personality fonts? What if I debug a bug?
Of course, to find a competent IDE.
A lot of people recommend pycharm, I searched a bit:
JetBrains This bunker company, I admire this company very much, developed n many good software/ide, but in their software operability, and vs still is not the same.
I had a simple try and came back to find the Microsoft Dad.
Sure enough, the latest VS2017 support for Python development. VS2013 and VS2015 Installing the Python tool can also: Https://github.com/Microsoft/PTVS
Installation complete, open vs is like this (VS2013):
Create an App
Run
Try a breakpoint to debug a bit:
Everything is familiar to the taste.
OK, that's it for today.
Getting Started with Python (i)