python sys

# File name : reversargs
import sys
args = sys.argv[1:]
print args
args.reverse()
#print args.reverse()
print ' '.join(args)
[work]$ python reverseargs.py 1 2 3
['1', '2', '3']
3 2 1
原文地址:https://www.cnblogs.com/robbychan/p/3786927.html