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 9181173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:13:27+00:00 2026-06-17T18:13:27+00:00

Trying to have a value that gets set in a method done in a

  • 0

Trying to have a value that gets set in a method done in a multiprocess process get used by the ‘main’ process after it finishes.

It currently gives me

TypeError: 'str' object does not support item assignment
DID WE? ['']

Which, uh, isn’t really what I want given the following code:

def load_dat_site(d):
global seek_site
browser.execute_script("window.location = '"+seek_site+"';")
print "SITE LOADED"
d[0] = 'YEAH!'


manager = Manager()
d = manager.list([''])
site_load_process = multiprocessing.Process(target=load_dat_site, args=(d))
site_load_process.start()
site_load_process.join(15)
print "DID WE?", d

Is there any reason why example scripts seem to be able to set their lists’ values but this can’t?

  • 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-06-17T18:13:29+00:00Added an answer on June 17, 2026 at 6:13 pm

    From the multiprocessing.Process documentation (emphasis added):

    “args is the argument tuple for the target invocation.”

    Change your multiprocessing.Process instantiation to what is shown below and all will work as expected.

    site_load_process = multiprocessing.Process(target=load_dat_site, 
                                                args=(d,)) # the comma is essential!
    

    There is a self-contained, working example here: http://ideone.com/VeTFYk


    Remember that it is NOT the brackets/parens which make a tuple, it is the comma.

    >>> not_a_tuple = (0)
    >>> type(not_a_tuple)
    <type 'int'>
    
    >>> t = 0,
    >>> type(t)
    <type 'tuple'>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get a custom Value from the Custom Field that
I have a dataset that i am trying to set the default value as
I'm trying to have a value ( key ) that updates to correspond with
I have been trying to assign value to an object array that is defined
i am trying to execute the records that have TotalTime null value from the
I'm trying to count the number of records that have a null DateTime value.
I have a json file that I'm trying to get values out of. One
I have been trying to pass a string value from one method into another.
I am trying to change the value of a set of text boxes (that
I am trying to find rows that have duplicate values, but only based off

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.