vapoursynth/vapoursynth — pull request #115 by splinter98 (2014-11-05 18:48:15+00:00)
Title: Allow scripts to know if they are running under vapoursynth

Allows vapoursynth scripts to know if they are being run under vapoursynth, python or as a module.

This is based of the typical idiom that is used by python scripts when testing to see if itself is being executed directly or being imported from another script.

I find this useful as I tend to write scripts with functions so I can import them into bigger scripts but can also be run using the vsscript api like vspipe without modifying the code each time.

to use:
```Python
if __name__ == "__vapoursynth__":
#Script is being run under vapoursynth
clip.set_output()
elif __name__ == "__main__":
#Script has been called by Python
print(clip)
```