Skip to content

Commit 52a3feb

Browse files
author
Kyrylo
committed
Make python examples 3.6 compatible
1 parent 80a4b28 commit 52a3feb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

examples/python/snippets/barcode/detect_barcodes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from scanbotsdk import *
2+
from typing import List
3+
24

35
def scan_barcode(image: ImageRef):
46
configuration = BarcodeScannerConfiguration(
@@ -16,7 +18,7 @@ def scan_barcode(image: ImageRef):
1618
print_barcodes(result.barcodes)
1719

1820

19-
def print_barcodes(barcodes: list[BarcodeItem]):
21+
def print_barcodes(barcodes: List[BarcodeItem]):
2022
if not barcodes:
2123
print("No barcodes found")
2224
return

examples/python/snippets/document/crop_and_analyze.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import os
22
from scanbotsdk import *
33
from utils import create_image_ref
4+
from typing import Optional
45

5-
def crop_and_analyze(image_path: str, save_path: str | None = None):
6+
7+
def crop_and_analyze(image_path: str, save_path: Optional[str] = None):
68
with create_image_ref(image_path) as image:
79
# Configure scanner
810
config = DocumentScannerConfiguration()

0 commit comments

Comments
 (0)