[Python] I am trying to get the size of a file with os.path.getsize but it prints out the size...

Discussão em 'Python' iniciado por Stack, Abril 7, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to get the size of a file with os.path.getsize but it prints out the size as bytes and I want to print it out in MB, any solutions? The code:

    import os
    from os import system
    os = os.path.getsize("C:\\Users\\username\\Desktop\\ambrosial.exe")
    print(str(os))

    Continue reading...

Compartilhe esta Página