So I've made a game in Python and PyGame. Now I'm interested in submitting the game to Intel's March Developer Challenge. However, the developer challenge requires use of Intel's Atom Developer SDK (http://appdeveloper.intel.com/en-us/sdk), which only has API's for C and C++.
I'm new to Python and PyGame, and have no experience in C or C++. My question is, would it be possible to somehow implement Intel's Atom SDK through/with/from a Python application (as the first link above suggests)?
I've read up a little bit on embedding/extending Python into/with C, but I'm not entirely sure what to embed or where. I mean, I know I can do things like this in C:
#include <Python.h>
int
main(int argc, char *argv[])
{
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print 'Today is',ctime(time())\n");
Py_Finalize();
return 0;
}
But what do I do about all my dependencies on Python and Pygame, for people that don't ha开发者_开发技巧ve those installed on their machines? Normally Py2Exe takes care of compacting the required dependencies (I've managed to package my game into an exe/zip), but how do I take care of that stuff in the context of embedding within C? Can I somehow work with py2exe on this, or do I need to do something entirely different for embedding within C?
It seems like it would be a lot easier to go the route of extending Python with the C validation code, rather than trying to embed my whole game within C, but I think that's not an option, "because the library provided is currently only available as a Visual Studio 2008 '.lib'", meaning the application has to be compiled with Visual Studio...?
Any help, thoughts, or ideas are much appreciated!
You can find the complete SDK Developer's Guide on the intel site above, but here is their "Hello World" using the C Language API:#include <stdio.h>
#include “adpcore.h”
int main( int argc, char* argv[] )
{
ADP_RET_CODE ret_code;
const ADP_APPLICATIONID myApplicationID = {{
0x12345678,0x11112222,0x33331234,0x567890ab}};
if ((ret_code = ADP_Initialize()) != ADP_SUCCESS ){
printf( “ERROR: exiting” );
exit( -1 );
}
if (( ret_code = ADP_IsAuthorized( myApplicationId )) == ADP_AUTHORIZED )
printf( “Hello World” );
else
printf( “Not authorized to run” );
exit 0;
}
35 Page SDK Developer Guide: http:// appdeveloper.intel.com/sites/files/pages/SDK%20Developer%20Guide.pdf
Don't drop down to bare C if you can help it. Write bindings using Cython.
精彩评论