推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
snowfish
V2EX  ›  Python

请教个 pyd(cython 编译)的问题

  •  
  •   snowfish · Dec 5, 2019 · 4049 views
    This topic created in 2526 days ago, the information mentioned may be changed or developed.
    可以这样用不?
    >>python *.pyd
    自己编了一个这么运行提示
    SyntaxError: Non-UTF-8 code starting with '\x90' in file tmp\main.cp37-win_amd64.pyd on line 1, but no encoding declared;
    ClericPy
    ClericPy
    Dec 5, 2019
    1
    代码里不是全英文吧, 带上 # coding 那段 shebang
    snowfish
    snowfish
    OP
    Dec 5, 2019
    2
    @ClericPy 有一些中文,代码头添加了 # -*- coding: UTF-8 -*-
    pyd 文件可以 import 用,但是 python pyd 就会报 encoding 的错
    weyou
    weyou
    Dec 5, 2019 via Android
    3
    pyd 是 module 啊,不加-m 不行吧
    ClericPy
    ClericPy
    Dec 5, 2019
    4
    随手搜了下, flask 有个 issue 也提到改成 python -m xxx.pyd 可以避免

    原来 2 3 楼你们说的是这个...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2811 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:47 · PVG 21:47 · LAX 05:47 · JFK 08:47
    ♥ Do have faith in what you're doing.