1

I create a png file and view it on macOS with

[...]
image.save("mandel.png", "PNG")
p = subprocess.run(["open", "mandel.png"], capture_output=True)
print(p.stdout.decode(),p.stderr.decode())

But what have I to choose for windows? "open" doesn't work on Win10.

Red-Cloud
  • 438
  • 6
  • 13

1 Answers1

0
[...]
image.save("mandel.png", "PNG")
p = subprocess.run(["start", "mandel.png"], capture_output=True)
print(p.stdout.decode(),p.stderr.decode())

You can use the start command in windows.

Reference:

http://www.frankworsley.com/blog/2007/9/24/open-a-file-in-the-default-application-using-the-windows-command-line-without-jdic

Adnan Ahmed
  • 466
  • 1
  • 6
  • 15