Week 08 2020

  • Python: Open file dialog box
from PyQt5.QtWidgets import QFileDialog

def open_file(self, dialog_title, dialog_location, file_filter=None):
    return QFileDialog.getOpenFileName(
        self, dialog_title, dialog_location, filter=file_filter
)

file_location, _ = self.main_window.save_file(
    "Export Environments",
    current_project_folder,
    file_filter="Environment Files (*.envs.json)",
)

if file_location:
	# do something
	pass