Hello
I would like to know if it is possible to iterate the strings to be entered in a file
Normally, as in the example below, we enter a character string after the write operator ( ) or after line=
Thank you for your help
----------------------------
Bonjour
je voudrais savoir s’il est possible d’itérer les chaînes de caractères à saisir dans un fichier
Normalement ,comme dans l’exemple ci dessous , on saisit une caine de caractère après l’opérateur write ( ) ou après ligne=
Merci de votre aide
cordialement
cordially
Translated with www.DeepL.com/Translator (free version)
I would like to know if it is possible to iterate the strings to be entered in a file
Normally, as in the example below, we enter a character string after the write operator ( ) or after line=
fich = open("mon_fichier.txt", "w") fich.write("Hello world") line = "Hello". fich.write(line) file.close()Now I would like to place in write( ) or line = , strings resulting from a previous script including loops that allow me to generate these different strings
Thank you for your help
----------------------------
Bonjour
je voudrais savoir s’il est possible d’itérer les chaînes de caractères à saisir dans un fichier
Normalement ,comme dans l’exemple ci dessous , on saisit une caine de caractère après l’opérateur write ( ) ou après ligne=
fich = open("mon_fichier.txt","w") fich.write("Bonjour le monde\n") ligne = "Coucou\n" fich.write(ligne) fich.close()Or je souhaiterai placer dans write( ) ou ligne = , des chaînes de caractère résultant d’un script précédent comprenant des boucles qui me permettent de générer ces différentes chaînes
Merci de votre aide
cordialement
cordially
Translated with www.DeepL.com/Translator (free version)
buran write Mar-17-2021, 07:34 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.