Skip to content

Instantly share code, notes, and snippets.

@fereria
Last active April 5, 2019 05:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fereria/4e2fdc2261af257a8b00edec44a74618 to your computer and use it in GitHub Desktop.
Save fereria/4e2fdc2261af257a8b00edec44a74618 to your computer and use it in GitHub Desktop.
global proc exec_python_file(string $py_path){
string $cmd[];
$fileId=fopen($py_path,"r");
string $nextLine = `fgetline $fileId`;
while ( size( $nextLine ) > 0 ) {
appendStringArray $cmd {$nextLine} 1;
$nextLine = `fgetline $fileId`;
}
string $exec_cmd = stringArrayToString($cmd,"\n");
python $exec_cmd;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment