This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
import hashlib | |
import sys | |
if __name__ == '__main__': | |
i = bytes(sys.argv[1],'utf8') | |
k = hashlib.md5(i).hexdigest() | |
print(k) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name=f action=s> | |
<input type=text name=wd id=kw size=42 maxlength=100> | |
<input type=submit value=百度一下 id=sb> | |
<div id=sug onselectstart="return false"> | |
</div> | |
<span id=hp> | |
<a href=/gaoji/preferences.html>设置</a> | |
<br> | |
<a href=/gaoji/advanced.html>高级</a> | |
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8-*- | |
import os,sys | |
filename = sys.argv[1] | |
openfile = open(filename) | |
condition = str(sys.argv[2]) | |
for i in open(filename): | |
i=i.strip() | |
data = i.split('|')[2] | |
if condition == data: | |
print i.split('|')[5] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8-*- | |
from __future__ import with_statement | |
import os,sys | |
def find_condition(filename,condition): | |
with open(filename) as f: | |
for i in f: | |
i = i.strip() | |
data = i.split('|') | |
if condition == data[2]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8-*- | |
from __future__ import with_statement | |
import sys | |
def sortu(filename): | |
with open(filename) as f: | |
x = open(targetfile,"w") | |
for j in list(set([i.strip() for i in f])) : | |
print >> x,j | |
x.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import os,sys | |
filename=sys.argv[1] | |
openfile=open(filename) | |
for i in openfile.readlines(): | |
b = re.sub(r"<.*?>","",i) | |
print b | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os,sys | |
import re | |
from urllib2 import build_opener | |
import random | |
def visit_page(fid,page_type="fid"): | |
a_link="http://bbs.ngacn.cc/thread.php?%s=%s" %(page_type,fid) | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
usage () { | |
echo "usage: $0" 1>&2 | |
exit 2 | |
} | |
if [ $# -lt 1 ] ; then | |
usage | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
BEGIN{ | |
FS="\t" | |
OFS="," | |
} | |
{ | |
Product_Type=$7; | |
App_name=$3; | |
Customer_mount=$8; | |
split($10,date_array,"/"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RequestHandler(web.RequestHandler): | |
def __init__(self, application, request, status_code=None): | |
web.RequestHandler.__init__(self, application, request) | |
if status_code: self.set_status(status_code) | |
def get_error_html(self, status_code, **kwargs): | |
if status_code == 404: | |
return self.render_string('404.html') | |
elif status_code == 405: | |
return self.render_string('servererror.html') |
OlderNewer