Remove debug code.
Use os.path.join, and Python functions rather than system calls.
Use os.path.join and Python functions rather than os.system.