Python Grammar Basics

# Direction of variables a = "abc" b = a a = "def" print(a) print(b) def abc print(10/3) # The result is a decimal print(10//3) #The result is an integer print(10%3) # Remainder 3.3333333333333335 3 1 #Summary #Python supports a variety of data types. Within a computer, any data can be viewed as an object, and variables are used in prog ...

Posted by jumphopper on Fri, 10 May 2019 12:10:05 +0200

Integration of Django+Django-Celery+Celery

This article is mainly due to the plan to use django to write a planned task, which can rotate the name of the staff on duty or execute scripts on time and other functions. After Baidu has countless pits, it can finally make use of this set of things to deploy. My English is not good, English is good or people who want to learn ...

Posted by tinkertron on Fri, 10 May 2019 11:12:03 +0200

Data Type, Character Coding, File Processing

1. Data type:Digital (Integer, Long Integer, Floating Point, Complex)String: Introducing bytes when introducing character encodingListYuan ZuDictionarySet 2. integer intFunction: Integer numbers such as grade/grade/ID number are correlatedDefinition: age=10. Essentially age=int(10)   The decimal system is converted to... Binary system Print ( ...

Posted by non_zero on Fri, 10 May 2019 10:54:03 +0200

python SMTP mail delivery

This example uses the python 2.7 environment, and python 3 should operate similarly. Two packages, smtplib and email, are required. Send text type mail Here's an example of sending text messages (using SMTP from NetEase 163): # -*- coding: UTF-8 -*- import smtplib from email.mime.text import MIMEText from email.header import Header from email. ...

Posted by PlasmaDragon on Fri, 10 May 2019 09:20:03 +0200

python obfuscation compilation

Step 1 Programming Take the Queen N problem on github as an example """The n queens puzzle. https://github.com/sol-prog/N-Queens-Puzzle/blob/master/nqueens.py """ __all__ = [] class NQueens: """Generate all valid solutions for the n queens puzzle""" def __init__(self, size): # Store the puzzle (problem) size ...

Posted by vishi83 on Fri, 10 May 2019 01:02:03 +0200

Implementation of gradient descent algorithm for machine learning

According to Wu Enda's machine learning video, the gradient descent algorithm is learned and implemented by code. The purpose of gradient descent algorithm is to find the value of theta, which minimizes the cost function, and to attach relevant formulas. The above figure is the definition of hypothetical function and cost f ...

Posted by daanoz on Thu, 09 May 2019 11:18:05 +0200

Python Notes for Files & Exceptions

Python Notes for Files & Exceptions Article directory Python Notes for Files & Exceptions 1. Read data from files 1.1 Read the entire file 1.2 File Path 1.3 read line by line 1.4 Create a list of all lines of a file 1.5 Contents of User Files 1.6 Processing large files 2 Write to file 2.1 Write empty files 2.2 W ...

Posted by ebgames56 on Wed, 08 May 2019 22:54:03 +0200

Pthon Decorator Advancement

Catalog Decorator Advancement 1. Decorated functions have multiple parameters. 2. Decorated functions have return values 3. Embedding decorators in functions 4. Decorators summary Decorator Advancement As you already know from the previous article, if you still don't under ...

Posted by bdeonline on Wed, 08 May 2019 21:45:02 +0200

python crawls through the free fiction Web

These days, my friends say they want to read e-books, but they can only read them on the Internet, but they can't download them to the local area. What can I do? I looked at several novel websites. You can only read them directly on the Internet. To download txt, you have to buy members for money, and you can't copy and paste them directly on t ...

Posted by ironman on Wed, 08 May 2019 19:27:03 +0200

Introduction to using pipenv

conda was used as a virtual environment management tool during development, but sometimes it is temporary and necessary.If you use conda create to create a new environment, it takes a lot of time, sometimes forgot to delete it, and finally a bunch of virtual environments in the system.After accidentally discovering pipenv, try it out and feel t ...

Posted by illushinz on Wed, 08 May 2019 17:36:02 +0200