I need this code to be converted to Python:
import [login to view URL];
import [login to view URL];
import [login to view URL];
import [login to view URL];
import [login to view URL];
public class RuntimeExec {
public StreamWrapper getStreamWrapper(InputStream is, String type){
return new StreamWrapper(is, type);
}
private class StreamWrapper extends Thread {
InputStream is = null;
String type = null;
String message = null;
public String getMessage() {
return message;
}
StreamWrapper(InputStream is, String type) {
[login to view URL] = is;
[login to view URL] = type;
}
public void run() {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(is));
StringBuffer buffer = new StringBuffer();
String line = null;
while ( (line = [login to view URL]()) != null) {
[login to view URL](line);//.append("\n");
}
message = [login to view URL]();
} catch (IOException ioe) {
[login to view URL]();
}
}
}
// this is where the action is
public static void main(String[] args) {
Runtime rt = [login to view URL]();
RuntimeExec rte = new RuntimeExec();
StreamWrapper error, output;
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader("[login to view URL]"));
for(String line; (line = [login to view URL]()) != null;) {
/*String x = "http [login to view URL] 8080"; */
Process proc = [login to view URL](new String[]{"bash","-c", "/root/carbonator-master/[login to view URL] " + line});
error = [login to view URL]([login to view URL](), "ERROR");
output = [login to view URL]([login to view URL](), "OUTPUT");
int exitVal = 0;
[login to view URL]();
[login to view URL]();
[login to view URL](3000);
[login to view URL](3000);
exitVal = [login to view URL]();
[login to view URL]("Output: "+output.message+"\nError: "+[login to view URL]);
}
} catch (IOException e) {
[login to view URL]();
} catch (InterruptedException e) {
[login to view URL]();
}
}
}
I have over 7 years of experience with Java and Python and can easily convert this for you within a day or 2. I can also document the code and provide you a third solution if you wish in C#, VC++ or even VB for extended service/support.
$111 USD en 2 días
0,0 (0 comentarios)
0,0
0,0
4 freelancers están ofertando un promedio de $147 USD por este trabajo
Hello,
Before you select a part time developer from here, take a look at fugacode.com. If you like what you see, contact us. That's all.
"Why hire freelancers? when you can hire professional developers for the same cost"
Regards,
FUGACODE Team