import serial
import time

ser = serial.Serial('/dev/ttyACM1')	
ser.baudrate = 115200
print(ser.name) 
line = ser.readline()

print line

f = open("/home/omar/Imageprocessing/omar.gcode","r") #opens file with name of "test.txt"
m= "1"
while (m) :
	m=f.readline()
	print m
	line = ser.readline()

	ser.write(m) 
	time.sleep(1.5)

time.sleep(10)
ser.close()  
