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!