Question: I have built a simple GUI that takes in unorganized HTML code and organizes it...now that I have it working finally I need to learn how to distribute it. I managed to create my .jar file but when I try to run it I get "Error: could not find or failed to load main class HTMLFormatter.class"

Here's what I did:

First, I went to my "bin" folder in my project directory and copied all the applicable class files into another separate folder (cause i didn't want to accidentally mess up my original class files). In that separate folder I also created manifest.txt which contains:

```
Manifest-Version: 1.0
Main-Class: HTMLFormatter.class
Class-Path: .

```

Then I ran this command from that directory: 

```
jar cfm HTMLFormatter.jar manifest.txt ./*.class

```

This created the JAR just fine, I used winrar to peek inside and it contained all the proper class files and the manifest was in META-INF directory. Then I tried to run it, first by double clicking, though I'm not even sure if that is SUPPOSED to work...Then I tried running it via command line using this command:

```
java -jar HTMLFormatter.jar

```

Which is when I got the error message. Then I read a post from this site that implied windows sometimes uses javaw instead... so i used the same command above with javaw and it didn't give me an error, but it still didn't produce my GUI.

So, what am I missing? also when I finally figure this out, should I be able to just double-click the jar file? (windows 8.1 64bit in case it matters)

Answer: 
The build-in `.npy` file format is perfectly fine for working with small datasets, without relying on external modules other then `numpy`.

However, when you start having large amounts of data, the use of a file format, such as HDF5, designed to handle such datasets, is to be preferred [[1]](https://stackoverflow.com/a/16660821/1791279). 

For instance, below is a solution to save `numpy` arrays in HDF5 with [PyTables](http://www.pytables.org/),

*Step 1: Create an extendable [`EArray`](http://www.pytables.org/usersguide/libref/homogenous_storage.html#the-earray-class) storage* 

```
import tables
import numpy as np

filename = 'outarray.h5'
ROW_SIZE = 100
NUM_COLUMNS = 200

f = tables.open_file(filename, mode='w')
atom = tables.Float64Atom()

array_c = f.create_earray(f.root, 'data', atom, (0, ROW_SIZE))

for idx in range(NUM_COLUMNS):
    x = np.random.rand(1, ROW_SIZE)
    array_c.append(x)
f.close()

```

*Step 2: Append rows to an existing dataset (if needed)*

```
f = tables.open_file(filename, mode='a')
f.root.data.append(x)

```

*Step 3: Read back a subset of the data*

```
f = tables.open_file(filename, mode='r')
print(f.root.data[1:10,2:20]) # e.g. read from disk only this part of the dataset

```
This is an expansion on Mohit Pandey's answer showing a full save / load example. It was tested using Python 3.6 and Numpy 1.11.3.

```
from pathlib import Path
import numpy as np
import os

p = Path('temp.npy')
with p.open('ab') as f:
    np.save(f, np.zeros(2))
    np.save(f, np.ones(2))

with p.open('rb') as f:
    fsz = os.fstat(f.fileno()).st_size
    out = np.load(f)
    while f.tell() < fsz:
        out = np.vstack((out, np.load(f)))

```

> 
> out = array([[ 0., 0.], [ 1., 1.]])
> 
> 
>