V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · 3624 views
    This topic created in 2334 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
        1
    ClericPy  
       Dec 5, 2019
    代码里不是全英文吧, 带上 # coding 那段 shebang
    snowfish
        2
    snowfish  
    OP
       Dec 5, 2019
    @ClericPy 有一些中文,代码头添加了 # -*- coding: UTF-8 -*-
    pyd 文件可以 import 用,但是 python pyd 就会报 encoding 的错
    weyou
        3
    weyou  
       Dec 5, 2019 via Android
    pyd 是 module 啊,不加-m 不行吧
    ClericPy
        4
    ClericPy  
       Dec 5, 2019
    随手搜了下, flask 有个 issue 也提到改成 python -m xxx.pyd 可以避免

    原来 2 3 楼你们说的是这个...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   867 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 22:03 · PVG 06:03 · LAX 15:03 · JFK 18:03
    ♥ Do have faith in what you're doing.