[Python-Dev] r85028 - in python/branches/py3k: Doc/c-api/init.rst Include/pythonrun.h Modules/getpath.c PC/getpathp.c (original) (raw)
Lisandro Dalcin dalcinl at gmail.com
Wed Sep 29 19:43:10 CEST 2010
- Previous message: [Python-Dev] r85028 - in python/branches/py3k: Doc/c-api/init.rst Include/pythonrun.h Modules/getpath.c PC/getpathp.c
- Next message: [Python-Dev] r85028 - in python/branches/py3k: Doc/c-api/init.rst Include/pythonrun.h Modules/getpath.c PC/getpathp.c
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 27 September 2010 11:57, Georg Brandl <g.brandl at gmx.net> wrote:
Am 27.09.2010 07:32, schrieb kristjan.jonsson:
Author: kristjan.jonsson Date: Mon Sep 27 07:32:54 2010 New Revision: 85028
Log: issue 9910 Add a PySetPath api to override magic path computations when starting up python. Modified: python/branches/py3k/Doc/c-api/init.rst python/branches/py3k/Include/pythonrun.h python/branches/py3k/Modules/getpath.c python/branches/py3k/PC/getpathp.c Modified: python/branches/py3k/Doc/c-api/init.rst +.. cfunction:: void PySetPath(const wchart *) + + .. index:: + triple: module; search; path + single: path (in module sys) + single: PyGetPath() + + Set the default module search path. If this function is called before + :cfunc:
PyInitialize
then :cfunc: PyGetPath won't attempt to compute + a default serarch path but uses the provided one in stead. This is useful + if Python is being embedded by an application that has full knowledge + of the location of all modules. The path components should be separated + by semicolons. + + This also causessys.executable
to be set only to the raw program name + (see :cfunc:PySetProgramName
) andfor sys.prefix
and +sys.execprefix
to be empty. It is up to the caller to modify these if + required after calling :cfunc:PyInitialize
. + This needs a versionadded. Georg
Did you noticed " ... The path components should be separated by semicolons." ? I would expect os.path.pathsep, after all paths are not OS-independent.
-- Lisandro Dalcin
CIMEC (INTEC/CONICET-UNL) Predio CONICET-Santa Fe Colectora RN 168 Km 472, Paraje El Pozo Tel: +54-342-4511594 (ext 1011) Tel/Fax: +54-342-4511169
- Previous message: [Python-Dev] r85028 - in python/branches/py3k: Doc/c-api/init.rst Include/pythonrun.h Modules/getpath.c PC/getpathp.c
- Next message: [Python-Dev] r85028 - in python/branches/py3k: Doc/c-api/init.rst Include/pythonrun.h Modules/getpath.c PC/getpathp.c
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]