Python File isatty() 方法
Python 教程
· 2019-02-03 14:28:56
概述
isatty() 方法检测文件是否连接到一个终端设备,如果是返回 True,否则返回 False。
语法
isatty() 方法语法如下:
fileObject.isatty();
参数
无
返回值
如果连接到一个终端设备返回 True,否则返回 False。
实例
以下实例演示了 isatty() 方法的使用:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 打开文件
fo = open("codercto.txt", "wb")
print "文件名为: ", fo.name
ret = fo.isatty()
print "返回值 : ", ret
# 关闭文件
fo.close()
以上实例输出结果为:
文件名为: codercto.txt 返回值 : False
点击查看所有 Python 教程 文章: https://codercto.com/courses/l/8.html
Beginning Google Maps API 3
Gabriel Svennerberg / Apress / 2010-07-27 / $39.99
This book is about the next generation of the Google Maps API. It will provide the reader with the skills and knowledge necessary to incorporate Google Maps v3 on web pages in both desktop and mobile ......一起来看看 《Beginning Google Maps API 3》 这本书的介绍吧!