I want to be able to get the length of each line of a java file using python ignoring spaces and white space. I would eventually put each line length into an array. Take this java file: 

```
public class HelloWorld {

    public static void main(String[] args) {
         System.out.println("Hello world");
    } 

}

```

The array for this file would read: 

```
{22,34,33,1,1,}

```

what is the best way to go about this? I am more than capable of creating the array but how can I go about finding the length of each line?