2013/2/7 Caramel <
cwl...@gmail.com>:
>
> I have a python script which runs on linux , periodically counts records
> number in a DB table and write the result into a log file through python
> logging library functions.It will only stop counting after the record number
> becomes 0.It works quite well alone.
> Now I want to put the script directly into my robot framework case.
> But I find when I use "start process|python myscript.py", it always stops
> writing log file in the middle (170 counts in my last run), though the
> script is still running and there are still records in the DB table.
> When I use “run|python myscript.py", everything is OK.
Does your script create lot of output into stdout and/or stderr? That
could fill up output buffers of the process and prevent it from
continuing further. You could try redirecting stdout and/or stderr
into some file (or /dev/null if you aren't interested about the
output) and see does that help.
> As my previous comprehension, the difference of "run" and "start process" is
> that the former will wait for the execution to over, while the latter won't.
> Am I wrong? Can anyone give me a clue?
Yes, this is the main difference between Run and Start Process. They
are also implemented differently (the former uses os.popen and the
latter subprocess.Popen) and may thus behave differently in some
special cases.
Cheers,
.peke
--
Agile Tester/Developer/Consultant ::
http://eliga.fi
Lead Developer of Robot Framework ::
http://robotframework.org