Confirm the following in setting:Static_url = '/static/'Put the static directory under the app, create the static directory in the app, and then create the CSS, JS, image.To add a path to a static resource in HTML:{% load staticfiles%}Load the image
Differentiate by number of stored values
Scalar/Atomic Type
Number, string
Container type
list, tuple, dictionary
By Variable immutable distinction
Variable
List, dictionary
defInsert_sort (alist):#from the second position, that is, the element labeled 1 starts to insert forward forIinchRange (1, Len (alist)):#starting from the first element I, if it is less than the previous one, swap position forJinchRange
f = open ("A.txt", ' R ', encoding= "Utf-8")F.tell () where is the current cursorF.read () reads files, but can be read by byte and character1, when the mode is byte mode F.read (3) for reading 3 bytes2, when the mode is byte mode F.read (3) for
Import= Urllib.request.urlopen ('http://www.placekitten.com/g/500/600' = response.read () with open ('cat_500_600.jpg','WB ') as F: F.write (cat_img)Urlopen () in parentheses can be either a string or a request object, which is converted into a
Character encoding:Translate human characters into numbers that computers can recognizeCharacter encoding tableA table of correspondence between human characters and computer numbersASCII, GBK, Utf-8, UnicodeUnicode "encode (UTF8)" bytesBytes
Types of Python:
CPython
When we downloaded and installed Python 2.7 from the official Python website, we immediately got an official version of the interpreter: CPython. This interpreter was developed in C language, so called CPython.
Requirements:
Enter user name and password
Successful authentication, display welcome information
User Name 3 input error, exit the program
Password 3 input error, lock user name
Readme:
UserList.txt is the file
Summary for example the following:1) A variable with a "_" before it: a private variable. A variable with a "_" in front of it, but there is no real encapsulation hidden, the outside still can access to ask2) A variable with a "_" behind it, in
It's almost one months to learn python, now it's time to fill in the entry standard procedure Hello world! This is probably the entrance ceremony for learning all kinds of computer languages. Python is especially easy to write. As shown below:Print (
Learn C language We all know that variables to be defined before use, but Python does not have to define, can be used directly, this is not the most inverse of the place, the Chinese can be directly taken as the variable name, this is it subversion
Login module:
Whether we go to that site, often encountered such a situation, let us log on to this site, the flowchart is as follows:
Ideas:
1. When we login to the site, we will first enter the user name, this time, some websites will remind us
Python sequence type
Sequence: A character, list, tuple all sequences support an iterative sequence that represents an ordered set of objects indexed as nonnegative integers the and metacharacters group belongs to an immutable sequence,
Origin:
Video download, resolution to a website, found that its video ID is encrypted with AES, using this library.To decrypt a very simple JS code:
T.video = CryptoJS.AES.decrypt (T.video, Secret). toString (CryptoJS.enc.Utf8);
Originally thought
First, define a class
Class Dog: # defines class def __init__ (self, name): # Constructor, constructor method = = Initialization method Self.name = name # D.name = attribute of the name class/member variable def say_hi (self): #
1, what is the three-mesh operation: (boolean expression? value 0: value 1;)
5>3?alert (' 5 large '): Alert (' 3 large ');
i.e. if (5>3) {alert (' 5 large ')}else{alert (' 3 large ')};
Note: The difference between the three mesh
A very simple example:1 for in range (0, 2): #0 to 10 is the Loop range, 2 is the loop step 2 print(" ", I)Use the For loop to refine the previous example:Age_konishi = 23 forIinchRange (3):#The default step is 1guess_age = int (input
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service