Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5935795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:18:22+00:00 2026-05-22T15:18:22+00:00

I am reading this http://docs.python.org/dev/library/multiprocessing.html In particular this p = multiprocessing.Process(target=time.sleep, args=(1000,)) I tried

  • 0

I am reading this

http://docs.python.org/dev/library/multiprocessing.html

In particular this

p = multiprocessing.Process(target=time.sleep, args=(1000,))

I tried the same thing, but if I remove the “,” after 1000 it doesn’t work. So my question is what is the semantic behind the args=(1000,) in this case? What is the difference if I put a comma and not ?

p/s: I believe it’s a fundamental issue, if it is can someone point me to some further reading if possible? thanks.

Thanks.

Regards,
Andy.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:18:23+00:00Added an answer on May 22, 2026 at 3:18 pm

    If you just put (1000), Python assumes you’re just evaluating the expression as math, hence it gets simplified to just 1000. Think of the result of 5 + (1000) + 4.

    Just as the expression above would get simplified to 1009, here is what your line looks like once things have been simplified:

    p = multiprocessing.Process(target=time.sleep, args=1000)
    

    You can see that this is not the same thing at all. args is supposed to be a tuple of arguments, not a single integer.

    If you put (1000,), Python can tell you are looking for a tuple which only contains one element, since that expression is differentiable from a simple arithmetic expression, so you end up passing in the correct thing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading through this article: http://aws.typepad.com/aws/2008/12/running-everything-on-aws-soocialcom.html And I was wondering if this was
Reading this question I found this as (note the quotation marks) code to solve
Reading this post has left me wondering; are nightly builds ever better for a
Reading this blog post about HttpOnly cookies made me start thinking, is it possible
After reading this question , I was reminded of when I was taught Java
After reading this description of late static binding (LSB) I see pretty clearly what
After reading this answer: best way to pick a random subset from a collection?
After reading this discussion and this discussion about using CrashRpt to generate a crash
After reading this on the question How do I uniquely identify computers visiting my
I was reading this question about how to parse URLs out of web pages

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.