Skip to content

Get file size with Python? #2

@zonca

Description

@zonca

I am undecided if this is better than ls -lh:

(os.path.getsize(filename) * u.byte).to(u.MB)

Has the advantage of being same for Windows and showing another use of astropy units, but maybe is too obscure?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions