title: python3 string.find() gives inconsistent results
body: <p>I am working on Greenhouse Monitor (like a weather station for my greenhouse). I'm using a Pi v3 wifi connected to house net with a bunch of sensors attached. The data is saved into an SQLite3 table and when queried sends the whole data base via sockets to my desktop. 
  I am packaging my data into strings like this on the server side</p>
  
  <pre><code>elif dataReq == 'query':
  
      conn = sqlite3.connect(table_name)
      curs = conn.cursor()
      curs.execute('SELECT * FROM ' + table_name)
  
      for row in curs.fetchall():
          timeStamp = row[0]
          Pressure = str(row[1])[0:6]
          Temperature = str(row[2])[0:5]
          Humidity = str(row[3])[0:5]
          Light = str(row[4])[0:6]
          Moisture = str(row[5])[0:3]
          dataPacket = '#' + timeStamp + ';' + Pressure + ';' + Temperature + ';' + Humidity + ';' + Light + ';' + Moisture + ';'
          BdataPacket = dataPacket.encode()
          C_sock.sendall(BdataPacket)
      curs.close()
      conn.close()
  C_sock.close()
  </code></pre>
  
  <p>The "#" separates readings/db rows and ";" separates individual sensor readings.</p>
  
  <p>Clientside I parse the data like this</p>
  
  <pre><code>    def parse_data(data):
  
          hsh = data.find("#", 0)
          while hsh != -1:
              Sta = hsh+1
              End = data.find(";", Sta)
              TimeStamp = data[Sta:End]
  
              Sta = data.find(";", hsh) + 1
              End = data.find(";", Sta)
  
              Pressure_str = data[Sta:End]
  
              Sta = data.find(";", End) + 1
              End = data.find(";", Sta)
  
              Temp_str = data[Sta:End]
  
              Sta = data.find(";", End) + 1
              End = data.find(";", Sta)
  
              Humidity_str = data[Sta:End]
  
              Sta = data.find(";", End) + 1
              End = data.find(";", Sta)
  
              Light_str = data[Sta:End]
  
              Sta = data.find(";", End) + 1
              End = data.find(";", Sta)
  
              Moisture_str = data[Sta:End]
  
              TimeStamp_L.append(TimeStamp)
              Pressure_L.append(float(Pressure_str))
              Temp_L.append(float(Temp_str))
              Humidity_L.append(float(Humidity_str))
              Light_L.append(float(Light_str))
              Moisture_L.append(float(Moisture_str))
              hsh = data.find("#", hsh + 1)
          return (Data_L)
  </code></pre>
  
  <p>The trouble is that when I hit the fetch button sometimes it works and sometimes it gives me errors suggesting that the parsing hasn't worked how it should.</p>
  
  <p>here are some of the final lines from the error reports</p>
  
  <p>ValueError: unconverted data remains: #2017-05-12 09:11:11.282566</p>
  
  <p>ValueError: could not convert string to float: '5#2017-05-11 20:23:02.949133'</p>
  
  <p>ValueError: could not convert string to float: '98#2017-05-12 02:26:15.497014'</p>
  
  <p>ValueError: time data '2017-05-11 17:48:31.#2017-05-11 17:35:59.425693' does not match format '%Y-%m-%d %H:%M:%S.%f'</p>
  
  <p>I cannot deduce any pattern in the errors, they happen first run, or fine for 5 then an error. Looks to me that .find() isn't working reliably - maybe someone knows better - or can fix this. </p>