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). T
On Friday 17 October 2008, mabshoff wrote:
> On Oct 16, 4:51 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
> > Hi:
>
>
>
> As pointed out popen is the easy way to go.
Try
sage; import commands
sage: commands.getoutput("ls")
'algebras\nall_cmdline.py\nall_notebook.py\nall.py\nall.pyc\ncalculus\
On Oct 16, 4:51 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
> Hi:
As pointed out popen is the easy way to go.
> Also, what is the proper way to do this? I'm guessing one should
> write wrapper classes as in the interfaces directory but is swig better?
I would suggest Cython :)
> - David J
David Philp 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
>
> ou
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 filenam