2008年01月16日 星期三 13:52
Hi, 刚装了个for 2.4系列的DirectPython打开sample一看貌似硬件加速没开,很慢。各位有这个问题么?我的机器跑DirectX SDK里的sample没问题的。 -- >: ~ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20080116/184f9b63/attachment.html
2008年01月16日 星期三 14:05
´òËãÓÃÒ»¸öpythonдһ¸öÃüÁîÐеijÌÐò£¬²»ÖªµÀ´¦ÀíµÄ²ÎÊýµÄÂß¼ÈçºÎÉè¼Æ¡£Çë¸øÐ©Ìáʾ£¡:) Thanks _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20080116/29bfdf51/attachment.htm
2008年01月16日 星期三 18:26
大家看得到我的post么?最近在好几个 mail_list 发帖/回帖都被人理,难道我的邮箱地址被定性为垃圾邮件了? 2008/1/16 Question <wanliyou at gmail.com>: > Hi, > > 刚装了个for 2.4系列的DirectPython打开sample一看貌似硬件加速没开,很慢。各位有这个问题么?我的机器跑DirectX > SDK里的sample没问题的。 > > -- > >: ~ -- >: ~ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20080116/9787d143/attachment.html
2008年01月16日 星期三 19:11
python 标准库里有 getopt 模块, 去看 pydoc getopt 吧 2008/1/16 tairan wang <python at tairan.net>: > > 打算用一个python写一个命令行的程序,不知道处理的参数的逻辑如何设计。请给些提示!:) > > Thanks >
2008年01月16日 星期三 19:12
²Î¿¼Unix¾µä³ÌÐò£¬±ÈÈç ls ¡£ ÔÚ08-1-16£¬tairan wang <python在tairan.net> дµÀ£º > > ´òËãÓÃÒ»¸öpythonдһ¸öÃüÁîÐеijÌÐò£¬²»ÖªµÀ´¦ÀíµÄ²ÎÊýµÄÂß¼ÈçºÎÉè¼Æ¡£Çë¸øÐ©Ìáʾ£¡:) > > Thanks > > ------------------------------ > Express yourself instantly with MSN Messenger! MSN Messenger<http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/> > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- Ray Stinger, nickname Lich_Ray God is in his heaven, all's right with the world. ------------------------------------------------- let focus = 'computing' in where: http://lichray.javaeye.com let focus = 'computing' in here: http://lichray.bokeland.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20080116/fbc85983/attachment.html
2008年01月16日 星期三 19:21
你是说设计参数?
不如首先看 python 怎么处理参数的
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
[ 多个短参数/--长参数] [文件/命令] [其他选项]
两杠开头的为长参数,类似
--encode utf8 或 --encode=utf8
单杠开头的为短参数,或长参数缩写,类似
-d utf8 或 -d=utf8
第一个非 - 开头的为文件/命令
文件/命令后的 是其他参数
贴个实例:
$ zshelve
commandline tool for zshelve databases
Usage: zshelve FILE dump Dump the data tree
zshelve FILE keys List of keys
zshelve FILE get KEY Dump value for key
zshelve FILE set KEY VALUE Set db[key] = value
zshelve FILE has_key KEY True if database has the key
zshelve FILE search_key KEY Search key
zshelve FILE search_value VALUE Search value
2008/1/16 tairan wang <python at tairan.net>:
>
> 打算用一个python写一个命令行的程序,不知道处理的参数的逻辑如何设计。请给些提示!:)
>
> Thanks
>
2008年01月16日 星期三 19:27
建议你改用 "python. cn" <python-cn at googlegroups.com> 这个地址 而 Web 界面则是 http://groups.google.com/group/python-cn 2008/1/16 Question <wanliyou at gmail.com>: > 大家看得到我的post么?最近在好几个 mail_list 发帖/回帖都被人理,难道我的邮箱地址被定性为垃圾邮件了? > >
2008年01月16日 星期三 19:48
Hi, 刚装了个for 2.4系列的DirectPython打开sample一看貌似硬件加速没开,很慢。各位有这个问题么?我的机器跑DirectX SDK里的sample没问题的。 ================================================================= To Jiahua Huang: 谢谢提醒。 2008/1/16 Jiahua Huang <jhuangjiahua at gmail.com>: > 建议你改用 "python. cn" <python-cn at googlegroups.com> 这个地址 > > 而 Web 界面则是 > http://groups.google.com/group/python-cn > > 2008/1/16 Question <wanliyou at gmail.com>: > > 大家看得到我的post么?最近在好几个 mail_list 发帖/回帖都被人理,难道我的邮箱地址被定性为垃圾邮件了? > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -- >: ~ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20080116/11648e96/attachment-0001.htm
2008年01月17日 星期四 12:27
copy一段我的,
try:
opts, args = getopt.getopt(sys.argv[1:], "hs:t:b:", ["help",
"site=","build=","type="])
#支持长选项和短选项两个方式,之所短的: "hs:t:b:"表示-h是开关类型的选项,-s,-t,-t是需要提供额外的值。
#比如: cmd.py -s www.google.com -t homepage -b other_args 或者
#cmd.py -h 或者 cmd.py --help
#opts包含(opt,value)这样的选项和值
#args包含参数列表
except getopt.GetoptError, err:
# print help information and exit:
print str(err) # will print something like "option -a not recognized"
usage()
sys.exit(2)
for o, a in opts:
if o in ("-h", "--help"):
usage()
sys.exit()
elif o in ("-o", "--output"):
output = a
elif o in ("-s","--site") :
site_alias = a
elif o in ("-t","--type"):
build_type = a
elif o in ("-b","--build"):
build_number = a
else:
assert False, "unhandled option"
# ...
2008年01月17日 星期四 15:13
ÊÕµ½£¡ Thanks > Date: Thu, 17 Jan 2008 12:27:34 +0800 > From: hackgou在gmail.com > To: python-chinese在lists.python.cn > Subject: Re: [python-chinese] python дÃüÁîÐгÌÐò > > copyÒ»¶ÎÎҵģ¬ > try: > opts, args = getopt.getopt(sys.argv[1:], "hs:t:b:", ["help", > "site=","build=","type="]) > #Ö§³Ö³¤Ñ¡ÏîºÍ¶ÌÑ¡ÏîÁ½¸ö·½Ê½,Ö®Ëù¶ÌµÄ£º "hs:t:b:"±íʾ-hÊÇ¿ª¹ØÀàÐ͵ÄÑ¡Ï-s,-t,-tÊÇÐèÒªÌṩ¶îÍâµÄÖµ¡£ > #±ÈÈ磺 cmd.py -s www.google.com -t homepage -b other_args »òÕß > #cmd.py -h »òÕß cmd.py --help > #opts°üº¬(opt,value)ÕâÑùµÄÑ¡ÏîºÍÖµ > #args°üº¬²ÎÊýÁбí > except getopt.GetoptError, err: > # print help information and exit: > print str(err) # will print something like "option -a not recognized" > usage() > sys.exit(2) > for o, a in opts: > if o in ("-h", "--help"): > usage() > sys.exit() > elif o in ("-o", "--output"): > output = a > elif o in ("-s","--site") : > site_alias = a > elif o in ("-t","--type"): > build_type = a > elif o in ("-b","--build"): > build_number = a > else: > assert False, "unhandled option" > > # ... > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20080117/8413b974/attachment.htm
2008年01月18日 星期五 12:50
难道没人知道optparse吗? 2008/1/17 tairan wang <python在tairan.net>: > > 收到! > > Thanks > > > > ________________________________ > > Date: Thu, 17 Jan 2008 12:27:34 +0800 > > From: hackgou在gmail.com > > To: python-chinese在lists.python.cn > > Subject: Re: [python-chinese] python 写命令行程序 > > > > > > copy一段我的, > > try: > > opts, args = getopt.getopt(sys.argv[1:], "hs:t:b:", ["help", > > "site=","build=","type="]) > > #支持长选项和短选项两个方式,之所短的: "hs:t:b:"表示-h是开关类型的选项,-s,-t,-t是需要提供额外的值。 > > #比如: cmd.py -s www.google.com -t homepage -b other_args 或者 > > #cmd.py -h 或者 cmd.py --help > > #opts包含(opt,value)这样的选项和值 > > #args包含参数列表 > > except getopt.GetoptError, err: > > # print help information and exit: > > print str(err) # will print something like "option -a not recognized" > > usage() > > sys.exit(2) > > for o, a in opts: > > if o in ("-h", "--help"): > > usage() > > sys.exit() > > elif o in ("-o", "--output"): > > output = a > > elif o in ("-s","--site") : > > site_alias = a > > elif o in ("-t","--type"): > > build_type = a > > elif o in ("-b","--build"): > > build_number = a > > else: > > assert False, "unhandled option" > > > > # ... > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > ________________________________ > Express yourself instantly with MSN Messenger! MSN Messenger > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese >
Zeuux © 2025
京ICP备05028076号