Skip to content

Instantly share code, notes, and snippets.

@renpytom
Created February 15, 2013 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renpytom/4963507 to your computer and use it in GitHub Desktop.
Save renpytom/4963507 to your computer and use it in GitHub Desktop.
init python:
def openpdf(fn):
import os.path
import subprocess
fn = os.path.join(config.gamedir, fn)
fn = renpy.fsencode(fn)
try:
if renpy.windows:
os.startfile(fn)
elif renpy.macintosh:
subprocess.Popen([ "open", fn ])
else:
subprocess.Popen([ "xdg-open", fn])
except:
if config.developer:
raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment