marco
marco

Reputation: 899

Python System.Windows.Forms browse file dialog window

I would like to import some data from a .txt file. Right now I am doing it like so:

filename = "C:/results/results.txt"
file = open(filename, 'r')
lines = file.readlines()
file.close()

I wondering if there is way to have some dialog box, which will allow picking the right .txt file file, instead of supplying filename variable. Like this:

enter image description here

Is it possible to get this dialog box without some custom python UI module (like tkinter or similar)? Is it possible to get it through System.Windows.Forms for example?

I am using python 2.7.

Thank you for the reply

Upvotes: 0

Views: 1693

Answers (1)

neiesc
neiesc

Reputation: 653

In this case the path is to use the ironpython, link

Upvotes: 2

Related Questions