私は myfile.py を実行していて、出力をファイルにリダイレクトしたいので、これを行いました:
python2.5 myfile.py > affiche.txt
しかし、affiche.txt を表示すると、出力が重複していることがわかります。
このファイルでメッセージが重複しているのはなぜですか? myfile.py のメインにはこれが含まれています:
print "\n[BG:INFO] Automatic generation of the machine features\n"
hostname = socket.gethostname()
rep=DeletePoints(hostname)
if exists(rep)==False:
print "\n[BG:INFO] The directory of work is: ", rep, "\n"