stdout ist leer

stdout ist leer

Wenn Sie den Befehl ausführen:

cellprofiler --get-batch-commands "/users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5"

in der Shell bekomme ich eine Ausgabe:

CellProfiler -c -r -b -p /users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5 -g Metadata_Plate=20140602-LOPAC pilot_Assay Plate 0_5
CellProfiler -c -r -b -p /users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5 -g Metadata_Plate=20140602-LOPAC pilot_Assay Plate 0_6
CellProfiler -c -r -b -p /users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5 -g Metadata_Plate=20140602-LOPAC pilot_Assay Plate 0_7
CellProfiler -c -r -b -p /users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5 -g Metadata_Plate=20140602-LOPAC pilot_Assay Plate 0_8

Wenn ich jedoch versuche, es in eine Datei auszugeben (ich füge hinzu >test.txt), erhalte ich eine leere Datei. Ich habe auch versucht, den Befehl über Python aufzurufen und erhalte ebenfalls eine leere Standardausgabe. In beiden Fällen ist auch die Standardausgabe leer.

Was ist das Problem? Irgendwelche Ideen?

Antwort1

Manche Programme verhalten sich anders, wenn sie mit einem Terminal verbunden sind, als wenn sie es nicht sind (sieheisattyFunktion). Um der Anwendung vorzugaukeln, sie sei mit einem Terminal verbunden, können Sie Folgendes versuchen script -c:

script -c cellprofiler --get-batch-commands \
 "/users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5" \
  >test.txt

verwandte Informationen