Python os.stat_float_times() 方法

Python 教程 · 2019-02-04 11:28:55

概述

os.stat_float_times() 方法用于决定stat_result是否以float对象显示时间戳。

语法

stat_float_times()方法语法格式如下:

os.stat_float_times([newvalue])

参数

  • newvalue -- 如果为 True, 调用 stat() 返回 floats,如果 False, 调用 stat 返回 ints。如果没有该参数返回当前设置。

返回值

返回 True 或 False。

实例

以下实例演示了 stat_float_times() 方法的使用:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

import os, sys

# Stat 信息
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

点击查看所有 Python 教程 文章: https://codercto.com/courses/l/8.html

查看所有标签

Node.js in Action

Node.js in Action

Mike Cantelon、Marc Harter、TJ Holowaychuk、Nathan Rajlich / Manning Publications / 2013-11-25 / USD 44.99

* Simplifies web application development * Outlines valuable online resources * Teaches Node.js from the ground up Node.js is an elegant server-side JavaScript development environment perfect for scal......一起来看看 《Node.js in Action》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

随机密码生成器
随机密码生成器

多种字符组合密码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码