Why does this (very simple piece of) code does not work?

Chris Cioffi evenprimes at gmail.com
Mon Aug 16 15:20:24 CEST 2004


Just a guess here, but is ':' a valid filename character on your OS? 
Most OSes seem to have it reserved for system use.  Try using a
hyphen.

Chris

On Mon, 16 Aug 2004 15:03:51 +0200, jblazi <jblazi at hotmail.com> wrote:
> import os
> 
> L = os.listdir('.')
> 
> for x in L:
>    print '!'+x+'!'+x[0]
>    if x != 'rename.py':
>       y = 'Kapustin (Hamelin): '+x
>       os.rename(x,y)
> 
> I get
> 
> Traceback (most recent call last):
>  File "<stdin>", line 9, in ?
> OSError: [Errno 22] Invalid argument
> 
> TIA,
> 
> jb
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
> 


-- 
Still searching for an even prime > 2!



More information about the Python-list mailing list