Загрузка...

Конвертер в .exe file и в .exe file с logo

Тема в разделе Python создана пользователем dastt 12 мар 2023. (поднята 12 мар 2023) 177 просмотров

  1. dastt
    dastt Автор темы 12 мар 2023 2 1 мар 2023
    Python
    import os

    vopros = str(input('1: no logo\n2: Yes logo\nNumber:'))

    if vopros == '1':
    baran = str(input('Name .py file (.py -> .exe): '))
    os.system(f'pyinstaller -F {baran}.py')
    print('Your .exe file -> dist \n by @matliteoff')

    elif vopros == '2':
    baran = str(input('Name .py file (.py -> .exe): '))
    logo = str(input('Name .ico file: '))
    os.system(f'pyinstaller -F -w -i {logo}.ico {baran}.py')
    print('Your .exe file -> dist \n by @matliteoff')
    Код простой, сделал для облегчения вам​
     
    1. Kotegawa1Kamikot
      dastt, а наxуй ты велосипед изобретаешь, если есть py2exe?
      13 мар 2023 Изменено
    2. dastt Автор темы
  2. Shemdy
    review:

    Python
    import os

    def main():
    logo_choice = get_logo_choice()
    py_file = get_py_file_name()

    if logo_choice == '1':
    create_exe(py_file)
    elif logo_choice == '2':
    icon_file = get_icon_file_name()
    create_exe_with_logo(py_file, icon_file)

    def get_logo_choice():
    while True:
    logo_choice = input('1: no logo\n2: Yes logo\nNumber:')
    if logo_choice in ['1', '2']:
    return logo_choice
    print('Please enter 1 or 2.')

    def get_py_file_name():
    while True:
    py_file = input('Name .py file (.py -> .exe): ')
    if py_file.endswith('.py'):
    return py_file[:-3]
    print('Please enter a .py file.')

    def get_icon_file_name():
    while True:
    icon_file = input('Name .ico file: ')
    if icon_file.endswith('.ico'):
    return icon_file[:-4]
    print('Please enter an .ico file.')

    def create_exe(py_file):
    os.system(f'pyinstaller -F {py_file}.py')
    print('Your .exe file -> dist\nby @matliteoff')

    def create_exe_with_logo(py_file, icon_file):
    os.system(f'pyinstaller -F -w -i {icon_file}.ico {py_file}.py')
    print('Your .exe file -> dist\nby @matliteoff')

    if __name__ == '__main__':
    main()
     
    1. dastt Автор темы
      Shemdy, воды много(
    2. derkown
      dastt, это не вода, это нормальный код
  3. 0987654323456789
    [IMG]и куда оно сохраняется
     
Загрузка...
Top