Reputation: 39
content = os.path.abspath("content")
for i in os.listdir(os.path.abspath("content")):
path = str(i)
bot.upload_photo(content "/" path, caption ="Technical Scripter Event 2019")
SO, I need to make something like this.The program makes the files from the folder variables and I need to connect the path to it.
Upvotes: 0
Views: 34
Reputation: 110
This line contains a syntax error:
bot.upload_photo(content "/" path, caption ="Technical Scripter Event 2019")
In order to concatenate content and path, you should use os.path.join
:
bot.upload_photo(os.path.join(content,path), caption ="Technical Scripter Event 2019")
Upvotes: 2