diff --git a/std-script/judge b/std-script/judge --- a/std-script/judge +++ b/std-script/judge @@ -53,7 +53,7 @@ end language = ARGV[0] -if language != "c" && language != "c++" && language != "pas" && language != "java" && language != "ruby" +if language != "c" && language != "c++" && language != "pas" && language != "java" && language != "ruby" && language != "python" log "You specified a language that is not supported: #{language}." exit(127) end @@ -111,6 +111,7 @@ call_and_log("Cannot move the compiled program to #{test_result_dir}") { FileUtils.mv("a.out",test_result_dir) if language == "java" then Dir["*.class"].each { |file| FileUtils.mv(file,test_result_dir)} end + if language == "python" then Dir["*.pyc"].each { |file| FileUtils.mv(file,test_result_dir)} end } FileUtils.rm_rf("#{sandbox_dir}/.") end @@ -135,6 +136,7 @@ call_and_log("Cannot copy the compiled program into #{sandbox_dir}") { FileUtils.cp("#{test_result_dir}/a.out", sandbox_dir, :preserve => true) if language == "java" then Dir["#{test_result_dir}/*.class"].each { |file| FileUtils.cp(file,sandbox_dir)} end + if language == "python" then Dir["#{test_result_dir}/*.pyc"].each { |file| FileUtils.cp(file,sandbox_dir)} end } begin