I want to share a list with strings between processes, but unfortunately I get the error message "ValueError: character U + 169ea10 is not in the range [U + 0000; U + 10ffff]".
Here is the Python 3 code:
from multiprocessing import Process, Array, Lock
from ctypes import c_wchar_p
import time
def run_child(a):
time.sleep(2)
print(a[0])
print(a[1])
print(a[2])
print("SET foofoo barbar bazbaz")
a[0] = "foofoo"
a[1] = "barbar"
a[2] = "bazbaz"
lock = Lock()
a = Array(c_wchar_p, range(3), lock=lock)
p = Process(target=run_child, args=(a,))
p.start()
print("SET foo bar baz")
a[0] = "foo"
a[1] = "bar"
a[2] = "baz"
time.sleep(4)
print(a[0])
print(a[1])
print(a[2])
Does anyone know what I'm doing wrong?
Jonny Relationship
Jonny source
share