Skip to content

Instantly share code, notes, and snippets.

@michaelbartnett
Created May 1, 2011 22:18
Show Gist options
  • Save michaelbartnett/950938 to your computer and use it in GitHub Desktop.
Save michaelbartnett/950938 to your computer and use it in GitHub Desktop.
My PYTHONSTARTUP file
# Michael's PYTHONSTARTUP file
def dofile(filename):
import subprocess
import sys
process = subprocess.Popen([sys.executable, filename], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)
out, err = process.communicate()
print out
@michaelbartnett
Copy link
Author

PYTHONSTARTUP

This is my python startup file. Save it to disk and SET the environment variable $PYTHONSTARTUP to this filename.

Functions

dofile(filename)

Arguments

  • filename: Path to the python file to execute as a string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment