Arduino Mega2560 resets every time I connect via USB

hichhiker:
Any suggestions on how to open the port without resetting the MCU?

With my Python programs I just open the serial port once, wait for the reset to complete, and keep the serial port open until the Python program is completely finished with the Arduino.

If it really is necessary to connect to the Mega without causing a reset then a simple way is to use a USB-TTL cable to connect directly to the Rx and Tx and GND pins. On a Mega you could connect to Rx1 and Tx1 (Serial1) and leave Serial free for uploading programs and debug messages.

...R
Python - Arduino demo