Question: I am trying to pass a column of numbers to a Python script to then convert into a `numpy` array.

**input.txt**

```
42
42.4
43.5153
44

```

**Bash Code**

```
python script.py ${input}

```

**Python Script**

```
#!/usr/bin/env python3
import sys
import numpy

in = sys.argv[1]

in_out = np.array([float(in)])
print "Inputs:" in_out

sys.exit()

```

**Python Error**

```
Traceback (most recent call last):
  File "script.py", line 8, in <module>
    in_out = np.array([float(in)])
ValueError: invalid literal for float(): 42

```

Answer: 
Like Shree comment, we can clear first the elements inside the class `shipping_street2`. Also, it is better to use `on` `keydown` so that when backspace was pressed the error message will remove as well. Here is my try.

```js
$(street2_id).on("keydown", function(e) {

  var street1_Length = $(street1_id).val().length;
  var street2_Length = $(street2_id).val().length;

  var total_street_char = street1_Length + street2_Length;

  if (total_street_char > 30) {
    $(".shipping_street2").html('');
    $(".shipping_street2").append('<div class="error"><span>Error Message</span></div>');
    $(street2_id).focus();
  } else {
    $(".shipping_street2").html('');
  }

});
```

```css
.error span {
  color: red;
}
```

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="shipping_street2"></div>
<input id="street1_id" type="text">
<input id="street2_id" type="text">
```
```
var once = false;

$(street2_id).bind("keypress", function(e) {

        var street1_Length = $(street1_id).val().length;
        var street2_Length = $(street2_id).val().length;

        var total_street_char = street1_Length + street2_Length;

        if(total_street_char > 30){
        if (!once || ! $('.street2_error_span').length) {
            $(".shipping_street2").append('<div><span>Error Message</span></div>');
            $(street2_id).focus();
            once = true;
            }

        }
    });

```

**[Reference](https://css-tricks.com/forums/topic/jquery-keypress-event-should-only-function-once/)**