Receiving value over serial and displaying on 4-digit 7-segment LED

I want to read a JSON value and pass it to the arduino over the USB’s serial connection, then write it to a 7-segment display.

The following python script is reading the value:

import os
import sys
import serial
import time
import signal

import urllib
import json

PORT = '/dev/tty.usbmodem'
SPEED = 9600

connection = serial.Serial( PORT,  SPEED, timeout=0, stopbits=serial.STOPBITS_T$

while True:
        url = 'https://api.url.com'
        result = json.load(urllib.urlopen(url))
        writeme = result["value"]
        print writeme
        connection.write(str(writeme))
        time.sleep(5);

And the following runs on the arduino:

#include "SevSeg.h"

SevSeg myDisplay;
char writeme[7];
char inChar;
byte index=0;

void setup()
{
  Serial.begin(9600); 
  int displayType = COMMON_ANODE; 
  int digit1 = 12; 
  int digit2 = 11; 
  int digit3 = 10;
  int digit4 = 13;
  int segA = 2; 
  int segB = 4;
  int segC = 6; 
  int segD = 8; 
  int segE = 9; 
  int segF = 3; 
  int segG = 5; 
  int segDP= 7; 
  int numberOfDigits = 4;
  myDisplay.Begin(displayType, numberOfDigits, digit1, digit2, digit3, digit4, segA, segB, segC, segD, segE, segF, segG, segDP);
  myDisplay.SetBrightness(40);
}

void loop()
{
  delay(1000);
 
while (Serial.available() > 0) {  
 
  index = 0;
  while (index < 6) 
       {
           inChar = Serial.read(); 
           writeme[index] = inChar;
           index++;
       }
       Serial.flush();

  myDisplay.DisplayString(writeme, 0);
}
}

What I’m getting is the value flashes to the LED for a brief moment, and then takes 5 seconds to do it again.

How can I keep the value displayed on the LED?

No comment on the first bit of code, I assume it is fine anyway.

This might help with the second

http://playground.arduino.cc//Main/MAX72XXHardware

http://forum.arduino.cc/index.php?topic=172192.0