class_docstr: The default viewer on macOS using ``Preview.app``.
class_docstr_tok: ["The","default","viewer","on","macOS","using","``","Preview.app","``","."]
docstr: Display given file
docstr_tok: ["Display","given","file"]
code: def show_file(self, file, **options):
      """Display given file"""
      fd, path = tempfile.mkstemp()
      with os.fdopen(fd, "w") as f:
          f.write(file)
      with open(path) as f:
          subprocess.Popen(
              [
                  "im=$(cat); open -a Preview.app $im; sleep 20; rm -f $im"
              ],
              shell=True,
              stdin=f,
          )
      os.remove(path)
      return 1
  
imports: import os
  import shutil
  import subprocess
  import sys
  import tempfile
  from shlex import quote
  from PIL import Image
label_desc: Use image node_id 2 for calling the MacViewer obj's underlying member method code with example usage: obj.show_file(file) and returns: int