Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8752111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:10:23+00:00 2026-06-13T13:10:23+00:00

i have already searched through google, and many refence, but i only see a

  • 0

i have already searched through google, and many refence, but i only see a complex example of coding, would you give me an example (In Simple Code) so i can understand.
I’ve already code it, but it breaks everytime i run it
Here’s the code

#include <Python.h>
int main()
{
  PyObject *pName, *pModule, *pDict, *pFun, *pValue;
  // Initialize the Python Interpreter
  Py_Initialize();
 // Build the name object
 pName = PyString_FromString("C:\\Documents and Settings\\MASTER\\My Documents\\Visual Studio       2010\\Projects\\Python\\Test.py");
if(pName)printf("OK");

// Load the module object
pModule = PyImport_Import(pName);

// pDict is a borrowed reference 
pDict = PyModule_GetDict(pModule);

// pFunc is also a borrowed reference 
pFun = PyDict_GetItemString(pDict, "prinTname");

if (PyCallable_Check(pFun)) 
{
    PyObject_CallObject(pFun, NULL);
} else 
{
    PyErr_Print();
}

// Clean up
Py_DECREF(pModule);
Py_DECREF(pName);

Py_DECREF(pDict);
Py_DECREF(pFun);
// Finish the Python Interpreter
Py_Finalize();
getchar();
return 0;
}

and there are some messages
First-chance exception at 0x1e00503b in Python.exe: 0xC0000005: Access violation reading location 0x00000004.
Unhandled exception at 0x1e00503b in Python.exe: 0xC0000005: Access violation reading location 0x00000004.
The program ‘[4548] Python.exe: Native’ has exited with code 0 (0x0).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:10:24+00:00Added an answer on June 13, 2026 at 1:10 pm

    You most likely have not installed python dev tools, i.e. python.h is never found. Locate python.h and look for compile errors and repost if there are some.

    Edit: This is old info. Including should be as easy as adding the include directory to the include directories, see: How do I get Visual Express 2010 to find my python.h header file?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already googled and searched stackoverflow but I can find nothing related to
So I have searched and browsed through the slug tag on SO and only
I have already searched through SO and could not fins a workable solution for
I am not very familiar with .htaccess and have already searched through the net
I have already searched from this question in SO. But none of the answers
I have already read some posts, but no one helped me with my problem.
Apologies if this has already been asked and solved but through numerous searches and
I searched through internet and this site as well but haven't found the answer.
I have tried some forum pages and searched through stackoverflow for the same thing,
I have a difficult problem. Difficult means I searched through the net and StackOverflow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.