# two param
# -nt
def isNewthan(x, y):
t1 = int(os.stat(x).st_ctime)
t2 = int(os.stat(y).st_ctime)
if t1 > t2:
return 0
else:
return 1
# -ot
def isOlderthan(x, y):
t1 = int(os.stat(x).st_ctime)
t2 = int(os.stat(y).st_ctime)
if t1 < t2:
return 0
else:
return 1
# -eq
def isEqual(x, y):
try:
x = int(x)
y = int(y)
if x == y:
return 0
else:
return 1
except ValueError:
return 1
# -ge
def isGraterEqual(x, y):
try:
x = int(x)
y = int(y)
if x >= y:
return 0
else:
return 1
except ValueError:
return 1
# -gt
def isGranterthan(x, y):
try:
x = int(x)
y = int(y)
if x > y:
return 0
else:
return 1
except ValueError:
return 1
# -le
def isLessEqual(x, y):
try:
x = int(args.x)
y = int(args.y)
if x <= y:
return 0
else:
return 1
except ValueError:
return 1
# -lt
def isLessthan(x, y):
try:
x = int(x)
y = int(y)
if x < y:
return 0
else:
return 1
except ValueError:
return 1
# -ne
def isNotEqual(x, y):
try:
x = int(x)
y = int(y)
if x != y:
return 0
else:
return 1
except ValueError:
return 1
# -a
def isAnd(x, y):
if bool(x) == True and bool(y) == True:
return 0
else:
return 1
# -o
def isOR(x, y):
if bool(x) == True or bool(y) == True:
return 0
else:
return 1
python test2
最新推荐文章于 2019-04-19 00:40:53 发布