小编Rah*_*hul的帖子

在 Windows 中安装适用于 Python 的 thrift_sasl

我一直在尝试在 Windows 10 x64 中安装该thrift_sasl软件包pip

thrift_sasl取决于sasl软件包,但在运行pip install thrift_sasl或 时pip install sasl,我遇到了同样的错误。

creating build\temp.win-amd64-2.7\Release\sasl
C:\Users\user\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isasl -Ic:\python27\include -Ic:\python27\PC /Tpsasl/saslwrapper.cpp /Fobuild\temp.win-amd64-2.7\Release\sasl/saslwrapper.obj
saslwrapper.cpp
sasl/saslwrapper.cpp(247) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
error: command 'C:\\Users\\user\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
Run Code Online (Sandbox Code Playgroud)

该问题可能是因为 Visual C++ for Python 不支持较旧的 c 头文件。有人可以帮我安装吗?

编辑:我安装了 mingw,并尝试--compiler=mingw32 …

python mingw pip sasl visual-c++

5
推荐指数
1
解决办法
6512
查看次数

用Ajax传递dict的词典

我正在一个运行Django的网站上工作.我需要使用Ajax将数据从Javascript传递到我的Python代码.

这是我的代码:

// Javascript file
   function myFunc() {
        {...} // Generate var 'values' which is a dict of dict {{},{}...}
        console.log(JSON.stringify(values));
        $.ajax({
                url : "holt/",
                type : "POST",
                data : values,
                success : function (json) {
                   console.log(json)
                },
                error : function () {
                    alert("Error Ajax");
                }
            })
    }
Run Code Online (Sandbox Code Playgroud)

我在python中的看法:

  class getHolt(TemplateView):
        def get(self, request, *args, **kwargd):
            pass 
        def post(self, request, *args, **kwargd):
            if request.user.is_authenticated():
                data = dict(request.POST)
                h = Holt(data)
                response_data, success = h.get_holt(2021, no_freeze=True)
                return HttpResponse(
                    json.dumps(response_data),
                    content_type="application/json"
                ) …
Run Code Online (Sandbox Code Playgroud)

javascript python django ajax jquery

3
推荐指数
1
解决办法
3505
查看次数

标签 统计

python ×2

ajax ×1

django ×1

javascript ×1

jquery ×1

mingw ×1

pip ×1

sasl ×1

visual-c++ ×1