template-python/README.md

43 lines
896 B
Markdown
Raw Normal View History

2023-01-07 10:24:29 +03:00
# template-python
2023-01-08 16:16:31 +03:00
Template repository for projects on python
2023-03-15 14:58:27 +03:00
* [`script.py`](https://git.hmp.today/pavel.muhortov/template-python#script-py)
2023-01-08 16:16:31 +03:00
____
2023-03-15 14:58:27 +03:00
2023-01-08 16:16:31 +03:00
## `script.py`
2023-03-15 14:58:27 +03:00
2023-01-08 16:16:31 +03:00
**Description:**
> returning current username if privileged rights are exist
> or
> returning error, if privileged rights are not exist
**Dependencies:**
2023-03-15 14:58:27 +03:00
>
> * Python 3 (tested version 3.9.5)
2023-01-08 16:16:31 +03:00
| PARAMETERS | DESCRIPTION | DEFAULT|
|-------------|-------------|--------|
2023-03-15 14:58:27 +03:00
|**[-s,--show]**|"" - execution with pauses.<br/>"qn" - execution without pauses.||
|**[-c,--conf]**|path to configuration file|`./script.conf`|
2023-01-08 16:16:31 +03:00
Example usage in terminal with Python on Linux:
2023-03-15 14:58:27 +03:00
2023-01-08 16:16:31 +03:00
```shell
2023-01-26 19:58:13 +03:00
python3 ./script.py
2023-01-08 16:16:31 +03:00
```
2023-03-15 14:58:27 +03:00
2023-01-08 16:16:31 +03:00
Example usage in terminal with make the script executable on Linux:
2023-03-15 14:58:27 +03:00
2023-01-08 16:16:31 +03:00
```shell
chmod u+x ./script.py
script.py -s qn -c ./script.conf
```
2023-03-15 14:58:27 +03:00
2023-01-08 16:16:31 +03:00
Example usage in terminal with Python on Windows:
2023-03-15 14:58:27 +03:00
2023-01-08 16:16:31 +03:00
```shell
2023-01-26 19:58:13 +03:00
python .\script.py
2023-01-08 16:16:31 +03:00
```