【发布时间】:2013-09-04 13:37:09
【问题描述】:
运行这段代码时:
#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
我得到了错误
文件“tweetpicture.py”,第 17 行
os.system("fswebcam -r 960x720 -d /dev/video0 " + timestamp + ".jpg") ^ IndentationError:unindent 不匹配任何外部缩进级别
这可能意味着什么?我四处搜索,人们说有制表符和空格的混合,但我完全不明白这一点,因为我对 Python 还是很陌生,这是我的前几行编码。
谢谢!
【问题讨论】:
-
只使用空格键重新缩进你的代码,看看会发生什么。
-
为什么这个问题被否决了?它很清楚,显示了研究工作。
-
这清楚地表明谷歌缺乏对 Python 的基本研究......
-
@MarkusUnterwaditzer 只需查看与该问题重复的问题列表的右侧。
标签: python