0
を印刷したいときに、このコードは完璧に動作します:Pythonのエラー私は
class MyStreamer(TwythonStreamer):
def on_success(self, data):
txt=json.dumps(data)
#print txt
cur2 = cnx.cursor()
sql="INSERT INTO TWTemp(TWTempTXT,TWTempEstadoCdg) VALUES('"+txt+"',0)"
cur2.execute(sql)
cnx.commit()
self.disconnect()
def on_error(self, status_code, data):
print status_code, data
self.disconnect()
をが、4行目( "印刷TXT")がコメント解除されているとき、私は次のエラーを参照してください。
File "tw.py", line 13
print txt
^
IndentationError: unexpected indent
誰かが助けて私? よろしくお願いします。 ブルーノ
タブまたは空白のみを使用してもよろしいですか? –
おかげでGuillaume問題はTABSです、私はスペースでタブを置き換え、それは動作します! – bcamargo75
@GuillaumeThomasこれを答えとして追加して、未回答のまま受け入れ、削除できるようにしてください。 – Thoth19