Slide 20
Slide 20 text
ύΠϓʹΑΔ௨৴
import os
reader, writer = os.pipe()
if os.fork():
os.close(reader)
write_pipe = os.fdopen(writer, 'w')
write_pipe.write('Hello child!')
write_pipe.close()
else:
os.close(writer)
read_pipe = os.fdopen(reader, 'r')
message= read_pipe.readline()
read_pipe.close()
print(message)
pipe.py
$ python pipe.py
Hello child!
࣮ߦ
ϓϩηε
ࢠϓϩηε