Getting a user specified file location

So I’m writing a program that uploads and reads a file format from the Seimans format (not DICOM), and I need to write a way to have the user find the file location, and then save that location as a string. Pretty much the equivalent of the general “upload” button. However, everywhere I look, the only way I can find to do this (and how I’ve done it in the past) is using TKinter’s filedialogue command, and tkinter isn’t available in the slicer libraries.

Is there any way to do this using slicer’s libraries?

Thanks!

There are many widgets that you can use to ask file path from the user. I prefer ctk.ctkPathLineEdit(), as it allows you to copy-paste, select using a dialog (if you click … button), and can also save most recent selections. There are also several Qt widgets that can be used.

1 Like