T
T
Timofey Shestakov2021-08-17 17:36:00
Python
Timofey Shestakov, 2021-08-17 17:36:00

How to fix a bug in Python code?

There is a line in the code to connect to the VM

ssh = subprocess.Popen("powershell putty.exe ", login, "@", name_server, " -pw", password, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)

When I run the file, I get an error
TypeError: __init__() got multiple values ​​for argument 'stdout'

Please tell me how to solve it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-08-17
@Vindicar

Why are there so many subprocess.Popen() arguments?
"powershell putty.exe ", login, "@", name_server, "-pw", password, - 6 pieces.
The documentation clearly says: "args should be a sequence of program arguments or else a single string or path-like object."
And also:
class subprocess.Popen(args,
#etc args without an asterisk, so it should be ONE argument i.e. a collection of strings, such as a list.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question