If there's only one enter required, just use
echo and a pipe:
echo | python script.py
echo prints an empty line (with newline) to standard output, and then we redirect that into the input of the Python script using
|. When Python reads from standard input it will get an empty line and continue.
If the script wants more than one enter press, you can use the
yes command and a pipe:
yes "" | python script.py
yes command prints the same line to standard output over and over forever. By default the string is
y, but here we make it an empty string so it's just newlines forever.
If the enter is required as a response to a particular prompt, and at other times you need different input, use
expect, which is "a Tcl extension that lets you automate interactions with interactive programs".
It is possible to write your shell script so that it reads from Python's output and produces new input for it, but I don't especially recommend it. If you want to do that, see IO Redirection in the Advanced Bash Scripting Guide: you will need to clone file descriptors to do that. You can also use
mkfifo and make named pipe files, then read from and write to them normally.
To be honest, I would start thinking about alternative approaches if you're reaching the point of doing either of these approaches: shell scripting just isn't built for this and it'll be much more straightforward to write your script in, say, Python itself.