Good day!

Faced such a problem:

TypeError: one character string expected

Swears here on this line:

v1 = Array('c', 'name1') 

where Array is:

 from multiprocessing import Array 

For an example I took an example from here :

 s = Array('c', 'hello world', lock=lock) 

I tried to change 'c' to c_char (as far as I understood, 'c' is some kind of abbreviated indication of the type ctype, although I did not find confirmation of this in the network). But the error is the same. How can you beat her?

  • Do you have exactly the second python and the error exactly in this line? - mkkik
  • Yes exactly. The line number is specified in the error ... In general, I solved the problem by replacing 'c' with c_char_p. But why refused to work the example of the office. I did not understand the documentation - Alexander
  • four
    Because you have written at the beginning of the file from __future__ import unicode_literals - andreymal
  • Yes exactly. Written) - Alexander

1 answer 1

Because you have written at the beginning of the file from __future__ import unicode_literals