Question about Print Header Info***PLEASE HELP***

John Roth johnroth at ameritech.net
Sat Aug 25 01:44:09 EDT 2001


"PMusselman" <test at pacbell.net> wrote in message
news:9LDh7.2431$Rn.140430 at news.pacbell.net...
> I am new to programming in Python.  I have a question about print headr
info
> and batch printing
>
> My boss has given me several CDs that need to be printed. He wants the
> hardcopy to contain the file path location and file name in the header.
The
> reason for this request is because there are files that contain the same
> file name on the cd but in different subdirectories.  I have not found a
> simple way to do this.  To make matters more diffcult the files are not
text
> or docs files.
>
> My question is there a way to create a script in Python to automatically
> print the file path/filename.  And is the a way to automate this process
for
> printing so I do not have to print each file automaically.  Any help would
> be great.

Yes, there is. Both "Learning Python" and "Programming Python" have sections
on common file and directory manipulation tasks. Directory search is one
of the more common. If you use a standard recursive descent algorithm to
scan the directory structure, then you simply pass the path *to that point*
to the next invocation, and let it append the next level. Works like a
charm,
and really has nothing to do with Python, per se.

Of course, if you have to invoke some other utility to do the printing (you
said
they are not .txt files), then you have to live with what that utility does
for
headers, or else fix the utility.

John Roth.

> Thanks
> Pat Musselman
>
>





More information about the Python-list mailing list