Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #56854 > unrolled thread
| Started by | Florian Lindner <mailinglists@xgm.de> |
|---|---|
| First post | 2013-10-15 19:13 +0200 |
| Last post | 2013-10-15 19:13 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
Problem calling script with arguments Florian Lindner <mailinglists@xgm.de> - 2013-10-15 19:13 +0200
| From | Florian Lindner <mailinglists@xgm.de> |
|---|---|
| Date | 2013-10-15 19:13 +0200 |
| Subject | Problem calling script with arguments |
| Message-ID | <mailman.1099.1381857234.18130.python-list@python.org> |
Hello, I have a 3rd party perl script: head -n 1 /usr/sbin/ftpasswd #!/usr/bin/perl I want to write data to stdin and read from stdout: proc = Popen( ["/usr/bin/perl", "/usr/sbin/ftpasswd" "--hash", "--stdin"], stdout=PIPE, stdin=PIPE) output, input = proc.communicate(pwd) return output.strip() Since pwd comes from a non-trusted source I don't want to use shell=True. The arguments to the perl interpreter do not seem to right: Can't open perl script "/usr/sbin/ftpasswd--hash": No such file or directory Adding a leading " " to "--hash" does not help. How can I use that script and achieve something like # echo "123" | ftpasswd --hash --stdin ftpasswd: $1$8BuLAqCl$y/URBN/OCSLsKtnu8nFHH0 Thanks! Florian
Back to top | Article view | comp.lang.python
csiph-web