Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
problems executing python script via php

I'm running on windows. this is my python code:

import sys
import os
import json

def get_home_file_paths(directory):
    dir_paths = []
    for root, dirs, files in os.walk(directory):
        for name in dirs:
            dir_paths.append(os.path.join(root, name))
    return json.dumps(dir_paths)
if __name__ == '__main__':
    print get_home_file_paths(sys.argv[1])

and this, my php code:

<?php

$result = exec(" python get_files.py C:\wamp\www\pyth ");
echo $result;
$result_array=json_decode($result);
foreach ($result_array as $row){
    echo $row . "<br>";
}

?> 

I am pretty new at this. what am i doing wrong? i'm using wamp as server and i have note changed any configuration. thx!

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!