I have a path:

```
myPath = "C:\Users\myFile.txt"

```

I would like to remove the end path so that the string only contains:

```
"C:\Users"

```

So far I am using split, but it just gives me a list, and im stuck at this point.

```
myPath = myPath.split(os.sep)

```