title: Python read character
body: <p>I would like to know how can I read the charaters into a buffer in Python?
  In C code, I can easy decralare the buffer character like <code>char buffer[256];</code>:</p>
  <pre><code>void read_char(int x, char buffer[], int *flag_stop) {
  int i, length;
  char character;
  
  i = 0;
  bzero(buffer, 256);
  
  do {
      if ((length = read(x, &amp;character, 1)) &lt;= 0) 
      {
          *flag_stop = 1;
          break;
      }
      buffer[i] = character;
      i++;
  }
  while(c != 0x0A);
  </code></pre>
  <p>}</p>
  <p>But I don't know how to do in Python so the code is something like this:</p>
  <pre><code>def read_char(x,buffer,**flag_stop):
  i = 0  
  buffer = np.array([], dtype='S64')  
  while True:  
      if os.read(x, character, 1) &lt;= 0: 
          **flag_stop == 1
          break
      buffer[i] = str(character)
      i=i+1
      if(character != 0x0A):  
          break
  </code></pre>
  <p>I have tried with numpy.chararray but I did not work. Any idea for this problem? thank you very much!</p>