2023-01-27 21:26:33 +01:00
|
|
|
import sys
|
2023-01-31 05:06:52 +01:00
|
|
|
from PyQt5 import QtWidgets
|
|
|
|
from PyQt5.QtWidgets import QApplication, QFileDialog
|
2023-01-27 21:26:33 +01:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# twin_file_qt.py
|
|
|
|
# @title: Selecteur de fichier (pyQt5)
|
|
|
|
# @project: Blender-EduTech
|
|
|
|
# @lang: fr
|
|
|
|
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
|
|
|
# @copyright: Copyright (C) 2023 Philippe Roy
|
|
|
|
# @license: GNU GPL
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
def dialog():
|
2023-01-28 01:10:05 +01:00
|
|
|
file , check = QFileDialog.getOpenFileName(None, "Sélection du fichier de commande", "", "Python Files (*.py)")
|
2023-01-27 21:26:33 +01:00
|
|
|
if check:
|
|
|
|
return file
|
|
|
|
|
|
|
|
app = QApplication(sys.argv)
|
|
|
|
file = dialog()
|
|
|
|
print (file)
|
|
|
|
sys.exit(0)
|