[Tutor] os.system() not working

wolfrage8765 at gmail.com wolfrage8765 at gmail.com
Wed Aug 28 14:16:56 CEST 2013


On Tue, Aug 27, 2013 at 6:33 AM, Nitish Kunder <ndk1991 at gmail.com> wrote:
> Hii
> I have a python program which i am calling from a php script.
> The arguments to the program is a path to the file
> The program when directly run from console executes normally.
> But when I try to execute the program from browser ie call the python script
> from php,
> os.system command is not working what might be the problem.
> Thanks

Due to the lack of context I am forced to think you must be slightly confused.
PHP is not Python.
Thus your PHP script can not execute the os.system() function, because
it does not exist in PHP, only in Python.
PHP equivalent would be exec() at least as far as I know, but use it
carefully and with caution.


More information about the Tutor mailing list