12-1-2 output.txt problems!


So first, python says to me that output.txt doesn't exist.
So i put a little code to create it.
After, python says to me that mon_fichier doesn't look like a file.
What the ■■■■?
Can someone help me to unlock this exercice please...


Oups, merci de réessayer. Il semblerait que mon_fichier ne soit pas un fichier.

import os

if os.path.exists('output.txt'):
    print "File exists"
    variable = open("output.txt", 'w')
    variable.write("I'm the first line of the file!" +"\n")

my_file = open("output.txt", "r+")


ok i found in the forum, thanks


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.