I am making a program to show git remotes, but this code just returns b''
>>> subprocess.run(
... "git remote",
... capture_output=True,
... shell=True,
... cwd=r'\Users\Andy\source\repos\PyPlus', stdout=subprocess.PIPE
... ).stdout
I also tried this, and this also returns b''
:
>>> subprocess.run(
... "git remote",
... shell=True,
... cwd=r'\Users\Andy\source\repos\PyPlus', stdout=subprocess.PIPE
... ).stdout
In PowerShell, this command works.
PS C:\Users\Andy\source\repos\PyPlus> git remote
origin
So why this does not work? Thanks for any ideas!