[Tutor] Example prog

Daniel D. Laskey dlaskey@laskeycpa.com
Sat, 26 Aug 2000 13:18:18 -0400

I recently purchased "Programming Python" and I'm working through the examples.
On page 83 Mark has a simple program called pack1.py.  What am I doing wrong?

Page 83, Programming Python

import sys
marker = '::::::'

for name in sys.argv[1:]:
	input = open(name, 'r')
	print marker + name
	print input.read(),

C:\python>python pack1.py *.txt > stuff.txt

Traceback (innermost last):
  File "pack1.py", line 5, in ?
    input = open(name, 'r')
IOError: [Errno 2] No such file or directory: '*.txt'

Daniel D. Laskey, CPA