This file contains hidden or 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 | |
| # author: haofly | |
| # | |
| # fun: 生成随机姓名、随机电话号码、随机字符串,目前仅支持Python2 | |
| import random | |
| def generateName(first_len=0, last_len=0): | |
| surnames = [ |
This file contains hidden or 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
| def search_file(search_dir='/',file=None): | |
| if file is None: | |
| result = search_dir | |
| return result | |
| else: | |
| for i in os.listdir(search_dir): | |
| path_file = os.path.join(search_dir,i) | |
| if os.path.isfile(path_file): | |
| if i == file: | |
| result = path_file |
This file contains hidden or 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
| def search_index_file(search_dir=None,index=None): | |
| if search_dir is None: | |
| search_dir = '/' | |
| print(search_dir) | |
| result = search_dir | |
| if index is not None: | |
| index = int(index) | |
| dirs = sorted(os.listdir(search_dir))[index] | |
| path_file = os.path.join(search_dir,dirs) |
This file contains hidden or 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
| from time import time | |
| t = time() | |
| lista = [1,2,3,4,5,6,7,8,9,10] | |
| listb =[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.01] | |
| len1=len(lista) | |
| len2=len(listb) | |
| for i in xrange (1000000): | |
| for a in xrange(len1): | |
| temp=lista[a] | |
| for b in xrange(len2): |
This file contains hidden or 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
| timesss=["20160504120000", "20160504130000", "20160504140000", "20160504150000", "20160504160000", "20160504170000", "20160504180000", "20160504190000", "20160504200000", "20160504210000", "20160504220000", "20160504230000", "20160505000000", "20160505010000", "20160505020000", "20160505030000", "20160505040000", "20160505050000", "20160505060000", "20160505070000", "20160505080000", "20160505090000", "20160505100000", "20160505110000", "20160505120000", "20160505130000", "20160505140000", "20160505150000", "20160505160000", "20160505170000", "20160505180000", "20160505190000", "20160505200000", "20160505210000", "20160505220000", "20160505230000", "20160506000000", "20160506010000", "20160506020000", "20160506030000", "20160506040000", "20160506050000", "20160506060000", "20160506070000", "20160506080000", "20160506090000", "20160506100000", "20160506110000", "20160506120000", "20160506130000", "20160506140000", "20160506150000", "20160506160000", "20160506170000", "20160506180000", "20160506190000", "201605 |
This file contains hidden or 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 os,sys | |
| from main import app,db | |
| # app is flask: app = Flask(__name__) | |
| def runServer(debug=True): | |
| print '*'*20 | |
| try: | |
| port = int(sys.argv[1]) | |
| except Exception,e: | |
| print 'error:',e | |
| port = 64320 |
This file contains hidden or 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
| /* ------ 注释模板 --- start ------ */ | |
| /* ------ 注释模板 --- end ------ */ | |
| @noteTemplate : ' ------ 注释模板 --- start ------ '; | |
| .init{margin:0;padding:0;} | |
| .fl{float:left;} |
This file contains hidden or 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
| /** | |
| * | |
| *----------Dragon be here!----------/ | |
| * ┏┓ ┏┓ | |
| * ┏┛┻━━━┛┻┓ | |
| * ┃ ┃ | |
| * ┃ ━ ┃ | |
| * ┃ ┳┛ ┗┳ ┃ | |
| * ┃ ┃ | |
| * ┃ ┻ ┃ |
This file contains hidden or 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
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>无标题文档</title> |
This file contains hidden or 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: utf8 -*- | |
| ''' | |
| Created on 2013-12-19 | |
| @author: good-temper | |
| https://www.oschina.net/code/snippet_1183145_27432 | |
| ''' | |
| import urllib2 | |
| import urllib |