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
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
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,
# 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 ... '
DjangoPython's web framework has a variety of Django, Tornado, Flask and so on, Django compared with other web frameworks its advantages: chatty, the framework itself integrates ORM, model binding, template engine, cache, session and many other
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
%d indicates that the digit number is followed by the placeholder%s indicates that a string string is followed by a placeholderSyntax format for python scripts:* *python First principle, Code mandatory indentation (4 spaces recommended),: (colon)
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
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
12. multithreading: Threading, daemon thread, and multithreading threadingThreads and processes:
For a process, a thread is like a worker in the factory. Resources are allocated to the factory, and the worker will process them again.
A thread is the
Python learning path (1): python learning pathPython learning path (1)
Python 3.6I. coding problems
The part that involves Chinese requires UTF-8 encoding. Use PyCharm: File-> Settings-> Editor-> File Encoding to select UTF-8 Encoding in
Sesame HTTP: Installation of pyspider and sesame httppyspider
Pyspider is a powerful web crawler framework compiled by binux, which has powerful WebUI, Script Editor, task monitor, Project Manager, and result processor. It also supports multiple
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