2023-02-05 18:17:16 +01:00
|
|
|
import sys
|
2024-01-02 08:42:05 +01:00
|
|
|
from PyQt6 import QtWidgets
|
|
|
|
from PyQt6.QtWidgets import QApplication, QFileDialog
|
2023-02-05 18:17:16 +01:00
|
|
|
|
|
|
|
###############################################################################
|
2023-02-06 14:40:00 +01:00
|
|
|
# rp_file_qt.py
|
2023-02-05 18:17:16 +01:00
|
|
|
# @title: Selecteur de fichier (pyQt5)
|
2023-02-06 14:40:00 +01:00
|
|
|
# @project: Ropy (Blender-EduTech)
|
2023-02-05 18:17:16 +01:00
|
|
|
# @lang: fr
|
|
|
|
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
|
|
|
# @copyright: Copyright (C) 2023 Philippe Roy
|
|
|
|
# @license: GNU GPL
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
def dialog():
|
|
|
|
file , check = QFileDialog.getOpenFileName(None, "Sélection du fichier de commande", "", "Python Files (*.py)")
|
|
|
|
if check:
|
|
|
|
return file
|
|
|
|
|
|
|
|
app = QApplication(sys.argv)
|
|
|
|
file = dialog()
|
|
|
|
print (file)
|
|
|
|
sys.exit(0)
|