Python Script-based alignment debug

Source: Internet
Author: User

First, this is a Python script

Import os;for I in range (0,20):    print ("Case:" +str (i));    Print ("randoming");    Os.system ("Randomdata.exe");    Print ("Running right mod");    Os.system ("Right.exe");    Print ("Running my mod");    Os.system ("My.exe");    Print ("Checking files");    Os.system ("Check.exe" +str (i+1)); Os.system ("pause");    

Os.system (order)--is equivalent to entering the order string under CMD.

Put the script in the specified folder

And then put

randomdata.exe--randomly generated data

right.exe--is generally a program to determine the correctness of the algorithm

my.exe--Self-validating program

checking.exe--Procedures for verifying two program answers

Randomdata.exe the generated input files in the Input.txt in the same folder.

Right.exe accepts input.txt as input and then outputs the run result to output.txt.

My.exe accepts input.txt as input and outputs the result to my.txt.

Check.exe accepts input.txt,output.txt as input and compares output results to log.txt.

By the way, check output to log is

Ofstream OutFile ("Log.txt", Ios_base::app);

In this case, each run output to log inside will add the current comparison of records, remember to save the wrong input file.

You can create a inputs folder, and then store it directly in the store.

Pass the run example number to the check using int main (int argc,char *argv)

Each time you save the running file, just use this to construct a new file name.

String filename=argv[1];

filename+= ". txt";

So you can.

Python Script-based alignment debug

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.