M
Méta-MCI
Hi!
I've a problem with these 2 scripts:
file aaa.py (write in ANSI/cp1252):
# -*- coding: cp1252 -*-
compo={}
compo['pxrtf']= {
'fichier': "pxrtf.py",
'description': "Génération de fichiers RTF"
}
file bbb.py (write in ANSI/cp1252):
# -*- coding: cp1252 -*-
import aaa
With run bbb.py, I see:
Traceback (most recent call last):
File "D:\dev\python\bbb.py", line 3, in <module>
import aaa
File "D:\dev\python\aaa.py", line 3
^
SyntaxError: invalid syntax
(run directly aaa.py give no problem)
(Python 2.5.1 + win_XP-SP2_french)
BUT, if I write the file aaa.py in UTF-8, with 1st line: # -*- coding:
utf-8 -*-
the problem is removed (file bbb.py stay in ANSI/cp1252)
Bug? or am I wrong?
@-salutations
Michel Claveau
I've a problem with these 2 scripts:
file aaa.py (write in ANSI/cp1252):
# -*- coding: cp1252 -*-
compo={}
compo['pxrtf']= {
'fichier': "pxrtf.py",
'description': "Génération de fichiers RTF"
}
file bbb.py (write in ANSI/cp1252):
# -*- coding: cp1252 -*-
import aaa
With run bbb.py, I see:
Traceback (most recent call last):
File "D:\dev\python\bbb.py", line 3, in <module>
import aaa
File "D:\dev\python\aaa.py", line 3
^
SyntaxError: invalid syntax
(run directly aaa.py give no problem)
(Python 2.5.1 + win_XP-SP2_french)
BUT, if I write the file aaa.py in UTF-8, with 1st line: # -*- coding:
utf-8 -*-
the problem is removed (file bbb.py stay in ANSI/cp1252)
Bug? or am I wrong?
@-salutations
Michel Claveau