diff --git a/std-script/compile b/std-script/compile --- a/std-script/compile +++ b/std-script/compile @@ -147,20 +147,22 @@ end when "python" - command = "#{PYTHON_CHECKER} #{params[:source_file]}" - if system(command, out: params[:message_file]) + #command = "#{PYTHON_CHECKER} #{params[:source_file]}" + #if system(command, out: params[:message_file]) #compile to python bytecode command = "#{PYTHON_INTERPRETER} -c \"import py_compile; py_compile.compile('#{params[:source_file]}','#{params[:source_file]}c');\"" puts "compile: #{command}" - system(command) - puts "pwd: " + Dir.pwd - Dir.new('.').each {|file| puts file} - File.open(params[:output_file],"w") do |out_file| - out_file.puts "#!#{PYTHON_INTERPRETER} #{params[:source_file]}c" + system(command, err: params[:message_file]) + if FileTest.exists?("#{params[:source_file]}c") + puts "pwd: " + Dir.pwd + Dir.new('.').each {|file| puts file} + File.open(params[:output_file],"w") do |out_file| + out_file.puts "#!#{PYTHON_INTERPRETER} #{params[:source_file]}c" + end + File.chmod(0755, params[:output_file]) + FileUtils.cp("#{params[:source_file]}c",params[:output_file]) end - File.chmod(0755, params[:output_file]) - FileUtils.cp("#{params[:source_file]}c",params[:output_file]) - end + #end when "php" command = "#{PHP_INTERPRETER} #{PHP_OPTIONS} #{params[:source_file]}"