J.Ares
J.Ares

Reputation: 48

How to run a python script in a php file?

I have node js file that is running a python script. But I want to run the python script in a php file. Can anyone help me with it? I want to know the ways that don't use the functions like exec() or shell_exec() or so...

Upvotes: 0

Views: 160

Answers (1)

Michas
Michas

Reputation: 9428

Running a Python script is very similar to running a binary. There are many options, the simplest one:

http://php.net/manual/en/language.operators.execution.php

`python path/to/script`;

Few there are other function to look at:

  • exec
  • shell_exec
  • system
  • passthru

http://php.net/manual/en/ref.exec.php

Upvotes: 1

Related Questions