je suis débutant dans python
J'ai écrit un fichier rapprot.py dont le contenu est :
import os
def affiche(message):
obFichier= open('Log.txt','a')
obFichier.write(message)
obFichier.write('\n')
obFichier.close()
Dans un autre fichier lorsque je fait
import rapport
j'aurais l'erreur suivante :
Traceback (most recent call last):
File "/home/jarraya/Test_Python/ali.py", line 1, in -toplevel-
import rapport
File "/home/jarraya/Test_Python/rapport.py", line 4
def affiche(message):
^
SyntaxError: invalid syntax
Ou est le problem.
merci d'avance
Forum Programmation.python import Error
27
mar.
2007