2
當運行這段代碼:PYTHON錯誤:IndentationError:取消縮進不匹配任何外部縮進級別
#timestamp, capture, and tweet an image
def stamp_cap_tweet():
timestamp = time.strftime("%d%m%Y-%H%M%S")
os.system("fswebcam -r 960x720 -d /dev/video0 " + timestamp + ".jpg") #save image to disk
twit.update_status_with_media(timestamp + ".jpg", status = "@shahidrogers " + timestamp) #tweet image @username
print "Tweeted image at " + timestamp #make a record in the Python output
我得到的錯誤
File "tweetpicture.py", line 17
os.system("fswebcam -r 960x720 -d /dev/video0 " + timestamp + ".jpg") ^ IndentationError:
unindent does not match any outer indentation level
什麼能這可能意味着什麼?我已經搜索過,人們都說有多種選項卡和空格,但是我完全不理解這一點,因爲我對Python還很陌生,這是我編寫的第幾行代碼。
謝謝!
只用空格鍵重新調整代碼,看看會發生什麼。 –
這個問題爲什麼downvoted?這是清楚的,並顯示研究工作。 –
它清楚地顯示了缺乏關於Python的基本谷歌研究... – BartoszKP