can't pass command-line arguments

Duncan Booth duncan.booth at invalid.invalid
Mon Apr 10 11:44:58 EDT 2006


Peter Hansen wrote:

> I thought of that one, of course, but it can't cause exactly the trouble 
> you describe above.  If there's a .py in the same folder as the .pyc, it 
> will not use the .pyc unless the timestamp encoded in it matches the one 
> on the .py file (which, unless you go to extraordinary lengths, will 
> never screw you up that way).
> 
> On the other hand, if there was a .pyc in the current directory when you 
> run it with "python cbfindfiles.py", but no cbfindfiles.py in the same 
> folder, it will run the local one and not the .py which might be 
> elsewhere, in your PATH.  Any chance there are cbfindfiles.py* files in 
> other folders or have you been doing this all from the same folder?

You missed the other option: if PATHEXT has .pyc in front of .py then you 
get exactly the described behaviour.

Of course that leaves open the question why anyone would want to put .pyc 
into PATHEXT.



More information about the Python-list mailing list