os.read() is a low-level function which takes a file descriptor, a small integer representing the opened file. os.popen() creates a high-level file object, the same type returned by the builtin open() function. Thus, to read n bytes from a pipe p created with os.popen(), you need to use p.read(n).

CATEGORY: library