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
# Public Domain, i.e. feel free to copy/paste | |
# Considered a hack in Python 2 | |
import inspect | |
def caller_name(skip=2): | |
"""Get a name of a caller in the format module.class.method | |
`skip` specifies how many levels of stack to skip while getting caller | |
name. skip=1 means "who calls me", skip=2 "who calls my caller" etc. |
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
{ | |
"table":"dr_c_ugc", | |
"rows":[ | |
{ | |
"dp_crtbywyj": 60, | |
"dp_web": 778, | |
"DataChange_CreateTime": "2013-12-25 15:14:46", | |
"yj_weiyouji": 111, | |
"yj_weiyouji_app": 53, | |
"qa_askperson": 45, |
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/env python | |
#coding:utf-8 | |
""" | |
Author: --<> | |
Purpose: | |
Created: 2013-10-26 | |
""" | |
import urllib | |
import urllib2 |
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
def getip(): | |
localIP = socket.gethostbyname(socket.gethostname())#得到本地ip | |
print "local ip:%s " % localIP | |
ipList = socket.gethostbyname_ex(socket.gethostname()) | |
for i in ipList: | |
if i != localIP: | |
print "external IP:%s" % i |