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

Python 如何实现系统调用

  •  
  •   ivito ·
    fireboyvt · Jul 24, 2015 · 3583 views
    This topic created in 3978 days ago, the information mentioned may be changed or developed.
    Python可以调用系统的很多功能是不争的事实,比如创建文件,比如网络通信。
    那python对系统的系统调用是如何实现的呢,是通过c语言编写的模块呢(Cython中)还是通过某一个bytecode做的呢?
    如果是通过c语言编写的模块,那么python是如何调用c函数的呢?
    6 replies    2015-07-26 12:46:44 +08:00
    Septembers
        1
    Septembers  
       Jul 24, 2015
    ctypes?
    noli
        2
    noli  
       Jul 24, 2015
    通过搜索引擎搜 Python C 就有答案了。无论是百度还是 Google 都有。
    qw7692336
        4
    qw7692336  
       Jul 25, 2015
    为什么没有人把系统调用封装成python呢?
    ivito
        6
    ivito  
    OP
       Jul 26, 2015
    @lululau 感谢回答,看来Python是把系统API封装成os模块了,那Python调用os模块的c编写的函数与调用py编写的函数有什么不同呢?

    @kinghui 这是提供给开发者的API,跟我提问的如何调用系统函数不是一回事啊
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5961 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 02:10 · PVG 10:10 · LAX 19:10 · JFK 22:10
    ♥ Do have faith in what you're doing.