所以我不知道我的确切问题是什么,我是一名业余程序员,所以我不完全知道我的做法是对还是错。这就是为什么如果有人能帮我一点我真的很感激。这是我的代码,我真的不知道我失败了,因为它说这是路径上的失败:
import tweepy
from time import sleep
folderpath= "E:\Fotosprueba"
def tweepy_creds():
consumer_key = 'x'
consumer_secret = 'x'
access_token = 'x'
access_token_secret = 'x'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
return tweepy.API(auth)
def getPathsFromDir(dir, EXTS="extensions=,png,jpg,jpeg,gif,tif,tiff,tga,bmp"):
return this.listPaths('E:\Fotosprueba', EXTS)
def tweet_photos(api):
imagePaths = "E:\Fotosprueba"
for x in imagePaths:
status = "eeeee macarena"
try:
api.update_with_media(filename=x,status=status)
print ("Tweeted!")
sleep(10)
except Exception as e:
print ("encountered error! error deets: %s"%str(e))
break
if __name__ == "__main__":
tweet_photos(tweepy_creds())
缥缈止盈
相关分类