Script can't find input file despite being in the same directory

Chris Rebert crebert at
Fri Oct 17 19:27:24 CEST 2008

On Fri, Oct 17, 2008 at 10:07 AM, Robocop <bthayre at> wrote:
> I have a simple little script that reads in postscript code, appends
> it, then writes it to a new postscript file.  Everything worked fine a
> month ago, but after rearranging my directory tree a bit my script
> fails to find the base postscript file.
> The line in question is:
>  for line in fileinput.input(['']):
>    output.write(line)

What directory is output if you insert the lines:

from os import getcwd
print "CWD:", getcwd()

just before the line is question?

Follow the path of the Iguana...

> I'm kind of at a loss as the script is executing in the same directory
> as, yet it can't find it.  I'm relatively new to python
> scripting, so i'm expecting it's just something i haven't learned
> about python that is causing the problem.  Any suggestions would be
> greatly appreciated.
> --

More information about the Python-list mailing list