The difficulties encountered:
1. python3.6 installation, it is necessary to remove the previous completely clean, the default installation directory is: C:\Users\ song \appdata\local\programs\python
2. Configuration variables There are two Python versions in the PATH environment variable, environment variables: add C:\Users\ song \appdata\local\programs\python\python36-32 in Path
Then PIP configuration: Path in, Environment add: C:\Users\ song \appdata\local\programs\python\python36-32\scripts
3. Open the command prompt in the current folder Shift + right click on PowerShell is, go to D disk D: Return to the previous level directory CD. There are two points after
4. Python does not have Chinese in computer name when doing Web server
5. Python In the background code:
Pip install Flask Download the framework from the command prompt
Written in Python
From flask import Flask #用框架搭环境
App = Flask (__name__)
@app. Route ('/') #装饰器对应一个url网址
Def home (): #一个方法
Return ' Songkang ' #返回值给网页
if __name__ = = ' __main__ ':
App.run (host= ' 0.0.0.0 ', port=80,debug=true) #域名, 80 ports
localhost Access in browser
5.1 Using Python code to extract data from a database and instill it in a Web page
6. Crawler Get wallpaper Environment installed BS4:PIP install BEAUTIFULSOUP4
7. Basic: Sum ([+ +]) add
Tuple tuples (All-in-all) immutable, fast
Array [+/-] Variable
Python 2 distinguishes long int float python3 not distinguished by int
Type (ss) to see what type of Help (sum) to see how to use
Python Web server and crawler acquisition