On this page
  1. os.pipe
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

os.pipe

Prev: os.open | Up: os | Next: os.putenv
Rel: os.abort, os.access, os.chdir, os.chmod
Ref: docs.python.org — os.pipe
Tags: #public #python3 #stdlib #os


Import

import os
from os import pipe

Signature & Overview

os.pipe()

Create a pipe.

Usage

import os

r_fd, w_fd = os.pipe()
try:
    os.write(w_fd, b"ping")
    assert os.read(r_fd, 4) == b"ping"
finally:
    os.close(r_fd); os.close(w_fd)

Gotchas

REPL Inspect

from os import pipe
help(pipe)

Linked from

Related notes