I\'m using python\'s ftplib to write a small FTP client, but some of the functions in the package don\'t return string output, but print to stdout.
ftplib
stdout
Use pipe() and write to the appropriate file descriptor.
pipe()
https://docs.python.org/library/os.html#file-descriptor-operations