0

Running the code below

import threading
import io
import Client

Proxies = None
Users = None

with open("proxies.txt") as x:
    Proxies = x.readlines()

with open("ids.txt") as f:
    Users = f.readlines()

c = 0
for udata in Users:
    uid = udata.split(':')[0]
    ok = udata.split(':')[1]
    while True:
        proxy = Proxies[c].strip('\n')
        proxySplit = proxy.split(':')
        c = Client.Client(proxySplit[0], proxySplit[1], uid, ok, 171147281)
        if(c):
            c += 1
            break

I've got this exception:

Traceback (most recent call last):
File "Run.py", line 20, in <module>
proxy = str(Proxies[c]).strip('\n')
TypeError: object cannot be interpreted as an index

I can not found what's wrong with my code. Any help will be appreciated.

1 Answer 1

6

It seems that in line 22 c = Client.Client(proxySplit[0], proxySplit[1], uid, ok, 171147281) you make c an object, not an int anymore. And when it goes to line 20 again, c is used as an index, which is not allowed.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you! I totally missed that out, it's not allowing me to mark it as an answer now, 10 minutes, I will, though, mark it as an answer.
This is a good part of the reason why style guides tell you to use meaningful names instead of single-letter names for your variables. You're less likely to use the same name for an count and a client object if you call them count and client instead of trying to pick a single letter for each…
Yeah, that's what I did. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.