Django (6. CreateView of common views)

Before Django (3. ListView view of common views) In, we mentioned that there are five common views. To add such an operation, we will use the CreateView view. The table also mentioned that using CreateView requires both Model and Form. Let's take a look at Form first. There are two main types of forms: Form (data should be verified manually, ...

Added by Qbasicboy on Sat, 05 Feb 2022 08:19:18 +0200

How to draw snowflakes with OpenGL's point sprite?

After watching the Winter Olympics, we know that Altay is not only the "snow capital" of China, but also the "origin of human skiing". Whether this statement is true or not, let alone, Altay's snow is really beautiful. There is a promotional film for the Winter Olympic Games, which tells the story of the Winter Olympic Games ...

Added by RootKit on Sat, 05 Feb 2022 06:53:04 +0200

Numpy quick start - Introduction to array (creation of array + basic operation of array)

explain This article will not introduce all array functions and will not explain all parameters. For details, please refer to the official documents.Parameters with square brackets [] can be omitted.The output of each small piece of code is written in the comments below. 1, Array creation 1.1 create an array using existing data function ...

Added by RobNewYork on Sat, 05 Feb 2022 06:45:13 +0200

Python basic learning

catalogue Exception - exception mechanism Brief description of Python exception handling mechanism try...except... Multiple structures included try... An except ion structure try... Multiple except structures try...except...else structure try...except...finally structure return statement and exception handling Summary of common excep ...

Added by snteran on Sat, 05 Feb 2022 05:41:21 +0200

Process of machine learning

2.1 introduction to machine learning process 2.1.1 overall process of machine learning Next, the implementation process of "supervised learning", which is the most widely used of three types of machine learning methods, is described. The implementation process of supervised learning can be summarized into the following steps: c ...

Added by Dan400007 on Sat, 05 Feb 2022 05:40:47 +0200

Backtrader timer

use You can add a timer for the policy in the init or start method def add_timer(self, when, offset=datetime.timedelta(), repeat=datetime.timedelta(), weekdays=[], weekcarry=False, monthdays=[], monthcarry=True, allow=None, tzdata=None, cheat=False, ...

Added by laurajohn89 on Fri, 04 Feb 2022 15:15:43 +0200

CV4 simple human-computer interaction application based on mouse callback function and track color matching

Q: use the track bar to create a Paint application with adjustable color and brush radius? A mouse callback function Creating a mouse callback function has a specific format, which is the same everywhere. It is only different in function. Therefore, in the following code, our mouse callback function can do one thing - draw a circle where we ...

Added by manimoor on Fri, 04 Feb 2022 15:00:44 +0200

Python Basics - variables and data types

Before introducing Python variables and data types, we also need to understand the reserved words and identifiers in Python. Reserved words: some words are given special meanings in Python, and these words cannot be used when naming objects. # View reserved words in Python import keyword print(keyword.kwlist) # Reserved word list '''['F ...

Added by trystan on Fri, 04 Feb 2022 13:34:08 +0200

NumPy: high performance scientific computing & the basic package of data analysis

NumPy is not only the most used third-party library in Python, but also the basic library of data science such as SciPy and Pandas. The data structure it provides is "more advanced and efficient" than Python itself. It can be said that the data structure provided by NumPy is the basis of Python data analysis. In NumPy, we need to f ...

Added by ibechane on Fri, 04 Feb 2022 08:01:20 +0200

python data structure bubble selection insertion sorting algorithm

Sorting algorithm Sorting algorithm (English: Sorting algorithm) is an algorithm that can arrange a string of data in a specific order. Stability of sorting algorithm Stability: the stable sorting algorithm will maintain the relative order of records with equal key values. That is, if -- sorting algorithm is stable, when there are two reco ...

Added by codygoodman on Fri, 04 Feb 2022 07:03:53 +0200