mirror of
https://forge.apps.education.fr/blender-edutech/jumeaux-numeriques.git
synced 2024-01-27 06:56:18 +01:00
24 lines
741 B
Python
24 lines
741 B
Python
|
import sys
|
||
|
from PyQt5 import QtWidgets
|
||
|
from PyQt5.QtWidgets import QApplication, QFileDialog
|
||
|
|
||
|
###############################################################################
|
||
|
# 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():
|
||
|
file , check = QFileDialog.getOpenFileName(None, "QFileDialog.getOpenFileName()", "", "All Files (*);;Python Files (*.py);;Text Files (*.txt)")
|
||
|
if check:
|
||
|
return file
|
||
|
|
||
|
app = QApplication(sys.argv)
|
||
|
file = dialog()
|
||
|
print (file)
|
||
|
sys.exit(0)
|