(Don't top-post. Put your response after the part you're quoting from earlier messages. And include enough that somebody can help with minimal effort.)

On 10/24/2011 12:30 AM, apometron wrote:
The problem is that it is not reporting any error.

The do something and quits silently.

No rename action is done and no error.

Running Python 2.7 on Windows Seven.

Your link http://pastebin.com/dExFtTkp shows two copies of the code. I'm assuming they're identical, and using the second one.

How do you know no rename action is done? Did you do a dir before and after running it? Were there any files that actually had underscores in them? Did you try adding a print to the innermost if statement to see if it ever ran? Did you try adding a print right after the os.rename that showed both nome and final?

When I run it in CPython 2.7 on Linux, it successfully renamed the file (dumm_1.txt) I had supplied.

davea@think:~/pytests$ ls
dumm_1.txt  itpone.itp~  lina.py~    pdbone.pdb~  prim.py~
itpone.itp  lina.py      pdbone.pdb  prim.py      whatswrong.py
davea@think:~/pytests$ python whatswrong.py dumm_1.txt
davea@think:~/pytests$ ls
dumm 1.txt  itpone.itp~  lina.py~    pdbone.pdb~  prim.py~
itpone.itp  lina.py      pdbone.pdb  prim.py      whatswrong.py
davea@think:~/pytests$

(I had to delete the following part, since you put yours out of order)



--

DaveA

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to