How to call a Perl script from Python, piping input to it?

前端 未结 6 599
南方客
南方客 2021-01-01 01:21

I\'m hacking some support for DomainKeys and DKIM into an open source email marketing program, which uses a python script to send the actual emails via SMTP. I decided to go

6条回答
  •  离开以前
    2021-01-01 01:56

    "I'm pretty sure I can use something like os.system for this, but piping a variable to the perl script is something that seems to elude me."

    Correct. The subprocess module is like os.system, but provides the piping features you're looking for.

提交回复
热议问题