Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Python.h>
- int
- main(int argc, char *argv[])
- {
- wchar_t *program = Py_DecodeLocale(argv[0], NULL);
- if (program == NULL) {
- fprintf(stderr, "Fatal error: cannot decode argv[0]\n");
- exit(1);
- }
- Py_SetProgramName(program); /* optional but recommended */
- Py_Initialize();
- PyRun_SimpleString("from time import time,ctime\n"
- "print('Today is', ctime(time()))\n");
- if (Py_FinalizeEx() < 0) {
- exit(120);
- }
- PyMem_RawFree(program);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement