Pythonドキュメント " 'モジュール' オブジェクトには属性 'lstrip' を持っていない":Pythonのエラーは、<a href="http://docs.python.org/library/string.html" rel="nofollow">http://docs.python.org/library/string.html</a>から
string.lstrip(s[, chars])
戻り取り除か先行文字と文字列のコピーを。 の文字がでない場合、または
None
の場合は、空白文字が削除されます。与えられていてNone
でない場合、の文字は文字列でなければなりません。文字列内の文字は、このメソッドがコールされた文字列の先頭から取り除かれます。」
Python 3.1.2 (r312:79360M, Mar 24 2010, 01:33:18)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> import string
>>> x = 'Hi'
>>> string.lstrip(x,1)
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
string.lstrip(x,1)
AttributeError: 'module' object has no attribute 'lstrip'
>>>
私がここで行方不明ですか?
TypeErrorには1がcharではないので、それを与える必要があります。 – Rozuur