If you are attempting to open Preview with a PDF or image from within Python, the following works. I have commented out the lines that involve returning data from the launched task. This will work with Apple's Python 2.7.17 in Catalina because it retains the scripting bridge, but not with Python 2.7 or v3.n.n from other sources.
#!/usr/bin/python
# coding: utf-8
from Foundation import NSString, NSPipe, NSTask, NSUTF8StringEncoding
import os
import sys
def main():
pdfpath = os.path.expanduser(sys.argv[1])
apath = NSString.alloc().initWithString_(pdfpath)
# pipe = NSPipe.pipe()
task = NSTask.alloc().init()
task.setLaunchPath_('/usr/bin/open')
task.setArguments_(["-a", "Preview", apath])
# only if task sending back results through pipe
# task.setStandardError_(pipe)
# afile = pipe.fileHandleForReading()
task.launch()
# only if task sending back results through pipe
# outStr = NSString.alloc().initWithData_encoding_(afile.readDataToEndOfFile(),
# NSUTF8StringEncoding)
# print(outStr.UTF8String().rstrip())
if __name__ == "__main__":
sys.exit(main())