recipe-578772.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:code 作者: ActiveState 项目源码 文件源码
def populate_store(self, store):

        directory = '/home/anon/Documents'
        for filename in os.listdir(directory):
            size = os.path.getsize(os.path.join(directory, filename))
            # the second element is displayed in the second TreeView column
            # but that column is sorted by the third element
            # so the file sizes are sorted as numbers, not as strings
            store.append([filename, '{0:,}'.format(size), size])       

# The main part:
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号