How to make this simple code look better

Ganesh Pal ganesh1pal at gmail.com
Tue Oct 27 10:51:38 EDT 2015


> According to the format strings, 'ret' is a number. If that's the case,
> it's not a string, so ret != "" will always be true.
>
> Why are you wrapping the command string literals in (...)? That's not
> necessary.
>
> You're doing the same thing with each of the command strings, so why
> not put them into a list and then iterate over them? It'll save a lot
> of duplication.
>
> --

Thanks for pointing the ret !=""  error . It should be ret!=0 , yes
let me put into the string and try to iterate.



More information about the Python-list mailing list