I'm trying to get my Arduino to talk to PyCharm via serial port but it keeps throwing up the following error:
[Errno 20] could not open port /dev/tty/ACM0: [Errno 20] Not a directory: '/dev/tty/ACM0'
This is definitely the right port for the Arduino Uno, as confirmed by the Arduino IDE. In fact, the script works perfectly without issue using 'COM4' or similar on Windows. Unfortunately I need to move it over to linux and it doesn't seem to be a simple solve of substituting 'COM4' for '/dev/tty/ACM0'.
I've ran python -m serial.tools.list_ports to check that ports are found and it's returning 2 ports: /dev/tty/ACM0 and /dev/ttyS0 which is a good sign.
I've scoured the internet but can't seem to find any threads where someone has had this specific error code.
I'm not sure what it means by 'Not a directory' and what the workaround would be for this.
Any help would be greatly appreciated.
for archive purposes I'll post my solution to my own question, I've realised that I've mistyped /dev/tty/ACM0 instead of /dev/ttyACM0 in the  port name in the following line:
arduino = serial.Serial('portname', 115200, timeout=.1)
Serial port with arduino on PyCharm pyserial error - /dev/tty/ACM0 not a directory