Python in exe inside Python code.



  • There's a code.

    import PyInstaller.__main__
    

    PyInstaller.main.run([
    'some_file.py',
    '--onefile',
    ])

    This code is compiled through PyInstaller.

    pyinstaller -F code.py

    But it's code.py The programme begins an endless repetition of compiling some_file.py

    Example

    154 INFO: PyInstaller: 4.5.1
    154 INFO: Python: 3.9.8
    505 INFO: Platform: Windows-10-10.0.19043-SP0
    506 INFO: wrote C:\Users\User\Desktop\1123\some_file.spec
    509 INFO: UPX is not available.
    533 INFO: Extending PYTHONPATH with paths
    ['C:\Users\user\Desktop\folder_with_code', 'C:\Users\User\Desktop\folder_with_code']

    Can we fix this?



  • It's the best thing to do is just give the command line. Here's the code:

    from os import system
    system('pyinstaller --onefile some_file.py')
    

    Of course, the crypt with the code must be in the same folder with a program that needs to be compromised.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2