Tout d'abord à quoi correspond le ' ' vide au tout début ?
Pourquoi y a t'il deux backslashs \\ entre les répertoires ?
(sous windows normalement c'est un seul)
Ensuite j'aimerais ajouter un répertoire de façon définitive,
donc pas en utilisant sys.path.append(... après chaque ouverture
d'un shell.
J'ai lu qu'il fallait changer une variable $PYTHONFILE
mais ou exactement ? Je suis sous Windows Vista.
| sys.path: | | A list of strings that specifies the search path for modules. | Initialized from the environment variable PYTHONPATH, plus an | installation-dependent default. | | As initialized upon program startup, the first item of this list, | path[0], is the directory containing the script that was used to | invoke the Python interpreter. If the script directory is not | available (e.g. if the interpreter is invoked interactively or if | the script is read from standard input), path[0] is the empty | string, which directs Python to search modules in the current | directory first. Notice that the script directory is inserted before | the entries inserted as a result of PYTHONPATH.
L'explication est dans la doc, Ã
https://docs.python.org/3.3/library/sys.html
| sys.path:
|
| A list of strings that specifies the search path for modules.
| Initialized from the environment variable PYTHONPATH, plus an
| installation-dependent default.
|
| As initialized upon program startup, the first item of this list,
| path[0], is the directory containing the script that was used to
| invoke the Python interpreter. If the script directory is not
| available (e.g. if the interpreter is invoked interactively or if
| the script is read from standard input), path[0] is the empty
| string, which directs Python to search modules in the current
| directory first. Notice that the script directory is inserted before
| the entries inserted as a result of PYTHONPATH.
| sys.path: | | A list of strings that specifies the search path for modules. | Initialized from the environment variable PYTHONPATH, plus an | installation-dependent default. | | As initialized upon program startup, the first item of this list, | path[0], is the directory containing the script that was used to | invoke the Python interpreter. If the script directory is not | available (e.g. if the interpreter is invoked interactively or if | the script is read from standard input), path[0] is the empty | string, which directs Python to search modules in the current | directory first. Notice that the script directory is inserted before | the entries inserted as a result of PYTHONPATH.