摘要:
一 基本的异常处理Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->defTestTryException():try:f=open('myfile.txt')s=f.readline()f.close()i=int(s.strip())exceptIOErrorasioerror:print(ioerror)exceptValueErrorasvalueerror:print(valueerror)except:print(& 阅读全文
posted @ 2011-01-13 17:30
iTech
阅读(1211)
评论(0)
推荐(0)
摘要:
经常地我们需要编写跨平台的脚本,但是由于不同的平台的差异性,我们不得不获得当前所工作的平台(操作系统类型)。代码如下:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->importplatformdefTestPlatform():print("----------OperationSystem--------------------------")#Windowswillbe:(32bit,WindowsPE)#Linux 阅读全文
posted @ 2011-01-13 16:10
iTech
阅读(13111)
评论(0)
推荐(0)

浙公网安备 33010602011771号