Having this syntax error running python in windows command prompt.
Even if i type nothing and just hit enter it will still have syntax error. Only thing i can do is Ctrl+Z to exit. ( exit() doesnt work )
The command prompt is launched from a bat script that first sets a bunch of env vars then launches cmd. This bat file is called from a python gui via subprocess or os.system (both have the issue).
bat file set up in following way:
set PYTHONPATH=\some\path
...lots more env var setting (which is the purpose of this "custom" cmd
start /D "some/location" "cmd"
If i run the bat file directly by double clicking its fine.
running echo %PYTHONPATH% shows all the correct paths in both instances of launching (same for all other env vars)
I am wanting to launch it from a python gui for convenience with all environment paths set.
Any ideas whats going on?

-ucommand-line option, which is incompatible with the standard REPL on Windows. It putsstdinin binary mode. Thus CRLF from the console input doesn't get translated to the Unix-style LF line-endings that the REPL requires.shell=Trueruns the command withcmd.exe /c. That creates a console (conhost.exe process). You run the batch in that cmd instance to set up the environment, but then spawn a new shell in a second console window. That's not necessary. If you use the defaultshell=Falseand run the batch viacmd.exe /k, then you won't need to end with astartcommand. You can do everything in one shell and one console.