---
title: Python
slug: brcli-python
docTags: 
createdAt: 2023-03-08T03:24:55.000Z
---

:::CodeblockTabs
```python
import subprocess
import os
import sys

args = []
args.append('./BarcodeReaderCLI')
args.append('-type=code128')
args.append('https://wabr.inliteresearch.com/SampleImages/1d.pdf')
args.append('@./brcli-example.config')  # Additional options and sources in configuration file

cp = subprocess.run(args, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output=cp.stdout
error=cp.stderr

if output != "": print("STDOUT:\n" + output)
if error != "":  print("STDERR:\n" + error)
# print("RETURN CODE:"  + str(print(cp.returncode)))
```

brcli-example.config

```linux
# -silent
-type=code39
# image from URL
https://wabr.inliteresearch.com/SampleImages/1d.pdf
# image from local folder
./images/test.tif
```
:::

