From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a37:27cd:: with SMTP id n196mr10881241qkn.144.1585941584723; Fri, 03 Apr 2020 12:19:44 -0700 (PDT) X-Received: by 2002:a4a:3306:: with SMTP id q6mr7824882ooq.81.1585941584323; Fri, 03 Apr 2020 12:19:44 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 3 Apr 2020 12:19:44 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=179.35.31.165; posting-account=TRgI1QoAAABSsYi-ox3Pi6N-JEKKU0cu NNTP-Posting-Host: 179.35.31.165 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Running a simple Python from Ada program From: "Rego, P." Injection-Date: Fri, 03 Apr 2020 19:19:44 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:58302 Date: 2020-04-03T12:19:44-07:00 List-Id: > > Do not do that. There exist Python C API, which you should use: > > https://docs.python.org/3/c-api/index.html > You mean that the problem is with the Python "print" ? I tested with a very simple C code. If the Python print is blocked, it should be blocked also from a C call, I presume (ok someone will contest, anyway). Any case, from the C call, it does not block. So I will try to simplify a bit the question. I want to do the equivalent of this #include #include int main(){ system("python testpy.py ddddd"); return 0; } In this case it does not block the testpy.py printouts. But I am doing this with Interfaces.C; use Interfaces.C; procedure systest2 is function Sys (Arg : Char_Array) return Integer; pragma Import(C, Sys, "system"); Ret_Val : Integer; begin Ret_Val := Sys(To_C("python testpy.py arg1 arg2")); end systest2; which blocks the testpy.py script until its end. This should not happen. So, please, how could I fix this?