码迷,mamicode.com
首页 > 编程语言 > 详细

Python3 third

时间:2016-10-12 16:50:05      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:

#About Module
#import sample_module.py
import sample_module

sample_module.fib(100)

print(sample_module.__name__)

from sample_module import fib
fib(100)


import math
print(math.pi)

#Exception 
try:
    number = 1*100/0
    print(number)
except:
    print(error)

    
try:
    raise Exception(raise an exception!)
except Exception:
    print(error)


try:
    raise Exception
except:
    print(Exception)
finally:
    print(finished!)


#File 统计目录下 test.txt 文件
with open(rtest.txt,r) as f:
   for line in f:
       print(line,end="")
    

技术分享

Python3 third

标签:

原文地址:http://www.cnblogs.com/longsheng/p/5953178.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!