Skip to content

Instantly share code, notes, and snippets.

@sleaze
Last active September 23, 2022 15:09
Show Gist options
  • Save sleaze/e0d0d4d5a8f4c686b7b9d30ff14ea7eb to your computer and use it in GitHub Desktop.
Save sleaze/e0d0d4d5a8f4c686b7b9d30ff14ea7eb to your computer and use it in GitHub Desktop.

Revisions

  1. sleaze revised this gist Sep 23, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion dynamically_append_virtualenv_to_path.py
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,10 @@
    import os
    import sys

    try:
    import sqlite3
    import yaml
    except ImportError:
    import os
    # n.b. Dynamically activate virtualenv if needed.
    sys.path.append(os.path.realpath('%s/venv/lib/python3.6/site-packages' % os.path.dirname(__file__)))
    import sqlite3
  2. sleaze revised this gist Sep 23, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions dynamically_append_virtualenv_to_path.py
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@
    import sqlite3
    import yaml
    except ImportError:
    import os
    # n.b. Dynamically activate virtualenv if needed.
    sys.path.append(os.path.realpath('%s/venv/lib/python3.6/site-packages' % os.path.dirname(__file__)))
    import sqlite3
  3. sleaze created this gist Sep 23, 2022.
    8 changes: 8 additions & 0 deletions dynamically_append_virtualenv_to_path.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    try:
    import sqlite3
    import yaml
    except ImportError:
    # n.b. Dynamically activate virtualenv if needed.
    sys.path.append(os.path.realpath('%s/venv/lib/python3.6/site-packages' % os.path.dirname(__file__)))
    import sqlite3
    import yaml