推荐学习书目
› 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
TESTFLIGHT2021
V2EX  ›  Python

请教在 Python 用中文的问题。。。

  •  
  •   TESTFLIGHT2021 · Nov 27, 2024 · 4406 views
    This topic created in 672 days ago, the information mentioned may be changed or developed.
    我在 c++中
    std::map<std::string, std::string> keywords;

    // 添加一些图例参数
    keywords["loc"] = "upper right"; // 设置图例位置
    keywords["title"] = "测试"; // 设置图例标题
    keywords["fontsize"] = "10"; // 设置字体大小

    // 调用 legend 函数
    plt::legend(keywords);

    其中测试那两个用中文,程序就闪退了。。。用英文字母没事
    请教如何解决啊?
    NoOneNoBody
        1
    NoOneNoBody  
       Nov 29, 2024
    这是 c++,怎么跑到 python 节点了?标题也是 python……
    TESTFLIGHT2021
        2
    TESTFLIGHT2021  
    OP
       Dec 1, 2024
    @NoOneNoBody C++调用 python 的
    NoOneNoBody
        3
    NoOneNoBody  
       Dec 1, 2024
    编码问题,C++传参、控制台、python 输出,三者编码不一致
    NoOneNoBody
        4
    NoOneNoBody  
       Dec 1, 2024
    python3 字符串为 utf-8 编码
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4583 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 05:49 · PVG 13:49 · LAX 22:49 · JFK 01:49
    ♥ Do have faith in what you're doing.