Python multiprocessing on Python 2.6 Win32 (xp)

后端 未结 1 1715
傲寒
傲寒 2021-01-21 15:51

I tried to copy this example from this Multiprocessing lecture by jesse noller (as recommended in another SO post)[http://pycon.blip.tv/file/1947354?filename=Pycon-IntroductionT

相关标签:
1条回答
  • 2021-01-21 16:25

    Seems from the traceback that you are running the code directly into the python interpreter (REPL).

    Don't do that. Save the code in a file and run it from the file instead, with the command:

    python myfile.py
    

    That will solve your issue.


    As an unrelated note, this line is wrong:

    print 'Sleeping for ' + wait + ' seconds'
    

    It should be:

    print 'Sleeping for %d seconds' % (wait,)
    

    Because you can't concatenate string and int objects (python is strongly typed)

    0 讨论(0)
提交回复
热议问题