I compiled a .py file into .exe via pip, everything compiled without errors, but when I open the file, the console opens and immediately closes. It was advised to write input () at the end, but this did not help. The program itself in .py format works fine. Here is the code:

import time import os import winreg # Добавить в автозагрузку key = winreg.OpenKey(winreg.HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", 0, winreg.KEY_ALL_ACCESS) winreg.SetValueEx(key, "Cheat", 0, winreg.REG_SZ,"%USERPROFILE%\\Programs\\Cheat\\cheat.exe") key.Close() # Удалить из авто загрузки # key = winreg.OpenKey(winreg.HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",0, winreg.KEY_ALL_ACCESS) # winreg.DeleteValue(key, "Date Time") # key.Close() while True: os.startfile(r'r.png') time.sleep(4) input() 
  • start from the console and view the error - eri
  • @eri What console? I apologize for the stupidity, I'm just a novice programmer and I still do not know much ... - Miss Dogi
  • Cmd or bash, there run the path to the python file path - eri
  • @eri Launched, did not issue anything, the program started up regularly. - Miss Dogi
  • So it is simply not an exe) - eri

1 answer 1

Pip is not a compiler and not even an exe application builder. This is the package manager. Looks like you didn’t build the program correctly

Try the instructions strictly. For example pyinstaller

  • I apologize, not correctly expressed. Compiled through pyinstaller. Or rather, the team pyinstaller -F -i "here was the path to the icon" cheat.py - Miss Dogi