os.popen is not really actively maintained, and I think has some minor defects that occaisonally come up, although for a simple program it probably doesn't matter. The best-supported and most robust way to do this without using something like Cython is the subprocess module (subprocess.Popen). There's a thread on this at:
http://mail.python.org/pipermail/python-3000/2008-April/013201.html in case someone's really interested. -M. Hampton On Oct 16, 11:22 pm, David Philp <[EMAIL PROTECTED]> wrote: > On 17/10/2008, at 10:51 AM, David Joyner wrote: > > > > > Hi: > > > I want to call a C program in Sage which is included with Sage > > (wtdist). > > What is the easiest way to do this? The line I'd like to execute > > looks like > > > wtdist filename::code > output.txt > > output_txt = os.popen('wtdist filename::code').readlines() > > I think that's all you need. I don't see anything improper with it. > > D --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
