How to send a number to Arduino via Python over serial?
The python code 

j = text[i + 5]
print (j)
arduino.write(j)


Is sending a single text character between '0' and '9', ascii values 48 to 58.

The c code 

rx_byte = Serial.read(); //reading serial
switch (rx_byte) {
  case 0:


is looking for absolute values between 0 and 9.

There are two easy options to fix this, option 1 change the case statement to look for the correct values:

rx_byte = Serial.read(); //reading serial
switch (rx_byte) {
  case '0':


or option 2, rely on the fact that the ascii for the numbers is always 48 more than the number represented and subtract that:

rx_byte = Serial.read() - '0'; //reading serial
switch (rx_byte) {
  case 0:


-'0' and -48 would have exactly the same effect here only by using '0' it makes it clear we are offsetting by the ascii value of a 0 rather than by some other randomly created number. It also saves you having to remember what the correct value is for 0.

Generally since you are using the value in a case statement I'd recommend the first option, it's a little more intuitive and avoids an extra calculation that can look a little odd if you are new to programming.
The reason I mentioned the second option is that this is the method you would use if you wanted to use the rx_byte value as the index in an array for any reason.