This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Python.h" // should be before any standard headers | |
#include <errno.h> | |
#include <pthread.h> | |
static void* | |
non_python_thread(void *python_callback) { | |
//XXX without PyEval_InitThreads() it produces: | |
// Fatal Python error: PyEval_SaveThread: NULL tstate | |
//XXX with PyEval_InitThreads() it deadlocks!! | |
//XXX without PyGILState_*() (with/without PyEval_InitThreads()) it produces: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.pyc | |
*.pyo | |
__pycache__ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.pyc | |
*.pyo | |
__pycache__ | |
distance.py | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
SnapSearch.cgi | |
~~~~~~~~~~~~~~ | |
:copyright: 2014 by `SnapSearch <https://snapsearch.io/>`_ | |
:license: MIT, see LICENSE for more details. | |
:author: `LIU Yu <liuyu@opencps.net>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import requests | |
import sys | |
import time | |
from lxml import etree |