ココアアプリで次を実行しようとしています:
猫のPATHTOFILE | python -mjson.tool > OUTPUTFILE
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath: @"/bin/cat"];
NSArray *arguments = [NSArray arrayWithObject: path];
[task setArguments: arguments];
NSPipe *pipe = [NSPipe pipe];
[task setStandardOutput:pipe];
[task launch];
NSTask *task2 = [[NSTask alloc] init];
[task2 setLaunchPath:@"/usr/bin/python"];
NSArray *arguments2 = [NSArray arrayWithObject:[NSString stringWithFormat:@"-mjson.tool > %@.beautify", path]];
[task2 setArguments:arguments2];
[task2 setStandardInput:pipe];
NSPipe *pipe2 = [NSPipe pipe];
[task2 setStandardOutput:pipe2];
[task2 launch];
ただし、次のエラーが表示されます: /usr/bin/python: ファイル名によるインポートはサポートされていません。
何か案は?