1. 首页
  2. 编程语言
  3. Python
  4. python核心编程源码

python核心编程源码

上传者: 2018-12-18 20:15:19上传 RAR文件 154KB 热度 52次
python核心编程第二版的源码 #!/usr/bin/env python 'readTextFile.py -- read and display text file' # get filename fname = raw_input('Enter file name: ') print # attempt to open file for reading try: fobj = open(fname, 'r') except IOError, e: print"*** file open error:", e else: # display contents to the screen for eachLine in fobj: print eachLine, fobj.close()
用户评论