ITPub博客

首页 > 应用开发 > Python > Python 获取文件创建、访问、修改时间

Python 获取文件创建、访问、修改时间

原创 Python 作者:wpgy 时间:2019-09-27 00:02:05 0 删除 编辑

# 参数 file: 待处理文件的绝对路径

# retuen: list

import os

def get_file_time(file):
    return [
        os.path.getatime(file), # access
        os.path.getmtime(file), # create
        os.path.getctime(file)  # modify
    ]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31560527/viewspace-2658445/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
擅长: Oracle、MySQL, Python、PHP、Web 开发; 研究领域:数据库技术、自动化运维

注册时间:2018-11-01

  • 博文量
    29
  • 访问量
    39463