0

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

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

3 Comments

Hi neiesc. That's precisely what I was trying to avoid: getting some non standard python modules. System.Windows.Forms on the other hand is a standard one.
@marco i changed the answer, any particular reason for this? is only for the windows program?
Yes, it's only for the windows program. I checked the link you posted above, and used the "Open dialog" code. Unfortunately I am not getting the same result as shown on that page. This is what I get when I run the code: i59.tinypic.com/i50kcg.jpg Any reason why?

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.