os.execl(sys.executable, sys.argv[0], *sys.argv)
The asterisk in the command is a wildcard that should not be taken literally.
The “l” and “v” variants of the exec* functions differ in how command-line arguments are passed.
References
https://stackoverflow.com/questions/11329917/restart-python-script-from-within-itself
https://docs.python.org/3/library/os.html#os.execl