• [^] # Re: Ça m'intéresse

    Posté par . En réponse au message Transformer mon .py en .exe. Évalué à 3. Dernière modification le 21 février 2020 à 18:15.

    https://www.pyinstaller.org/
    Mais attention:
    test sous linux :

     % ./test.py 
    hello world
    %pyinstaller test.py
    [...]
    5287 INFO: Appending archive to ELF section in EXE python/build/test/test
    [...]
    %% du python/build/test/ -h 
    40K python/build/test/localpycos
    **4,5M** python/build/test/

    4.5 Mo pour un simple hello world

    Et dès que des imports sont fait:

    #!/usr/bin/env python
    import math
    a=input("rayon du cercle?")
    print("perimetre= {}".format(2*math.pi*float(a)))
    print("superficie={}".format(math.pi*float(a)**2))

    => taille de 14Mo