Re: empty stdout (subprocess.run)

2022-01-20 Thread James Smith
On Wednesday, January 19, 2022 at 11:14:28 PM UTC-5, cameron...@gmail.com wrote: > But I recommend you use shell=False and make: > > cmd = ["/usr/bin/transmission-remote", "--torrent", str(torrentno), "--info"] I like that. :-) -- https://mail.python.org/mailman/listinfo/python-list

Re: empty stdout (subprocess.run)

2022-01-20 Thread James Smith
On Wednesday, January 19, 2022 at 11:08:58 PM UTC-5, Dennis Lee Bieber wrote: > Don't you need to provide for that %s? Perhaps > > cmd="/usr/bin/transmission-remote --torrent %s --info" % torrentno That works, thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: empty stdout (subprocess.run)

2022-01-19 Thread Cameron Simpson
On 19Jan2022 19:16, James Smith wrote: >I'm trying to run a shell command but the stdout is empty: > >import subprocess > >torrentno=8 >cmd="/usr/bin/transmission-remote --torrent %s --info", str(torrentno) >res=subprocess.run(cmd, shell=True, check=True, universal_newlines=True,

Re: empty stdout (subprocess.run)

2022-01-19 Thread Dennis Lee Bieber
On Wed, 19 Jan 2022 19:16:19 -0800 (PST), James Smith declaimed the following: >I'm trying to run a shell command but the stdout is empty: > >import subprocess > >torrentno=8 >cmd="/usr/bin/transmission-remote --torrent %s --info", str(torrentno) Don't you need to provide for that %s?

empty stdout (subprocess.run)

2022-01-19 Thread James Smith
I'm trying to run a shell command but the stdout is empty: import subprocess torrentno=8 cmd="/usr/bin/transmission-remote --torrent %s --info", str(torrentno) res=subprocess.run(cmd, shell=True, check=True, universal_newlines=True, capture_output=True) print(res)