Level 74
What kind of python script do you want to run and what do you expect php to display?
If it's somthing more advanced I suggest porting it to php.
Summer Sale! All accounts are 50% off this week.
although laravel can get python simple script (example print ) , cannot run python import packages. how can call that i import these package python
# import the Binance client from python-binance module
from binance.client import Client
# import TA
from tradingview_ta import TA_Handler, Interval, Exchange
but warning
[{
"resource": "/c:/Users/PC/Desktop/cryptobot/main.py",
"owner": "_generated_diagnostic_collection_name_#2",
"code": {
"value": "reportMissingImports",
"target": {
"$mid": 1,
"external": "https://github.com/microsoft/pylance-release/blob/main/DIAGNOSTIC_SEVERITY_RULES.md#diagnostic-severity-rules",
"path": "/microsoft/pylance-release/blob/main/DIAGNOSTIC_SEVERITY_RULES.md",
"scheme": "https",
"authority": "github.com",
"fragment": "diagnostic-severity-rules"
}
},
"severity": 4,
"message": "Import \"tradingview_ta\" could not be resolved",
"source": "Pylance",
"startLineNumber": 3,
"startColumn": 6,
"endLineNumber": 3,
"endColumn": 20
}]
How can import python package in laravel .
public function index(){
$command = escapeshellcmd("C:\Users\PC\AppData\Local\Programs\Python\Python310\python.exe C:\Users\PC\Desktop\cryptobot\python.py");
$process = shell_exec($command);
return view('python',compact('process'));
}
Please or to participate in this conversation.