Question: I am facing a peculiar issue while writing characters to Arduino using python serial communication on macOS 10.14.

The Arduino is programmed to read a string, parse it and take PWM action to run a car.

Ardiuno's serial communication channel is configured to receive the strings in the format `< A, B, C, D >` where `ABCD` are numbers which denote car direction, speed, steering direction and steering position. 

The problem is, when I send a string from the serial monitor or through the Python Development environment the string is received, parsed properly and command executed successfully.

However if I write a simple program in a file `write.py` and execute it from the command line, nothing happens.

```
import serial
ser = serial.Serial('/dev/cu.usbmodem14301', 9600)
data = '<1,150,0,0>'
ser.write(data.encode())

```

If I run this script from the macOS terminal using the command:

```
python write.py

```

nothing happens. What am I missing here?

Answer: 
try add `var _this= this;` use `_this.loadContent();`
or use `app.loadContent();`

```
getLocation(){
 var _this= this;
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(function(position) {
                this.position = position;
                _this.loadContent();
            }, function(error) {
                console.log(error);
            });
        }
    },

```
`this` refers to the object that called a function. In the present case, this is `navigator.geolocation`. You can override the calling object by calling `bind` on the function:

```
getLocation(){
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(function(position) {
            this.position = position;
            this.loadContent();
        }.bind(this), function(error) {
            console.log(error);
        });
    }
}

```