alirezausefi
alirezausefi

Reputation: 121

taking an excel file as a input data from user in julia

I want to ask from users to load an excel file as an input data. this process must be done by opening a browsing window to select excel file. what can I do?

Upvotes: 4

Views: 140

Answers (1)

Sundar R
Sundar R

Reputation: 14735

You can use open_dialog_native from Gtk.jl.

julia> open_dialog_native("Choose the input Excel file", GtkNullContainer(), ("*.xlsx",))
"/path/to/myfile.xlsx"

It opens the file chooser interface appropriate to the user's OS, and once the file is chosen, returns the chosen file's full path as a string.

The ("*.xlsx",) is a tuple that constrains what type of files are shown by default in the file chooser. (The GtkNullContainer() argument just specifies that you're not running this as part of an existing GTK app.)

Documentation here

Upvotes: 1

Related Questions