Python script for testing encoder