摘要:
下午一直受困与简明教程try_except.py中的except ShortInputException , x:的3.2版本的实现方法,最后得出用except ShortInputExceptionas x:可以实现。有点恍然大悟的感觉~额......菜鸟Python初学者伤不起,有木有,有木有! 1 #!/usr/bin/python 2 # Filename : try_except.py 3 4 import sys 5 6 try: 7 s = input('Enter something -->') 8 except EOFError: 9 print( 阅读全文
posted @ 2012-04-11 18:35
听歌的麦子
阅读(280)
评论(0)
推荐(0)
摘要:
初学Python3.2,发现与之前的Python2.x很多实现上存在差异。在此做下记录~View Code 1 #!/usr/bin/python 2 # Filename : pickling.py 3 4 import pickle as p 5 # import pickle as p 6 7 shoplistfile = 'shoplist.data' 8 # the name of the file where we will shore the object 9 10 shoplist = ['apple', 'mango', 阅读全文
posted @ 2012-04-11 18:20
听歌的麦子
阅读(175)
评论(0)
推荐(0)
浙公网安备 33010602011771号