Hi; I modify my function like that :
the sentence : ceci est l'operation de sauvegarde dans un fichier texte
appear at the bottom of my editor but I don't find the text file at the directory that containt my index.py
def reateFileFromLoc35R(self): script_path_ils35R = os.path.dirname(os.path.realpath(__file__))#récupérer le répertoire courant new_path_ils35R=script_path_ils35R + '\\data_base' #concaténer au path ci-dessus le path du dossier data_base os.makedirs(new_path_ils35R, exist_ok=True) #creer le dossier data_base au nouveau path conn = sqlite3.connect (new_path_ils35R+'\\ils35R.db') curseur=conn.cursor() c=curseur.execute("SELECT * FROM loc35R") listeTableLoc35R=c.fetchall() f=open("guru99.txt", "a+") for readData in listeTableLoc35R : f.write(readData[0]) f.write("\n") f.close() print("ceci est l'operation de sauvegarde dans un fichier texte")when I execute the function by clicking on the button :
the sentence : ceci est l'operation de sauvegarde dans un fichier texte
appear at the bottom of my editor but I don't find the text file at the directory that containt my index.py