Thread Python Skript Aufruf Asynchronous (9 answers)
Opened by Michael at 2022-01-06 18:04

Gast Michael
 2022-01-06 18:04
#194142 #194142
Servus, ich bräuchte mal eure Hilfe. Ich rufe in einem Perl Skript ein Python Skript auf. Allerdings bräuchte ich davon das STDERR. Da hänge ich momentan.

Hier mal der Code:
Code (perl): (dl )
1
2
3
4
5
6
7
8
my ($stdout, $stderr, $ret) = capture {
                system("$installfolder/bin/plugins/$psubfolder/cfc.py  --configfile $installfolder/config/plugins/$psubfolder/$psubfolder.json --logfile $logfile --loglevel $loglevel &");
            };
            
            if ($ret!=0) {
                    LOGINF "Python Skript STDERR $stderr";
                    exit(1);
            }


Es funktioniert nur, wenn ich das "&" am Ende entferne. Allerdings wartet dann das Perl Skript auf Beendigung des Python Skripts, bis das Perl Skript weiter verarbeitet wird.

Mit dem "&" funktioniert aber die Auswertung auf das STDERR nicht.

Gibts da eine andere Möglichkeit?
Last edited: 2022-01-06 18:27:30 +0100 (CET)

View full thread Python Skript Aufruf Asynchronous