Compression package password cracking sample sharing (similar code hack)

Yesterday turned the hard drive, found a good thing, but I added the password oneself do not remember. Tried a few common didn't try to come out, so wrote a little foot originally for me to try. Oh, still really to solve out. Python script content

Use BeautifulSoup crawler to get Baidu search results title and URL Example

If you are familiar with Java's jsoup package, it should be easy to get started with Python's BeautifulSoup library. The code is as follows: #coding: Utf-8Import SysImport UrllibImport Urllib2From BeautifulSoup import BeautifulSoup

Python practice program Bulk modifying file names

The code is as follows: # Encoding:utf-8 ### filenames such as:# down, mp3.##Import Os,re Fs=os.listdir (' XB ')For f in FS:##### #方法一: partition get useless characters#1. Divide the file name with a ' [' character into 3 parts#ls =f.partition ('

How Python conditions and loops are used

Several basic statements (Print,import, assignment statements) have been described earlier, so let's introduce conditional statements and loop statements. I. Print and import for more information 1.1 Using a comma output A. Printing multiple

Python list uses a sample list to find consecutive numbers

There is a demand on the line, formatted, from a bunch of s1,s100-s199 to find continuous service and formatted display, such as: Demon: s106-109,s123,s125 Imperial Sword: s106-109,s123,s125 The code is as follows: #!/usr/bin/env

Python implementation code line count sample sharing

The code is as follows: #!/usr/bin/python '''File:count.pyAuthor:mikeE-mail:mike_zhang@live.com'''Import Sys,os Extens = [". C", ". cpp", ". hpp", ". H")Linescount = 0Filescount = 0 def funcount (dirName):Global Extens,linescount,filescountFor Root,

Example of a python script called directly by Java

The code is as follows: Import Java.io.BufferedReader;Import Java.io.InputStreamReader; public class Main {public static void Main (string[] args) {try {System.out.println ("Start");Process PR = runtime.getruntime (). EXEC ("Python test.py");

Python Indentation Difference Analysis

Look closely at the following two Python programs, the code is identical, but the results are different because the last line return indentation The code is as follows: def powersum (Power, *args): "Return the sum of each argument raised to

Python uses RABBITMQ to implement a web crawler example

Writing tasks.py The code is as follows: From celery import celeryFrom tornado.httpclient import httpclientApp = celery (' tasks ')App.config_from_object (' Celeryconfig ')@app. Taskdef get_html (URL):Http_client = HTTPClient ()TryResponse =

How to use the Python parsing module (configparser)

The test.conf content of the test configuration file is as follows: The code is as follows: [First]W = 2V:3C =11-3 [Second] Sw=4Test:hello There are two areas in the test configuration file, first and second, and some spaces and line breaks are

Write an ASP in Python with a detailed explanation

First, the rehabilitation of the ASPThink of ASP Many people will say "ASP language is very egg ache, can't object-oriented, function single, a lot of things can not achieve" and so on. The above is wrong, one of the ASP is not a language is

A count sort instance of Python algorithm learning

A count sort instance of Python algorithm learning The code is as follows: #-*-Coding:utf-8-*- def _counting_sort (A, B, K):"" "Count sort, pseudo code as follows:Counting-sort (A, B, K)1 for i←0 to K//Initialize the value of the store2 Do c[i]←03

Python bulk modified file suffix sample code share

The ipad goodreader to JS file support is not very good, although can read it but always can't quit, back to the GoodReader main interface, so I need to batch JS file into plain text. For this purpose, I have made the following small application:

Python Get embarrassing Picture code example

The code is as follows: From Sgmllib import SgmlparserImport Urllib2 Class SGM (Sgmlparser):def reset (self):Sgmlparser.reset (self)Self.srcs=[]Self. Istrue=true def start_div (Self,artts):For k,v in Artts:If v== "Author":Self. Istrue=falsedef

Python gets Beautifulphoto Random example of a picture code

Beautiful photo!: http://www.beautifulphoto.net/ The code is as follows: Import Urllib2Import re _random_url = R ' http://www.beautifulphoto.net/plugin/RndArticle/'_img_patt = Re.compile (R ') def random (Timeout=3, More=false):Tryhtml =

Python simulation login Baidu Paste bar (Baidu Bar login) instance

The code is as follows: #-*-Coding:utf-8-*-# python3.3.3 Import Sys,time,re,urllib.parse,urllib.request,http.cookiejar,random,math,os.path,hashlib,json,binascii, Threading "" "Cookie" "" "Cookie=http.cookiejar.lwpcookiejar ()#cookie. Load ('

Python read file line by sample code sharing

The code is as follows: Import OS # # for Os.path.isfile () def dealline (line):Print (line) # # I can do a lot of things for line Def getfilename ():return input (' please input ' file name (input exit () for exit): '). Strip () Class more: # #

Python file Comparison sample sharing

The code is as follows: # Compare two strings, if different returns the first one not the same position# If the same returns 0def cmpstr (str1, str2):Col = 0For C1, C2 in Zip (str1, str2):if C1 = = C2:Col + = 1Continueelse:Break#判断是怎样退出循环的, there

Python connection MySQL Database example (do delete and change operation)

First, the relevant code Database Configuration Class mysqldbconn.py The code is as follows: #encoding =utf-8'''Created on 2012-11-12Mysql Conn Connection Class'''Import MySQLdbClass Dbconn:conn = None#建立和数据库系统的连接def connect (self):Self.conn =

A simple example of using the Mechanize library in Python

The code is as follows: #!/usr/bin/env/python#coding =utf-8Import MechanizeImport Cookielib # Cookie JarCJ = Cookielib. Lwpcookiejar () # Browserbr = Mechanize. Browser ()Br.set_cookiejar (CJ) # Browser OptionsBR.SET_HANDLE_EQUIV

Total Pages: 4013 1 .... 3226 3227 3228 3229 3230 .... 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.