3

I create a exe file of a python script with this command:

pyinstaller --onefile Time.py --icon 1.ico --onefile

How can I change the title of EXE file window?

I don't use any tools such as kivy, Tkinter, Arcade, Pygame, etc

H S
  • 33
  • 1
  • 6

2 Answers2

2

In addition to any of the choices in @peki 's answer, you may use the ctypes module that would be more light-weighted:

import ctypes
ctypes.windll.kernel32.SetConsoleTitleW("Some Title")
Jimmy Chen
  • 305
  • 2
  • 11
1

Once converted with Pyinstaller, a window title can't be changed. Edit it in your .py code.

With Tkinter:

win = tk.TK()
win.title("Some Title")

With Pygame:

caption = pygame.display.set_caption('Some Title')

With Kivy:

class MyApp(App):
    def build(self):
        self.title = 'Some Title'

With Arcade:

arcade.open_window(600, 600, "Some Title")

Glad if any of those help.

Edit: If you meant a change of the title on a live command prompt you can check this discussion out.

peki
  • 669
  • 7
  • 24