On Mon, Feb 9, 2009 at 11:13 PM, Frank Potter <could....@gmail.com> wrote: > I have a xxx.py which has code as below: > > import string > > print dir(string) > print string.printable > > > when I run it, I got the strange error: > > "<?xml version=\"1.0\" encoding=\"gbk\"?>\n" > "<root>\n" > "<result>##result##</result>\n" > "<msg>##msg##</msg>\n" > "<pass_no>##pass_no##</pass_no>\n" > "<pot_num>##pot_num##</pot_num>\n" > "<pots_mashed>##pots_mashed##</pots_mashed>\n" > "<yb_used>##yb_used##</yb_used>\n" > "<right>##right##</right>\n" > "</root>\n" > ['__builtins__', '__doc__', '__file__', '__name__', 'str'] > Traceback (most recent call last): > File "del2.py", line 4, in ? > print string.printable > AttributeError: 'module' object has no attribute 'printable' > > It seems that I did not import the right string module I want. Can > someone give me a clue, please?
Sounds like the wrong `string` module is being imported. What's the output of `print string.__file__`? Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list