zoukankan      html  css  js  c++  java
  • How to get the size of file in python? NLP

    I must learn to use google to solve problems. Input "python get file size" in google.

      solution:

    command line: input python, into:

          >>> import os

          >>> statinfo = os.stat('somefile.txt')  # filename

          >>> statinfo

              (33188, 422511L, 769L, 1, 1032, 100, 926L, 1105022698,1105022732, 1105022732)

          >>> statinfo.st_size

              926L    # size of somefile.txt

    input: os.stat ("temp"),

    posix.stat_result(st_mode=33188, st_ino=279987L, st_dev=2049L, st_nlink=1, st_uid=1000, st_gid=1000, st_size=1316889L, st_atime=1340701004, st_mtime=1340701837, st_ctime=1340701837)

    >>> sinfo = os.stat("temp")

    >>> output("Length: %s" % sinfo.st_size)    # size of temp

    >>>import os
    >>> statinfo = os.stat('somefile.txt')
    >>> statinfo
    (33188,422511L,769L,1,1032,100,926L,1105022698,1105022732,1105022732)
    >>> statinfo.st_size
    926L
  • 相关阅读:
    链接唤醒IOSApp
    C#抽象属性
    c#结构体与类的区别
    广告学入门
    个性化推荐十大挑战[
    MapReduce 读取和操作HBase中的数据
    mysql sql命令大全
    从B 树、B+ 树、B* 树谈到R 树
    MapReduce操作HBase
    Meanshift,聚类算法
  • 原文地址:https://www.cnblogs.com/nlpowen/p/2564091.html
Copyright © 2011-2022 走看看