Develop a Python script that interacts with TensorFlow to train a neural network on the MNIST dataset. The script should include options to configure the number of hidden layers, neurons per layer, and activation functions.
Here's a Python script that uses TensorFlow to train a neural network on the MNIST dataset. The script allows you to configure the number of hidden layers, neurons per layer, and activation functions.

```python
import tensorflow as tf
from tensorflow.keras.datasets import mnist
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Flatten
from tensorflow.keras.utils import to_categorical

def create_model(hidden_layers, neurons_per_layer, activation_function):
    model = Sequential()
    model.add(Flatten(input_shape=(28, 28)))

    for _ in range(hidden_layers):
        model.add(Dense(neurons_per_layer, activation=activation_function))

    model.add(Dense(10, activation='softmax'))
    return model

def train_mnist(hidden_layers=1, neurons_per_layer=128, activation_function='relu', epochs=5):
    (x_train, y_train), (x_test, y_test) = mnist.load_data()

    x_train = x_train / 255.0
    x_test = x_test / 255.0

    y_train = to_categorical(y_train)
    y_test = to_categorical(y_test)

    model = create_model(hidden_layers, neurons_per_layer, activation_function)

    model.compile(optimizer='adam',
                  loss='categorical_crossentropy',
                  metrics=['accuracy'])

    model.fit(x_train, y_train, epochs=epochs, validation_data=(x_test, y_test))

if __name__ == '__main__':
    # Example usage: Train a neural network with 2 hidden layers, each with 256 neurons, using ReLU activation function.
    train_mnist(hidden_layers=2, neurons_per_layer=256, activation_function='relu')
```

You can modify the `hidden_layers`, `neurons_per_layer`, and `activation_function` parameters when calling the `train_mnist()` function to configure the neural network architecture.