小编Sha*_*ers的帖子

PYTHON ERROR:IndentationError:unindent与任何外部缩进级别都不匹配

运行这段代码时:

#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
Run Code Online (Sandbox Code Playgroud)

我收到了错误

文件"tweetpicture.py",第17行

os.system("fswebcam -r 960x720 -d /dev/video0 " + timestamp + ".jpg")                                                  
                                                                    ^                                                   IndentationError:
Run Code Online (Sandbox Code Playgroud)

unindent与任何外部缩进级别都不匹配

这可能意味着什么?我已经四处搜索,人们已经说过有标签和空格的混合,但我完全不理解这一点,因为我还是Python的新手,这是我的前几行编码.

谢谢!

python

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

python ×1