IOError:pipe道破损
我得到了“IOError:[Errno 32] Broken pipe”,而在linux中编写文件。 我正在使用python来读取csv文件的每一行,然后写入数据库表。 我的代码是 f = open(path,'r') command = command to connect to database p = Popen(command, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env) query = " COPY myTable( id, name, address) FROM STDIN WITH DELIMITER ';' CSV QUOTE '"'; " p.stdin.write(query.encode('ascii')) *–>(Here exactly I got the error, p.stdin.write(query.encode('ascii')) IOError: [Errno 32] Broken pipe )* […]