File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 1- # Read problem description from a file
2- # the first line of the file is the question number.
3- # Generate an output file with the description included in a block comment
1+ #
2+ # Utility to generate code template for a question.
3+ #
4+ # Read problem description from a file.
5+ # The first line of the file is the question number.
6+ # Generate an output file with the description included in a block comment.
47# with each line less than 80.
5- # and create question and test functions for it .
8+ # and create question function and test function .
69#
7- # read from question.txt, write to daily.py
810def format_question (text : str , num : int , limit : int ) -> str :
911 output = '\n """\n question ' + str (num ) + "\n "
1012 cur_line = ""
@@ -61,4 +63,9 @@ def read_and_format(input_file, output_file):
6163 output_obj .write (output )
6264
6365
64- read_and_format ("src/question.txt" , "src/daily.py" )
66+ def generate ():
67+ read_and_format ("src/question.txt" , "src/daily.py" )
68+
69+
70+ if __name__ == "__main__" :
71+ generate ()
You can’t perform that action at this time.
0 commit comments