improving performance of writing into a pipe

Oscar Benjamin oscar.j.benjamin at gmail.com
Tue Feb 19 06:15:34 EST 2013


On 19 February 2013 10:27,  <mikprog at gmail.com> wrote:
>> can work. As a few people already told you the built-in open()
>
>
> Few people?
> I thought Oscar was a singular person, not a group of people :-)

Serhiy also suggested it.

> Seriously, I am convinced by that approach (thanks) and I wish to go that way, but the problem I am getting now is that the open fails and then I can't go on.

Perhaps no-one has been explicit enough about what you should do here:

1) Remove all try/except from your code.
2) Run the code
3) Look at the *unadulterated* error message that Python prints out
4) Either fix the error if you know how or
5) Reply here posting the exact error message.

Also, in future:
6) Don't use bare try/except and don't catch errors while you're
debugging. Allow the errors to be printed as they are so that you can
read the message and see the line that triggers the error.
7) Don't post to a mailing list saying "I get an error", "I can see
errors" or "it doesn't work". If you have errors paste the exact error
message (all of it!). If you don't get errors but it doesn't do what
you want explain exactly what happened and also what you wanted to
happen. If you had followed this procedure at the start of this
thread, then you would already have a solution to (or at least an
explanation of) your problem by now.

> Also, I am now looking at the subprocess as os.popen seems deprecated.
> Any opinion on that?

I'm not convinced that either is appropriate for your problem.


Oscar



More information about the Python-list mailing list