What is an exceptionAn exception is a signal that an error occurs while the program is runningThere are two types of errors1. Syntax errorPychram can check out the errorsif def test:pass2. Logic ErrorPycharm cannot check for errorsnum =
The Python access site can be--urllib modules with standard modules (omitted here), and requests (installation-PIP install requests) modules, requests modules are encapsulated on a urllib basis, More powerful than Urllib module, easy to useImport
ListFirst define a listDeclaration ListList name =[value 1, value 2]list=[1,2,3,4,5]This is a list with five elements in the list (1,2,3,4,5)Show List ListingPrint ListOutput--[1,2,3,4,5]The subscript for the list starts at 0.Subscript = Length of
Class Car (object): # model, template def __init__ (self, Color, window): # constructor, the class executes it at initialization time, the order does not matter, can be written at the bottom # If your class is going to pass some
#!/bin/pythonImport Paramiko Installing the remote moduleHost= ' 192.168.4.254 ' requires remote hostSSH = Paramiko. Sshclient ()Ssh.set_missing_host_key_policy (Paramiko. Autoaddpolicy ()) automatically resolves the steps to enter yes for the first
Open the file in the same directory:Data=open (' Test ', encoding= ' utf-8 '). Read ()Print (data)F=open (' Test ', ' R ', encoding= ' utf-8 ') assigned to F is a file memory object, a file handle.The handle contains the file name, character set,
The first official explanation S.index (sub[, start[, end]), int raise is not found. S.find (sub[, start[, end]), int in are found, is contained within S[start:end]. Optional and in slice notation. -1 on
# signature in order to prevent cheating# 1. User device number MD5 encrypted once# 2. Re-fetch the first 10 bits after encryption# 3. Add salt and give him another MD5.# 4. Generate a StringFrom Hashlib import MD5Class Getsign (object): Slat = '
Class My (object): def __init__ (self, Name, skill): Self.name = Name Self.skill = Skill Self.cry () Def cry (self): # instance method, which must be instantiated before it can be called Print ('%s ' is crying ... '
Python installation
Download python
Configuring Environment variables
Computer--Properties--Advanced settings--environment variable--path--add Python.exe address
Enter Python in cmd to verify the configuration is
Usually when we are processing data, some data types are not what we want to do?One, data type conversion: the type to convert (data)
To convert num01 to integers: Int (num01)
To convert num01 to floating point: float (NUM01)
To
Python 12306 train ticket grabbing script, python12306
The example in this article shares the code for getting a train ticket from Python 12306 for your reference. The details are as follows:
#-*-Coding: UTF-8-*-from splinter. browser import
Python Flask basic tutorial sample code, pythonflask
This article focuses on the basic tutorial of Python Flask, which is described as follows.
Installation:pip install flaskYou can.
A simple Flask
From flask import Flask # import Flaskapp = Flask (_
Python implements Binary Search Tree instance code and python Binary Tree instance
This article focuses on the implementation of Binary Search Tree in python. The specific introduction and implementation are as follows.
1. Binary Search Tree
Detailed description of Python's CGIHTTPServer interaction implementation,Introduction
For backend server developers, sometimes some of their services need to be directly exposed to PM or other RD users. In this case, a web service needs to be set
Resolve the failure solution of the django database migrate, djangomigrate
Django is a web framework with MVC Architecture, where the database is "Module ". Using this framework, we can complete all database operations without having to write an SQL
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