79114664

Date: 2024-10-22 14:58:32
Score: 1.5
Natty:
Report link

I have same issue.I checked some documents and I found the following solution: add a time.sleep after os.startfile.

import os

import sys

import time

os.startfile(r"D:/DEV/Python-Diverses/os/testb.png", "print")

time.sleep(5)

It works for me. Maybe it works for you too.

P.S I got this solution from the following page: https://www.geeksforgeeks.org/how-to-print-all-files-within-a-directory-using-python/

Reasons:
  • Whitelisted phrase (-1): works for me
  • Whitelisted phrase (-2): solution:
  • No code block (0.5):
  • Me too answer (2.5): I have same issue
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Postal