[python] filedialog sans fenêtre tkinter

bonjour

J’ai un script en python3 et je veux selectionner un fichier.

import tkinter.filedialog
import os

rep=os.getcwd
fic=""
src=tkinter.filedialog.askopenfilename(title ="Ouvrir le fichier : " , \
             initialdir =rep, initialfile =fic ,\
             filetypes = [("All", "*"),("Fichiers Image",\
                           "*.jpeg;*.gig;*.jpg;*.png")])
print(src)

J’ai bien ma fenêtre pour selectionner le fichier mais il y a une deuxième fenêtre tkinter qui apparaît (celle qu’on utilise normalement).

Y a il moyen de ne pas la faire apparaître cettte deuxième fenètre ou dois je utiliser autre chose pour sélectionner un fichier. (ici une image)

Merci

edit: je n’avais pas tout mis (import os)

J’ai trouvé ceci qui répond à ma question

Je rajoute
root=Tkinter.Tk()
root.withdraw()

root.destroy()

import tkinter.filedialog
import os

rep=os.getcwd
fic=""
root=Tkinter.Tk()
root.withdraw()
src=tkinter.filedialog.askopenfilename(title ="Ouvrir le fichier : " , \
             initialdir =rep, initialfile =fic ,\
             filetypes = [("All", "*"),("Fichiers Image",\
                           "*.jpeg;*.gig;*.jpg;*.png")])
print(src)
root.destroy()