Test questions
If I need to embed a double quote in a string, what's the right thing to do? [Two methods]For:print("I\"m a girl")print(‘I\"m a girl‘)
Tips for using idle1.TAB CompleteAfter entering some code, pressing the TAB key, idle will
datetime and Date use similar1 Importdatetime2 Print(Datetime.datetime.today ())#current time, to milliseconds, datetime type 2018-01-23 21:55:43.7569483now = Datetime.datetime.now ()#as with today (), the datetime type4 Print(now)#2018-01-23 21:55:4
1. What is object-oriented programming?---previously used functions---class + objects2. What is a class and what is an object and what does it matter?Class:def function 1 ():Passdef function 2 ():Pass#obj is an object, an instantiated processobj =
The first thing to figure out is that the class is created by the Meta class. When the class class Foo:pass is defined (the class is also an object), the __init__ method of the type class or type derived class is executed, when Foo (): Executes the _
I. Common built-in properties
Common proprietary Properties
Description
Trigger Mode
__init__
construct initialization function
After creating an instance, when assigning values, after
1. JSON string is2, need to be introduced in advance, that is, import3. Convert list/dictionary to JSON data type: Json.dumps ()#json. Dumps (d) #把list \ Dictionary to JSON#json. Dumps (d,indent=8) #把list \ Dictionary into JSON, indent
#_*_ encoding:utf-8 _*_ImportJSONImportRequests#POST RequestPayload = {"Cindy":"Hello World", "python":"1078370383"}r= Requests.post ('Http://httpbin.org/post', Data=payload)Print(R.text)#output, data data transfer to form# {#"args": {},#"
Learning route Some places do not follow the order, some places forget not to write, after the opportunity will slowly fill up, projects, etc. I concluded will also upload, thank youQuery DirectoryOne, hardware 11, databaseSecond, Linux basic 12,
#_*_ encoding:utf-8 _*_ImportRequests#Request a blog home, no parameter GET requestR = Requests.get ('http://www.cnblogs.com/cindy-cindy/')Print(R.status_code)Print(R.text)#Search for content in the blog park, get requests with parametersPar =
Python uses matplotlib to fill in the code example of the specified area in the graph, pythonmatplotlib
The code in this article focuses on the usage of the fill_between () function in the Python extension library matplotlib. pyplot.
Import numpy
Python + pillow: simple example of drawing a matrix using a Gael circle, pythonpillow
This article mainly studies an example of using Python + pillow to draw a matrix Gael circle. The details are as follows.
A Gael circle is a commonly used method
Python allows you to customize the screenshot function and python screenshot function.
This example describes how to implement a screenshot function with a custom size in Python. We will share this with you for your reference. The details are as
Python Learning Website recommendation, python website recommendation
Site B is the best free Python learning website I have ever seen.
Dark Horse programmer-
Https://space.bilibili.com/37974444? Spm_id_from = 333.338.viewbox _ report.6 #/
Linux
Briefly describe the differences between Python2 and Python3, and briefly describe python2python3
The print () method is provided in both Python2 and Python3 to print information. However, the print between the two versions is slightly different.
It
[Python study notes, python Study Notes
The built-in Dictionary of Python is implemented using hash table. Here we just implement our own hash table to deepen our understanding of hash table and hash functions.
[Concept 1: Mapping )]
The dictionary
Python + matplotlib to plot scatter plots of different sizes and colors, pythonmatplotlib
Scatter Plot with different colors and sizes.
Demo result:
Implementation Code:
import numpy as npimport matplotlib.pyplot as pltimport matplotlib.cbook as
Create a basic process for Django. Create a process for DjangoDjango creation process
1. Create a project: django-admin startproject project name
2. Create an application: python manage. py startapp Application name
3. Activate the project: Modify
Eval functions and eval Functions
Eval
Function: Evaluate a string 'str' as a valid expression and return the calculation result.
Syntax: eval (source [, globals [, locals])-> value
Parameters:
Source: Code object returned by a Python
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