Python/C API Problems executing python script
<p>I am using the python 3.3 c API, but I have been unable to find a way to load a script and execute it. The script test.py executes fine if i run it from command prompt, but when I try to run it from C++ code, I run into errors such as: NameError: name 'x' is not defined  printing into the console window of my application. The code that I'm attempting to use in order to run the python script is below. I'm almost wondering if it is some type of character encoding problem. </p>

<pre><code> Py_Initialize();
 FILE* PythonScriptFile = fopen("test.py", "r");
 PyRun_SimpleFile(PythonScriptFile, "test.py");
 fclose(PythonScriptFile);
 Py_Finalize();
</code></pre>

<p>Also, the python test file.</p>

<pre><code>print("test")
</code></pre>

<p>Anyone know what could be causing this?</p>
