python - multiprocessing: TypeError: 'int' object is not iterable -


i'm using multiprocessing module in python 3 reason, keeps throwing typeerror: 'int' object not iterable when run program. did:

def main(i):     global urldepth     global row     global counter     urldepth = []     row = 0     counter = 0     login(i)     crawler(menu_url)   if __name__ == '__main__':     workers = 2     processes = []     p_number in range(workers):         p = process(target=main, args=p_number)         p.start()         processes.append(p)      p in processes:         p.join() 

i don't understand why happening, me this?

not duplicate of typeerror: 'int' object not iterable because same error, yes, it's of different cause, please read question/code before trying mark question duplicate.

p = process(target=main, args=p_number) 

iirc, args needs tuple, you're giving integer. try:

p = process(target=main, args=(p_number,)) 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -