The answer from @Stefan M is good, but is not quite like running a command within the screen, because when the command ends, the whole screen will end. If you actually run a command within the screen, then when it quits, you'll be left with a shell.
You can retain that shell with this:
screen -s "/bin/bash" -dmS myserver; screen -S myserver -X stuff "python myserver.py\n";
This will first launch the screen, with a shell, and then send some commands into that shell to run. This will behave exactly as if you typed those commands into the screen yourself.
A more elaborate script is available here: https://unix.stackexchange.com/a/766301/598166