.pth in current directory: Why doesn't it work as the documentationsays?

  • Thread starter Philipp Hagemeister
  • Start date
P

Philipp Hagemeister

Where is the fault in my reasoning here?

1) According to http://docs.python.org/dev/install/, "The most
convenient way is to add a path configuration file to a directory that’s
already on Python’s path, (...).

2) Path configuration files have an extension of .pth, (...)"

1&2 => 3) A file test.pth with the content "/example/" should result in
sys.path containing "/example/".

4) "" (the current directory) is the first element of my sys.path

1&4 => 5) The current directory qualifies for "a directory that’s
already on Python’s path,"

1&3&5 => 6) echo /example/ > test.pth; python -c 'import
sys;print(repr(sys.path))' should contain '/example'.


I think I misinterpreted the documentation, but what exactly is wrong here?

Regards,

Philipp


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEAREKAAYFAkoRLxsACgkQ9eq1gvr7CFzGqgCgmw2k4ZDbTwOlxlb48vi9fchl
EgMAnRnX8mK3nhWu4iNBPRoIxb6x6Wvp
=q036
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top