I have a script that configures a Juniper router to my companies specifications. Nothing overly fancy it just follows the procedures they gave me. And reads in whatever file configuration is in a specified folder. Anyhow, the very last step in the procedure is to his Ctrl + D for end of transmission. Strangely, this problem seems to be unique to me, ^C and ^V seem to be common characters, but not ^D. I have tried /EOT. Does anyone know how this simple script would go about sending ^D? The code hangs on /EOT, which is why I'm guessing that I'm not expressing that character right.
ser.write ('root\r\n')
time.sleep(5)
ser.write ('cli\r\n')
ser.write('configure\r\n')
ser.write('top\r\n')
ser.write('load set terminal\r\n')
file = open('REDACTED', 'r+')
text = file.read()
ser.write(text + '/r')
ser.write('\n')
ser.write('\EOT')
ser.write('commit and-quit\r\n')
`