| 73 | } |
| 74 | |
| 75 | bool EmbeddedPython::runScript( const std::filesystem::path& path ) |
| 76 | { |
| 77 | if ( !isAvailable() || !isPythonScript( path ) ) |
| 78 | return false; |
| 79 | |
| 80 | std::ifstream ifs( path ); |
| 81 | std::ostringstream oss; |
| 82 | oss << ifs.rdbuf(); |
| 83 | ifs.close(); |
| 84 | std::string str = oss.str(); |
| 85 | return runString( str ); |
| 86 | } |
| 87 | |
| 88 | bool EmbeddedPython::isPythonScript( const std::filesystem::path& path ) |
| 89 | { |