pipe_to_execute_with_activated_venvΒΆ

Use should be able to execute shell commands in activated venv.

There are two (mutually exclusive) ways:

  • Specifying --command followed by a string arg (the string is to be interpreted by the shell).

    ./proto_code.py --command "exit 42"
    
  • Pipe-redirect output of a command to stdin.

    echo "exit 42" | ./venv_shell
    

The command is supposed to be executed in shell with activated venv.

See TODO_31_76_38_60.sub_command_for_shell.md: NOTE: At the moment, proto_code alone does not allow pipe-redirect (it only works with --command). In order to use pipe-redirect, use venv_shell from metaprimer module. The difference comes from the fact that proto_code SubCommand.command_boot does not start shell without --command. TODO: What if we use echo "exit 42" | ./proto_code.py --command?