描述
方法stat_float_times()確定 stat_result 是否將時間戳表示為浮點數對象。
用法
以下是語法stat_float_times()方法≫
os.stat_float_times([newvalue])
參數
newvalue�如果 newvalue 為 True,則未來對 stat() 的調用返回浮點數,如果為 False,則未來對 stat 的調用返回整數。如果未提及 newvalue,則返回當前設置。
返回值
此方法返回 True 或 False。
示例
下麵的例子展示了 stat_float_times() 方法的用法。
#!/usr/bin/python3
import os, sys
# Stat information
statinfo = os.stat('a2.py')
print (statinfo)
statinfo = os.stat_float_times()
print (statinfo)
結果
當我們運行上麵的程序時,它會產生以下結果——
os.stat_result(st_mode = 33206, st_ino = 562949953508433, st_dev = 1017554828, st_nlink = 1, st_uid = 0, st_gid = 0, st_size = 27, st_atime = 1455597032, st_mtime = 1455597032, st_ctime = 1455562995) True
相關用法
- Python 3 os.statvfs()用法及代碼示例
- Python 3 os.stat()用法及代碼示例
- Python 3 os.symlink()用法及代碼示例
- Python 3 os.fstatvfs()用法及代碼示例
- Python 3 os.minor()用法及代碼示例
- Python 3 os.close()用法及代碼示例
- Python 3 os.unlink()用法及代碼示例
- Python 3 os.major()用法及代碼示例
- Python 3 os.rmdir()用法及代碼示例
- Python 3 os.fdopen()用法及代碼示例
- Python 3 os.fdatasync()用法及代碼示例
- Python 3 os.isatty()用法及代碼示例
- Python 3 os.rename()用法及代碼示例
- Python 3 os.walk()用法及代碼示例
- Python 3 os.renames()用法及代碼示例
- Python 3 os.makedirs()用法及代碼示例
- Python 3 os.utime()用法及代碼示例
- Python 3 os.tcgetpgrp()用法及代碼示例
- Python 3 os.lchown()用法及代碼示例
- Python 3 os.mknod()用法及代碼示例
注:本文由純淨天空篩選整理自 Python 3 - os.stat_float_times() Method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。