[Tutor] code works in windows command but not ubuntu terminal

Steven D'Aprano steve at pearwood.info
Fri Jan 24 10:50:25 CET 2014


On Fri, Jan 24, 2014 at 04:22:20AM -0500, Keith Winston wrote:
> The file would appear to not be on your search path, that is, in any
> directory in which Python is expecting to find it.

Python does not use a search path for the open() function, only for 
imports. With open(), it uses a simple rule:

- absolute paths will look only in that exact location;

- relative paths are always relative to the current working directory.

Do you know the difference between absolute and relative paths?


-- 
Steven


More information about the Tutor mailing list