2

I am trying to create vi editor kind of app using python, that takes input from command line and, provides option to save the typed text .So I need to use the save dialog box without using tkinter. How can I write python script that makes the call to windows save file dialog api

0

1 Answer 1

2

You can use pywin32

import win32ui

dlg = win32ui.CreateFileDialog(0)
dlg.SetOFNInitialDir(r'C:\Users\jezequiel\Desktop')
dlg.DoModal()

print(dlg.GetPathName())
Sign up to request clarification or add additional context in comments.

2 Comments

How can achieve the same thing without using some third-party modules
You can always just ask your users to pass in the file path as a command-line argument you can get from sys.argv[1] or you could just prompt them to type in the path using input(...).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.