Size: a a a

Сообщество Python Программистов

2021 February 15

БГ

Бензофуран Гетероцик... in Сообщество Python Программистов
Одна херня - с таким тут не помогут
источник

𝔞

𝔞𝔫1𝔟1$ 👾 афк до 17.0... in Сообщество Python Программистов
Бензофуран Гетероцикл
Ты удивишься, но в процедуре восстановления доступа нужна фотография с паспортом
фото со сканом и лицом, а то и по видеосвязи показывает это дело
источник

RC

Raniqubihe Cybohe in Сообщество Python Программистов
import subprocess

print(subprocess.run('uname -a'))
источник

RC

Raniqubihe Cybohe in Сообщество Python Программистов
ошибка
источник

RC

Raniqubihe Cybohe in Сообщество Python Программистов
как аргументы туда?
источник

БГ

Бензофуран Гетероцик... in Сообщество Python Программистов
Raniqubihe Cybohe
как аргументы туда?
Language:
py3


Source:
import subprocess
help(subprocess.run)


Result:
Help on function run in module subprocess:

run(*popenargs, input=None, timeout=None, check=False, **kwargs)
   Run command with arguments and return a CompletedProcess instance.
   
   The returned instance will have attributes args, returncode, stdout and
   stderr. By default, stdout and stderr are not captured, and those attributes
   will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
   
   If check is True and the exit code was non-zero, it raises a
   CalledProcessError. The CalledProcessError object will have the return code
   in the returncode attribute, and output & stderr attributes if those streams
   were captured.
   
   If timeout is given, and the process takes too long, a TimeoutExpired
   exception will be raised.
   
   There is an optional argument "input", allowing you to
   pass a string to the subprocess's stdin.  If you use this argument
   you may not also use the Popen constructor's "stdin" argument, as
   it will be used internally.
   
   The other arguments are the same as for the Popen constructor.
   
   If universal_newlines=True is passed, the "input" argument must be a
   string and stdout/stderr in the returned object will be strings rather than
   bytes.
источник

БГ

Бензофуран Гетероцик... in Сообщество Python Программистов
Raniqubihe Cybohe
как аргументы туда?
Language:
py3


Source:
import subprocess
print(subprocess.Popen.__doc__)


Result:
 Execute a child program in a new process.

   For a complete description of the arguments see the Python documentation.

   Arguments:
     args: A string, or a sequence of program arguments.

     bufsize: supplied as the buffering argument to the open() function when
         creating the stdin/stdout/stderr pipe file objects

     executable: A replacement program to execute.

     stdin, stdout and stderr: These specify the executed programs' standard
         input, standard output and standard error file handles, respectively.

     preexec_fn: (POSIX only) An object to be called in the child process
         just before the child is executed.

     close_fds: Controls closing or inheriting of file descriptors.

     shell: If true, the command will be executed through the shell.

     cwd: Sets the current directory before the child is executed.

     env: Defines the environment variables for the new process.

     universal_newlines: If true, use universal line endings for file
         objects stdin, stdout and stderr.

     startupinfo and creationflags (Windows only)

     restore_signals (POSIX only)

     start_new_session (POSIX only)

     pass_fds (POSIX only)

     encoding and errors: Text mode encoding and error handling to use for
         file objects stdin, stdout and stderr.

   Attributes:
       stdin, stdout, stderr, pid, returncode
источник

in Сообщество Python Программистов
Бензофуран Гетероцикл
Language:
py3


Source:
import subprocess
print(subprocess.Popen.__doc__)


Result:
 Execute a child program in a new process.

   For a complete description of the arguments see the Python documentation.

   Arguments:
     args: A string, or a sequence of program arguments.

     bufsize: supplied as the buffering argument to the open() function when
         creating the stdin/stdout/stderr pipe file objects

     executable: A replacement program to execute.

     stdin, stdout and stderr: These specify the executed programs' standard
         input, standard output and standard error file handles, respectively.

     preexec_fn: (POSIX only) An object to be called in the child process
         just before the child is executed.

     close_fds: Controls closing or inheriting of file descriptors.

     shell: If true, the command will be executed through the shell.

     cwd: Sets the current directory before the child is executed.

     env: Defines the environment variables for the new process.

     universal_newlines: If true, use universal line endings for file
         objects stdin, stdout and stderr.

     startupinfo and creationflags (Windows only)

     restore_signals (POSIX only)

     start_new_session (POSIX only)

     pass_fds (POSIX only)

     encoding and errors: Text mode encoding and error handling to use for
         file objects stdin, stdout and stderr.

   Attributes:
       stdin, stdout, stderr, pid, returncode
Засрал чат
источник

БГ

Бензофуран Гетероцик... in Сообщество Python Программистов
Засрал чат
Это не говно, это другое)
источник

in Сообщество Python Программистов
Raniqubihe Cybohe
как аргументы туда?
В доке всё есть, почему не читаешь?!?!
источник

RC

Raniqubihe Cybohe in Сообщество Python Программистов
я нагугил уже
источник

БГ

Бензофуран Гетероцик... in Сообщество Python Программистов
Raniqubihe Cybohe
как аргументы туда?
Ты вызываешь неправильно, если надо параметры пробросить то они передаются списком
источник

БГ

Бензофуран Гетероцик... in Сообщество Python Программистов
Raniqubihe Cybohe
я нагугил уже
Вот и молодец)
источник

RC

Raniqubihe Cybohe in Сообщество Python Программистов
subprocess.run('uname -a', shell=True)
источник

in Сообщество Python Программистов
Raniqubihe Cybohe
я нагугил уже
Надо сначала гуглить
источник

in Сообщество Python Программистов
Raniqubihe Cybohe
я нагугил уже
источник

БГ

Бензофуран Гетероцик... in Сообщество Python Программистов
Raniqubihe Cybohe
subprocess.run('uname -a', shell=True)
И это опять неправильно!🌚
источник

БГ

Бензофуран Гетероцик... in Сообщество Python Программистов
Raniqubihe Cybohe
subprocess.run('uname -a', shell=True)
subprocess.run(["uname", "-a"])
источник

БГ

Бензофуран Гетероцик... in Сообщество Python Программистов
Или
command = "uname -a"
subprocess.run(command.split())
источник

БГ

Бензофуран Гетероцик... in Сообщество Python Программистов
А ещё можно обойтись вызовом os.system
источник