I've found a great little piece of code to scan bar codes from an iOS device. If you would like to see the full code sample got to this link on the infragistics web page.
The code works really well, considering what the author basic premise is (scanning and interpreting bar codes). The only issue I am running into getting it to work perfectly on my iOS 13.3.1 iPhone and iPad, is when exiting the code the script directs a printout to the console of content of the variable 'found_codes'.
print ('All scanned codes:\n'), '\n'.join(found_codes)
This bit of code prints only the line 'All Scanned codes:' to the console.
I had modified this from the original code removing a + sign and inserting a comma (,)
print ('All scanned codes:\n') + '\n'.join(found_codes)
Pythonista protested with...
unsupported operand type(s) for +: 'NoneType'...
The code block that adds the bar code reading to 'found_codes is:
objects = ObjCInstance(_metadata_objects)
for obj in objects:
s = str(obj.stringValue())
if s not in found_codes:
found_codes.add(s)
I'm puzzled by the fact that replacing the plus sign with a comma, clears the error message but after doing that, the print to the console doesn't take place.
I will stress I'm relatively new to python and pythonista, so I may be missing something obvious to the rest of you.
Thanks!