2023-01-27 21:26:33 +01:00
|
|
|
import sys
|
2024-01-02 15:13:14 +01:00
|
|
|
from PyQt6 import QtWidgets
|
|
|
|
from PyQt6.QtWidgets import QApplication, QFileDialog
|
2023-01-27 21:26:33 +01:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# twin_file_qt.py
|
2024-01-02 15:13:14 +01:00
|
|
|
# @title: Selecteur de fichier (pyQt6)
|
2023-01-27 21:26:33 +01:00
|
|
|
# @project: Blender-EduTech
|
|
|
|
# @lang: fr
|
|
|
|
# @authors: Philippe Roy <philippe.roy@ac-grenoble.fr>
|
2024-01-02 15:13:14 +01:00
|
|
|
# @copyright: Copyright (C) 2023-2024 Philippe Roy
|
2023-01-27 21:26:33 +01:00
|
|
|
# @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)
|