Skip to content

Instantly share code, notes, and snippets.

@colematt
Last active November 1, 2022 20:24
Show Gist options
  • Save colematt/bf37eca5cb84e9cd621c5e354e1c0e33 to your computer and use it in GitHub Desktop.
Save colematt/bf37eca5cb84e9cd621c5e354e1c0e33 to your computer and use it in GitHub Desktop.
[Check your python implementation from a running script] #python
#!/usr/bin/env python3
"""
File: python-check.py
Author: Matthew Cole
Date: 28 Nov 2016
"""
import sys, os
if __name__ == "__main__":
print("sys.version:", sys.version, file=sys.stderr)
print("sys.executable:", sys.executable, file=sys.stderr)
print("os.path.abspath:", os.path.abspath(sys.argv[0]), file=sys.stderr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment