C
C
chainikk2018-07-17 06:53:47
Python
chainikk, 2018-07-17 06:53:47

Error for element in updates: TypeError: 'module', how to fix?

import data
import requests
import updates

token = ''
data = requests.get('https://api.vk.com/method/messages.getLongPollServer',
                    params={'access_token': token, 'v': 5.80}).json()['response']
while True:
    response = requests.get('https://{server}?act=a_check&key={key}&ts={ts}&wait=20&mode=2&version=2'.format(server=data['server'], key=data['key'], ts=data['ts'])).json()
    if updates:
        for element in updates:
            print(element)
    data['ts'] = response['ts']

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-07-17
@dimonchik2013

a
Do you want to stick the texts of the file so technically or what?
import the variable directly from there
for element in updates.STUPID_VARIABLE:

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question