Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
itsknk committed Nov 24, 2020
1 parent 28fcb9c commit c77466b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/pythonC.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ exports.executePython = function (envData , code , fn){
if(exports.stats)
{
if(err)
console.log('ERROR: '.red + err);
console.log('ERROR: '+ err);
else
console.log('INFO: '.green + filename +'.py created');
console.log('INFO: '+ filename +'.py created');
}
if(!err)
{
var command = 'python ' + path + filename +'.py';
var command = 'python3 ' + path + filename +'.py';
exec( command , function ( error , stdout , stderr ){
if(error)
{
Expand All @@ -33,7 +33,7 @@ exports.executePython = function (envData , code , fn){
{
if(exports.stats)
{
console.log('INFO: '.green + filename + '.py contained an error while executing');
console.log('INFO: '+ filename + '.py contained an error while executing');
}
var out = { error : stderr };
fn(out);
Expand All @@ -43,7 +43,7 @@ exports.executePython = function (envData , code , fn){
{
if(exports.stats)
{
console.log('INFO: '.green + filename + '.py successfully executed !');
console.log('INFO: '+ filename + '.py successfully executed !');
}
var out = { output : stdout};
fn(out);
Expand All @@ -61,9 +61,9 @@ exports.executeWithInput = function( envData , code , input , fn){
if(exports.stats)
{
if(err)
console.log('ERROR: '.red + err);
console.log('ERROR: '+ err);
else
console.log('INFO: '.green + filename +'.py created');
console.log('INFO: '+ filename +'.py created');
}
if(!err)
{
Expand All @@ -72,13 +72,13 @@ exports.executeWithInput = function( envData , code , input , fn){
if(exports.stats)
{
if(err)
console.log('ERROR: '.red + err);
console.log('ERROR: '+ err);
else
console.log('INFO: '.green + filename +'input.txt created');
console.log('INFO: '+ filename +'input.txt created');
}
if(!err)
{
var command = 'python ' + path + filename +'.py < ' + path + filename +'input.txt ' ;
var command = 'python3 ' + path + filename +'.py < ' + path + filename +'input.txt ' ;
exec( command , function ( error , stdout , stderr ){
if(error)
{
Expand All @@ -91,7 +91,7 @@ exports.executeWithInput = function( envData , code , input , fn){
{
if(exports.stats)
{
console.log('INFO: '.green + filename + '.py contained an error while executing');
console.log('INFO: '+ filename + '.py contained an error while executing');
}
var out = { error : stderr };
fn(out);
Expand All @@ -101,7 +101,7 @@ exports.executeWithInput = function( envData , code , input , fn){
{
if(exports.stats)
{
console.log('INFO: '.green + filename + '.py successfully executed !');
console.log('INFO: '+ filename + '.py successfully executed !');
}
var out = { output : stdout};
fn(out);
Expand Down

0 comments on commit c77466b

Please sign in to comment.