#18211: Computing Ehrhart polynomials with LattE
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.7
Component: geometry | Resolution:
Keywords: | Merged in:
Authors: Vincent Delecroix | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vdelecroix/18211 | b877932445212ddfd72fd70079c53f17df6d5fd9
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by ncohen):
> I also sorted out all other comments except [comment:20 comment:20]. If
I set `stderr` or `stdout` to something else than `PIPE` then I am not
able to get the result of the command back when doing
`process.communicate()`.
God. I had not noticed that you were reading the result from the output
`:-D`
With the code from [1] you can do whatever you want with the output:
{{{
sage: from subprocess import Popen, PIPE
sage: p = Popen("ls",stdout=PIPE)
sage: for line in iter(p.stdout.readline,''):
....: print line.strip()
}}}
And to check that it does not wait for the process to end, you can run a
'tail -f' on some (existing) temporary file
{{{
sage: p = Popen(["tail","-f","/tmp/eee"],stdout=PIPE)
sage: for line in iter(p.stdout.readline,''):
....: print line.strip()
}}}
A new line appears in python every time you type "echo artartaert >>
/tmp/eee" in a terminal.
[1] http://stackoverflow.com/questions/2804543/read-subprocess-stdout-
line-by-line
--
Ticket URL: <http://trac.sagemath.org/ticket/18211#comment:23>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.