stupid question about os.listdir

Ben Finney bignose-hates-spam at and-zip-does-too.com.au
Thu Jun 26 22:53:14 EDT 2003


On Fri, 27 Jun 2003 03:06:04 GMT, Jason Kratz wrote:
> Ben Finney wrote:
>> Please reduce the problem to a simple script
> 
> Ben...I tried the above in a new script file (with print os.listdir)
> and it works as I thought my other should.   Which means i'm doing
> something wrong when passing the path in to my function but I'm not
> sure what.  ugh.

Congratulations!  You've learned an immensely valuable debugging
technique:  Reduce the problem behaviour to the *minimum necessary code*
to reproduce the problem; otherwise, you're searhing in code that, it
turns out, has absolutely no bearing on the problem.

(This leads, in turn, to the principle that writing less code in the
first place leads to fewer bugs -- but that will come naturally as you
learn Python :-)

-- 
 \     "What if the Hokey Pokey IS what it's all about?"  -- Anonymous |
  `\                                                                   |
_o__)                                                                  |
http://bignose.squidly.org/ 9CFE12B0 791A4267 887F520C B7AC2E51 BD41714B




More information about the Python-list mailing list