How to resize tkFileDialog.askdirectory window?

I wrote a short script to search and save specific files. To select a save location, I used the following line:

ask_dir = tkFileDialog.askdirectory(initialdir= os.path.dirname(sys.argv[0]))

However, the askdirectory window (at least on my WinXP machine) is too small and it does not change. Tkinter does not have a visible command to increase the size of this window - see the link here . How can i fix this?

+4
source share
1 answer

Windows seems to use a function FolderBrowserDialogthat cannot be easily changed, although it may be possible to change it with some effort.

, Python pywin32.

, , :

import win32gui

win = win32gui.FindWindowEx(None, None, "NULL,"#32770", None)
win32gui.SetWindowPos(win, 0, 500, 500, 900, 900, 0)

: a) b) (. ).

:

  • #32770 (win7, 64-bit), ... .
  • askdirectory , , , , . , , , "" .

, " " , .
- , OS UI-, ...

+2

Source: https://habr.com/ru/post/1525270/


All Articles