Chinaunix首页 | 论坛 | 博客
  • 博客访问: 297757
  • 博文数量: 240
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 50
  • 用 户 组: 普通用户
  • 注册时间: 2016-08-04 18:14
文章分类

全部博文(240)

文章存档

2017年(8)

2014年(4)

2013年(15)

2012年(4)

2011年(14)

2010年(55)

2009年(140)

我的朋友

分类: Python/Ruby

2009-03-04 09:50:17

 
 

#!c:\\python26\\python.exe
import optparse
def main():
    MSG_USAGE = "opt.py [-s ][-p ]"
    p = optparse.OptionParser(MSG_USAGE)
    p.add_option('-s','--server',default="127.0.0.1",help="Server ip your self with this option.")
    p.add_option('-p','--port',default="6666",type="int",help="Server port your self with this option.")
    p.add_option('-c','--client',default="localhost",help="Client ip your self with this option.")
    options, arguments = p.parse_args()
    print 'Server: %s\nPort: %s\nClient: %s' % (options.server,options.port,options.client)
if __name__ == '__main__':
    main()

阅读(1258) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:tcpdump 应用

给主人留下些什么吧!~~