无涯教程-OS File - os.stat_float_times([newvalue])函数

74 阅读1分钟

Python方法stat_float_times()确定stat_result是否将时间戳表示为浮动对象。

os.stat_float_times - 语法

os.stat_float_times([newvalue])
  • newvalue  -  如果newvalue为True,则将来对STAT()的调用将返回浮点数,如果为False,则以后对STAT的调用将返回int。如果未提到newvalue,则返回当前设置。

os.stat_float_times - 返回值

此方法返回True或False。

os.stat_float_times - 示例

以下示例显示stat_float_times()方法的用法。

#!/usr/bin/python

import os, sys

# 统计信息 statinfo=os.stat(a2.py)

print statinfo statinfo=os.stat_float_times() print statinfo

当无涯教程运行上面的程序时,它产生以下输出-

posix.stat_result(st_mode=33188, st_ino=3940649674337682L, st_dev=277923425L, 
st_nlink=1, st_uid=400, st_gid=401, st_size=335L, st_atime=1330498089, st_mtime=13
30498089, st_ctime=1330498089)
True

参考链接

www.learnfk.com/python/os-s…