cnki-downloader.exe

It's a command-line program, so I thought it's the same as a normal Windows command-line program built by MSVC. My code is like this:

# coding=gbk

from subprocess import Popen, PIPE

p = Popen(["cnki-downloader.exe"], stdin=PIPE, stdout=PIPE)
#p = Popen(["WlanHelper.exe"], stdin=PIPE, stdout=PIPE )

p.stdin.write( 'XXXXXX
' )
result1 = p.stdout.read() # <---- we never return here
print result1

p.stdin.write( '1
' )
result2 = p.stdout.read()
print result2
Popencnki-downloader.exeWlanHelper.exe

So I suspect that the command-line mechanism of the Golang executable is different from a native C/C++ program, and it's difficult for other languages (like Python) to call and interact with it.

So I want to know how to interact with a Golang executable on Windows in other languages like Python?. If this is impossible, I can also consider modifying the Golang program's source code (because it's open source). But I hope I won't go that step. Thanks!

NOTE:

If possible, I want to call this Golang executable directly, instead of modifying it into a library and let Python import it. If I have to modify the Golang into a library, why not just remove the interactive manner and make everything into command-line parameters? There's no need to bother writing a Golang library. So please let's assume the Golang program is closed-sourced. I don't think there's no way for Python to call a command-line Golang program. If this is the case, then I think Golang REALLY needs to be improved in the interoperability with other languages.