AllenDowney / AstronomicalData

An introduction to working with astronomical data in Python.
https://allendowney.github.io/AstronomicalData/
MIT License
87 stars 24 forks source link

Get file size with Python? #2

Open zonca opened 3 years ago

zonca commented 3 years ago

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?

AllenDowney commented 3 years ago

Interesting idea. Let me think about it.