What's the difference between io.open() and os.open() on Python?

前端 未结 7 542
别那么骄傲
别那么骄傲 2020-11-30 05:34

I realised that the open() function I\'ve been using was an alias to io.open() and that importing * from os would oversha

7条回答
  •  独厮守ぢ
    2020-11-30 06:14

    os.open is very similar to open() from C in Unix. You're unlikely to want to use it unless you're doing something much more low-level. It gives you an actual file descriptor (as in, a number, not an object).

    io.open is your basic Python open() and what you want to use just about all the time.

提交回复
热议问题