[pythran] Re: pythran shell command

  • From: "jo" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "etaoinbe" for DMARC)
  • To: "pythran@xxxxxxxxxxxxx" <pythran@xxxxxxxxxxxxx>
  • Date: Fri, 11 Dec 2015 06:54:42 +0000 (UTC)

Am sorry I mean this:
[07:52:05][joos@alinuxbox:~/svn/pythran/$ cat y.py
import os
os.system("ls")
WARNING:root:No pythran specification, no function will be exported
CRITICAL I am in trouble. Your input file does not seem to match Pythran's
constraints...
E: Attribute 'system' unknown (y.py, line 2)
CRITICAL:pythran:I am in trouble. Your input file does not seem to match
Pythran's constraints...
E: Attribute 'system' unknown (y.py, line 2)
How can I add this functionality to my script so pythran is happy ? Am
currently replacing those calls with empty function blocks but somehow I will
have to get cpp code in there either by patching up the generated code or
linking to some other module that contains the necessary stuff (ie python
extension module (have no practical experience yet with that)
tx

From: serge guelton <sguelton@xxxxxxxxxxxxx>
To: pythran@xxxxxxxxxxxxx
Sent: Thursday, December 10, 2015 3:14 PM
Subject: [pythran] Re: pythran shell command

On Thu, Dec 10, 2015 at 02:08:31PM +0000, jo wrote:


isit possible on a linux box to callout to the shell ( like os.system) 

Yes, see

    https://docs.python.org/2/library/os.html#os.system

But the recommended way is

    https://docs.python.org/2.7/library/subprocess.html



Other related posts: