The > operator always creates a file, even when the command fails (the file is opened before the command is run). After executing os.system(...) you must have test.pnm inside your home directory. It might be empty, but it must be there. If it's not, it means that os.system(...) gets never called.
That's exactly the problem, I can't find the file even though the scanner did the scan ! and also when I use a location path (/home/test.pnm) it gives me an error : cannot find /root/home/test.pnm : Directory nonexistance
>operator always creates a file, even when the command fails (the file is opened before the command is run). After executingos.system(...)you must havetest.pnminside your home directory. It might be empty, but it must be there. If it's not, it means thatos.system(...)gets never called.