python magic function

preface This blog mainly introduces Python's magic functions. In depth learning or python programming, python class writing will be more or less involved, including Python magic functions. For example, when writing a data loading generator, it may be involved__ next__,__ iter__ Function. Of course, the generator may be done with the keywo ...

Posted by lizard on Mon, 29 Nov 2021 20:15:32 -0800

Knowledge summary of open source web framework django

Knowledge summary of open source web framework django (10) Asynchronous scheme Celery Producer consumer design model reflection: What's wrong with the following two lines of code? CCP().send_template_sms(mobile, [sms_code, 5], 1) return JsonResponse({'code': 0,'errmsg': 'ok'}) Question: Our code is executed synchronously from to ...

Posted by fatalcure on Mon, 29 Nov 2021 17:06:26 -0800

Python development - Django model layer

Django model layer Today, let's talk about Django's model layer. Django provides an abstract model ("models") layer to build and manipulate the data of Web applications. 1. The concept of model: 1. Model introduction The model can accurately and uniquely describe the data. Contains important fields and behaviors for stored da ...

Posted by FutonGuy on Mon, 29 Nov 2021 15:16:27 -0800

python batch ppt to picture, pdf to picture, word to picture script

prefaceOne day, when we were in the editing background, we said that every time we upload ppt, pdf and word, we should export the pictures of each file first, and then upload them one by one (png is used as preview, ppt, pdf and word source files cannot be downloaded directly). We said that the efficiency is too low. We asked if there is any wa ...

Posted by shadiadi on Mon, 29 Nov 2021 14:16:34 -0800

Solve ImportError: No module named rospkg by specifying a python interpreter

When I first wrote a blog, there were too many solutions to similar problems on CSDN, but they couldn't solve my problem. This time, it was not easy to solve my problem. I hope to record this solution and help students with similar problems. Maybe it's written incorrectly, maybe it's written so that people don't understand it. In fact, the p ...

Posted by Major Tom on Mon, 29 Nov 2021 13:50:18 -0800

Automatic driving based on Unity

1. Process Software download and installationdata acquisitionCustom datasetModel buildingmodel trainingtestsummaryfollow-up Download address of this project GitHub 1. Software download and installation 1.Download address: https://github.com/udacity/self-driving-car-sim 2. After entering the link, you can choose your own platform to download ...

Posted by Plex on Mon, 29 Nov 2021 07:47:16 -0800

Python process and thread nanny teaching, a machine with multiple hands

How important are process threads? At the beginning of learning Python, you may not feel it, because the code you write can be executed from top to bottom, but in fact, it is very elementary. In order to make full use of the computer configuration to speed up the program progress, we often use multi process and multi thread when actually develo ...

Posted by jonathandg on Mon, 29 Nov 2021 03:07:19 -0800

Detailed explanation 3_ Recursion_ Anonymous function - function - python

1. Recursion The programming technique of a program calling itself is called recursion. As an algorithm, recursion is widely used in programming languages. A procedure or function has direct or indirect meaning in its definition or description A method of indirectly calling itself, which usually transforms a large and complex problem la ...

Posted by cidesign on Sun, 28 Nov 2021 23:31:34 -0800

[Python hundred days basic series] Day47 - DBC folding menu and tips

Video Explanation: 1, DBC code template # 1. Import Dash import dash import dash_bootstrap_components as dbc # 2. Create a dash instance object app = dash.Dash(external_stylesheets=[dbc.themes.BOOTSTRAP]) # 3. Add DBC component badge = dbc.Button( ["notice",dbc.Badge("4", color="light", text_color="primary", className="ms-1"),], ...

Posted by babybird11 on Sun, 28 Nov 2021 22:33:36 -0800

Python exercises (continuously updated)

Example 001: digital combination Title: there are four numbers: 1, 2, 3 and 4. How many three digits that are different from each other and have no duplicate numbers? How much is each? The program analysis traverses all possibilities. Please shave off the duplicates. num = 0 for a in range(1, 5): for b in range(1, 5): for c in ra ...

Posted by Infinitus 8 on Sun, 28 Nov 2021 17:21:22 -0800