The Py_Main function is the core of the python logic. It is from here that the parser, compiler and the interpreter bootstrap themselves. The initial part of this function contains the logic to setup various flags based on the command line arguments passed to the system. We are going to ignore this part and jump directly to the main part of this function located at line number 640 which is a call to the function PyRun_AnyFileExFlags.

Before we do this I would urge you to create a sample python file called and type a simple program with a couple of assignment statements and a print statement. Add a command line argument to your debug configuration as



One thought on “The Py_Main function

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s