current position:Home>Python learning process and bug
Python learning process and bug
2022-02-01 20:58:07 【Pikachu who knows Baidu】
「 Time is not negative , Create constantly , This article is participating in 2021 Year end summary essay contest 」
I learned... This year python All those things that you're looking for ?
- Flask frame (bug)
- python Third party Library requests And internal library urllib
- Scrapy The crawler frame
- Django frame
Flask Summary of
Flask It's a lightweight customizable framework , Use Python Language writing , More flexible than other similar frameworks 、 Light 、 Safe and easy to use ......... Keep your code simple and easy to extend ,Flask The main feature of the framework is that the core structure is relatively simple , But it has strong expansibility and compatibility , Programmers can use Python Language quickly realizes a website or Web service .
This is a Flask An introduction to the , Wrote for a while Flask Found it really easy to build , And the code is more convenient , There is a problem when writing the project package , But it's not Flask Packing problem , But there are... Inside the code when packaging PaddlePaddle Third party Library of the framework , About it bug, I have to mention .
The packaged third-party library is Pyinstaller, The order is pyinstall -F app.py, It should be noted that app.py There is a configuration file equivalent to app.spec, Some configuration file paths before packaging can be written to . But no matter what you write, the final package will generate two folders ,build and dist, Many frames are packaged in this style , Look at it anyway dist Of the contents of ,dist Medium app.exe It's an executive document , But the default is naked exe file , To run, you have to put the template file , Copy static resource files to dist Under folder .
Copy code
The emergence of bug:
Double-click to open exe, Ten minutes later, the error message flashes .
Solution : Open the directory folder , Find the box of the directory , Add... To the front “cmd ” Enter and jump to the command line , On the command line app.exe. You can see the error message .
Copy code
This mistake is really a bit outrageous
The solution is also a simple batch , But I entered a misunderstanding , I wanted to pack and share , So I thought I was missing some files from my computer , Started to reconfigure python And reinstalled all third-party libraries , Later, I met a freshman here , What cannot be solved so far Bug:
** The lack of `Microsoft Visual C++ 2015 build tools**
There are various solutions online , I try solutions almost every year , But in the end, it was fruitless , Whenever I forget this bug It always appears when . I installed. Microsoft Visual C++ 2015-2019、 One blogger mentioned the deletion ratio 13 Reinstall an updated version of 、 Download some provided by the boss 2015-2019 My mini bag , All tried , But every time you install paddlex This problem occurs all the time , As for how I installed it last time , I'll fill it with saliva and it's done , I didn't care , Because I don't know how to install paddlex There will be this mistake
Copy code
As for the above bug Solutions for , I can only copy previously successfully installed paddlex==1.3.7 The bag of . There is also a solution with a high probability , Change the computer , The performance of thin and light book is really not very good ,python When I was engaged in deep learning, my computer was dying , So far, except in paddlepaddle Run outside the model on your server , Has completely given up treatment
python Third party Library requests And internal library urllib
These are used to crawl simple web pages and use more crawler third-party libraries , Some of the more difficult may be to use Scrapy Frame to crawl or simulate the browser selenium Automated crawling . Basically some simple videos , Audio , picture , Both text libraries can be used to solve , But video still needs some technology , It's not about looking for videos online , Novices can learn , If a novice sees this about reptiles , Or take my advice : Most of the resources of novel websites are crawled , So many novel websites have almost no anti climbing technology , The best way to get started is to climb novels , The picture is basically the same , But there are few picture websites , Those websites without anti crawling technology are estimated to have collapsed . Audio is mainly troublesome to find , Needless to say, video search and integration are more troublesome , But it's not troublesome to learn to waste , There are online tutorials , But it is suggested to get familiar with the pictures of the novel before audio and video .
Say more about requests and urllib The difference between! ,urllib The inner library is obvious , You can use it without downloading the package , But the disadvantage is that there are often text coding problems ,requests All aspects are good , Very few decoding methods are needed , Want text .text, want byte Just .content It is very convenient , After all, it's a third-party library , If there were no better advantages than neku, it would have been remove 了 .
Copy code
About Scrapy The crawler frame
Fast track Scrapy Because the constitution of a competition mentioned this framework , I went to study , As for its advantages : modularization , If you fail, you can request again . technological process : According to their own understanding is their own perception : Some reptiles are used in urllib,request After waiting for the third-party library , It is obvious that there are various ways of writing these crawlers, from information query to information capture , And you have to use all kinds of request headers , Anti theft chain or something to avoid being crawled back ,Scrapy Formed a system and a set of processes , Make the crawling process more systematic . The flow chart is as follows , For review .
Copy code
Django frame
A little too much , Just a little mention here , This framework is what I use to write the front and back ends ,Django Development is really convenient , especially ORM Docking database , This price comparison is really easy , Database migration has tasted the sweetness , But there are few online resources , It's time to reflect , Why? Django For so long, only when people mention python When the frame is, someone remembers , The mentioned web Back end , All people think of is SSM,Springboot,python Its advantage is to do data analysis and processing ,Java Mainly engaged in the back-end , So mention web Many people think of them for the first time .
Copy code
copyright notice
author[Pikachu who knows Baidu],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/02/202202012058030642.html
The sidebar is recommended
- Python data analysis - linear regression selection fund
- How to make a python SDK and upload and download private servers
- Python from 0 to 1 (day 20) - basic concepts of Python dictionary
- Django -- closure decorator regular expression
- Implementation of home page and back end of Vue + Django tourism network project
- Easy to use scaffold in Python
- [Python actual combat sharing] I wrote a GIF generation tool, which is really TM simple (Douluo continent, did you see it?)
- [Python] function decorators and common decorators
- Explain the python streamlit framework in detail, which is used to build a beautiful data visualization web app, and practice making a garbage classification app
- Construction of the first Django project
guess what you like
-
Python crawler actual combat, pyecharts module, python realizes the visualization of river review data
-
Python series -- web crawler
-
Plotly + pandas + sklearn: shoot the first shot of kaggle
-
How to learn Python systematically?
-
Analysis on several implementations of Python crawler data De duplication
-
leetcode 1616. Split Two Strings to Make Palindrome (python)
-
Python Matplotlib drawing violin diagram
-
Python crawls a large number of beautiful pictures with 10 lines of code
-
[tool] integrated use of firebase push function in Python project
-
How to use Python to statistically analyze access logs?
Random recommended
- How IOS developers learn Python Programming 22 - Supplement 1
- Python can meet any API you need
- Python 3 process control statement
- The 20th of 120 Python crawlers, 1637. All the way business opportunity network joined in data collection
- Datetime of pandas time series preamble
- How to send payslips in Python
- [Python] closure and scope
- Application of Python Matplotlib color
- leetcode 1627. Graph Connectivity With Threshold (python)
- Python thread 08 uses queues to transform the transfer scenario
- Python: simple single player strange game (text)
- Daily python, chapter 27, Django template
- TCP / UDP communication based on Python socket
- Use of pandas timestamp index
- leetcode 148. Sort List(python)
- Confucius old book network data collection, take one anti three learning crawler, python crawler 120 cases, the 21st case
- [HTB] cap (datagram analysis, setuid capability: Python)
- How IOS developers learn Python Programming 23 - Supplement 2
- How to automatically identify n + 1 queries in Django applications (2)?
- Data analysis starts from scratch. Pandas reads HTML pages + data processing and analysis
- 1313. Unzip the coding list (Java / C / C + + / Python / go / trust)
- Python Office - Python edit word
- Collect it quickly so that you can use the 30 Python tips for taking off
- Strange Python strip
- Python crawler actual combat, pyecharts module, python realizes China Metro data visualization
- DOM breakpoint of Python crawler reverse
- Django admin custom field stores links in the database after uploading files to the cloud
- Who has powder? Just climb who! If he has too much powder, climb him! Python multi-threaded collection of 260000 + fan data
- Python Matplotlib drawing streamline diagram
- The game comprehensively "invades" life: Python releases the "cool run +" plan!
- Python crawler notes: use proxy to prevent local IP from being blocked
- Python batch PPT to picture, PDF to picture, word to picture script
- Advanced face detection: use Dlib, opencv and python to detect face markers
- "Python 3 web crawler development practice (Second Edition)" is finally here!!!!
- Python and Bloom filters
- Python - singleton pattern of software design pattern
- Lazy listening network, audio novel category data collection, multi-threaded fast mining cases, 23 of 120 Python crawlers
- Troubleshooting ideas and summary of Django connecting redis cluster
- Python interface automation test framework (tools) -- interface test tool requests
- Implementation of Morse cipher translator using Python program