Skip to content

Commit

Permalink
Merge pull request #204 from janmechtel/patch-1
Browse files Browse the repository at this point in the history
Update cfgfile.rst - boilerplate for script should add pkgs\ as sitedir to load all .pth
  • Loading branch information
takluyver committed Aug 31, 2020
2 parents 530996f + 719708f commit b65366e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/cfgfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ Application section
Ensure that this boilerplate code is at the top of your script::

#!python3.6
import sys
sys.path.insert(0, 'pkgs')
import sys, os
import site

scriptdir, script = os.path.split(__file__)
pkgdir = os.path.join(scriptdir, 'pkgs')
# Ensure .pth files in pkgdir are handled properly
site.addsitedir(pkgdir)
sys.path.insert(0, pkgdir)

The first line tells it which version of Python to run with. If you use
binary packages, packages compiled for Python 3.3 won't work with Python 3.4.
Expand Down

0 comments on commit b65366e

Please sign in to comment.