Python simple sign-in registration code

#-*-Coding:utf-8-*-Import Hashlib# define database (declaration dictionary)#注册登录的简单hash处理db={}def get_md5 (password):MD5=HASHLIB.MD5 ()#此处密码hash加密处理Md5.update (Password.encode (' Utf-8 '))Return Md5.hexdigest ()def register

Python Common port scan

From socket Import *Import SysHOST=SYS.ARGV[1]service={': ' FTP ', ' All ': ' Telnet ', ' + ': ' SMTP ', ' + ': ' DNS ', ' # ': ' TFTP ', ' $ ': ' HTTP ',' 135 ': ' RPC ', ' 137 ': ' NetBIOS ', ' 139 ': ' Samba ', ' 443 ': ' HTTPS ', ' no ': ' SOCKS

Python Verification Code

From PIL import Image, Imagedraw, Imagefont, ImageFilterImport Random# Random Letters:Def Rndchar ():Return Chr (Random.randint (65, 90))# Random Color 1:Def rndcolor ():Return (Random.randint, 255), Random.randint (255), Random.randint (64, 255))#

The Python operator

First, arithmetic arithmetic# !/usr/bin/python # -*-coding:utf-8-*-x=10y=5z=x+yz1=x-yz2=x*yz3=x/y Z4=x//y #取整z5=x**yZ6=x%yz6= (x//y) **y+x*yprint(z,z1,z2,z3,z4,z5,z6,z7)The results were 15 5 50 2.0 2 100000 0 82Second, the comparison operation# !/

The path to learning Python

Python interpreter:CPython is most commonly used, but is slightly slower than other interpreters, but the user does not perceivePyPy fast Speed interpreterJythonJython is a python interpreter running on the Java platform that compiles python code

Several common ways to install Python modules

Single File Copy method Copy the file directly to ... \lib\site-packages Module Package Installation Method File after decompression with setup.py, into the extract file, run: Python setup.py install Easy_install

Python Traversal folder

Method One: Using the functionos.walk()os.walk()will return ternary tuples(dirpath, dirnames, filenames)dirpath: Root Path (String)dirnames: All directory names under path (list)filenames: All non-directory file names under path (list)The directory

Python file operation: SYS module

1, sys.argvsys.argv accept parameters imported from the external import sysprint sys.argvif sys.argv[1] = = '--help ':p rint ' True ' print ' help () ' executed through the doc command line Python 04.py--help 2, standard input and output (1)

Python Learning notes-compiling and installing Python3.6.1 + IPython

Since the system already has 2.6 python, it is best not to modify the system version, using the compiled installationDownload Python3.6.1 Packagewget HTTPS://WWW.PYTHON.ORG/FTP/PYTHON/3.6.1/PYTHON-3.6.1.TAR.XZInstallation dependencies:Yum-y Install

Selenium+python Login Sina Weibo

Yesterday took Selenium's official website tutorial to browse again, English poor, see laborious, finally with the help of a dictionary general Understanding Selenium Webdriver (⊙﹏⊙)The paper came to the end of the light, I know this matter to

Python file operations

1 #author F2 3 ImportSys,time4 5 6f = open ("file","R", encoding="Utf-8")7 8 Print(F.tell ())9 Print(F.readline (). Rstrip ())Ten Print(F.read (5)) One Print(F.tell ()) A Print(F.read ()) - Print("Split Line". Center (50,"-")) - Print(F.readline ())#

Python Learning Decorator

Adorner Prelude 1Definition: The essence is a function, used to decorate other functions, is to add additional functions for other functionsPrinciple: 1, can not modify the modified function of the source code and call modeAdorner Prelude 2Import

10 recommendations for Black Hat articles

VLAN (Virtual Local area Network), which is built on the basis of Ethernet interaction technology, can divide the same physical network into multiple valn, or cross the physical network barrier, and divide users from different subnets into the same

Recommended course for drawing a chart

This article introduces you how to use Python to draw different charts based on Excel table data, very detailed, with the same needs of the small partners can refer to this article describes if you use Python summary of commonly used charts,

10 recommended articles for detailed documentation

Web. xml file in a detailed preface: The general use of Web.xml,web.xml in the website is mainly used for configuration, can be easily developed web engineering. Web. XML is primarily used to configure filter, Listener, servlet, etc. However, it is

Recommended 10 Display Form effects (favorites)

A few days ago on the Internet to find the information can be loaded into the entire form of the option Advant (see previous article), so that the implementation is very useful, multi-window display is also a lot of convenience. After adding the

Summary about Inlude attention Point

We all know that when using sequelize to connect queries between relational models (tables), we use Model/as to specify a connection query model that already has an associated relationship, or to directly specify a connection query model

A discussion on the usage example of filtering operation

This article mainly introduces you to the Python learning tips of the list of the derivation and filtering operation of the relevant information, the article introduced in very detailed, for everyone has a certain reference learning value, the need

10 Articles about Argparse recommendations

This article is mainly for you to explain the Python command-line parsing tool argparse usage, interested in the small partners can refer to the recent study of Pathon command-line parsing tool, Argparse, it is recommended in the Python standard

Summary of the Web application Framework Note Summary

There are many different Web frameworks under Python. Django is one of the most iconic players in the heavyweight class. Many successful websites and apps are based on Django. Django is an open-source Web application framework written by

Total Pages: 4013 1 .... 2954 2955 2956 2957 2958 .... 4013 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.