Python
2
Вклад в тег
import vk
import requests # or httplib2
album_id = 260909009 # XXX - 260909009
group_id = 178172381
filename = 'simple.png'
token = '7opnd...2nfds'
api = vk.API(vk.Session(access_token=token), v=5.92)
upload_url = api.photos.getWallUploadServer(group_id=group_id)['upload_url']
resp = requests.post(upload_url, files = {'file': open(filename, 'rb')}).json() # вот не знаю, можно ли много картинков за раз загружать
s = api.photos.saveWallPhoto(group_id=group_id, server = resp['server'], photo= resp['photo'], hash = resp['hash'])
api.wall.post(owner_id = -group_id, message="Test!", attachments=f"photo{s[0]['owner_id']}_{s[0]['id']}")
#...
paragraphs = [ globals()[f"para{i}"] for i in range(1,11) ]
print('\n'.join(paragraphs))