I am attempting to pipe something to a subprocess using the following line:
subprocess
p.communicate(\"insert into egg values (\'egg\');\"); TypeError: mu
You can convert it to bytes with encode method:
>>> "insert into egg values ('egg');".encode('ascii') # ascii is just an example b"insert into egg values ('egg');"