You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
about: Add something to the documentation, delete it, or change it
4
+
title: ''
5
+
labels: documentation
6
+
assignees: pomponchik
7
+
---
8
+
9
+
## It's cool that you're here!
10
+
11
+
Documentation is an important part of the project, we strive to make it high-quality and keep it up to date. Please adjust this template by outlining your proposal.
12
+
13
+
14
+
## Type of action
15
+
16
+
What do you want to do: remove something, add it, or change it?
17
+
18
+
19
+
## Where?
20
+
21
+
Specify which part of the documentation you want to make a change to? For example, the name of an existing documentation section or the line number in a file `README.md`.
22
+
23
+
24
+
## The essence
25
+
26
+
Please describe the essence of the proposed change
What do you propose and why do you consider it important?
13
+
14
+
15
+
## Some details
16
+
17
+
If you can, provide code examples that will show how your proposal will work. Also, if you can, indicate which alternatives to this behavior you have considered. And finally, how do you propose to test the correctness of the implementation of your idea, if at all possible?
Here you can freely describe your question about the project. Please, before doing this, read the documentation provided, and ask the question only if the necessary answer is not there. In addition, please keep in mind that this is a free non-commercial project and user support is optional for its author. The response time is not guaranteed in any way.
The `suby`function returns an object of the `SubprocessResult` class. It contains the following required fields:
55
+
The `suby`module is a callable object and can be imported like this:
56
56
57
-
-**id** - a unique string that allows you to distinguish one result of calling the same command from another.
58
-
-**stdout** - a string containing the entire buffered output of the command being run.
59
-
-**stderr** - a string containing the entire buffered stderr of the command being run.
60
-
-**returncode** - an integer indicating the return code of the subprocess. `0` means that the process was completed successfully, the other options usually indicate something bad.
61
-
-**killed_by_token** - a boolean flag indicating whether the subprocess was killed due to [token](https://cantok.readthedocs.io/en/latest/the_pattern/) cancellation.
57
+
```python
58
+
import suby
59
+
```
62
60
63
-
The simplest example of what it might look like:
61
+
If you use static type checking and get an error that it is impossible to call the module, use a more detailed import form - functionally, these two import ways are identical:
64
62
65
63
```python
66
-
import suby
64
+
from suby import suby
65
+
```
66
+
67
+
Let's try to call `suby`. You can use strings or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path) objects as positional arguments, but now we call it with only simple strings:
67
68
69
+
```python
68
70
result = suby('python', '-c', 'print("hello, world!")')
You can use strings or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path) objects as positional arguments for `suby`.
75
+
We can see that it returns an object of the `SubprocessResult` class. It contains the following required fields:
76
+
77
+
-**id** - a unique string that allows you to distinguish one result of calling the same command from another.
78
+
-**stdout** - a string containing the entire buffered output of the command being run.
79
+
-**stderr** - a string containing the entire buffered stderr of the command being run.
80
+
-**returncode** - an integer indicating the return code of the subprocess. `0` means that the process was completed successfully, the other options usually indicate something bad.
81
+
-**killed_by_token** - a boolean flag indicating whether the subprocess was killed due to [token](https://cantok.readthedocs.io/en/latest/the_pattern/) cancellation.
0 commit comments