Add return statement by default
This commit is contained in:
parent
bee6519919
commit
a311ea75f8
@ -10,7 +10,8 @@ import inspect
|
|||||||
|
|
||||||
def create_problem():
|
def create_problem():
|
||||||
with open(Problem, "w+") as f:
|
with open(Problem, "w+") as f:
|
||||||
template = inspect.cleandoc(f'''
|
template = inspect.cleandoc(
|
||||||
|
f"""
|
||||||
#=
|
#=
|
||||||
Created on {today}
|
Created on {today}
|
||||||
|
|
||||||
@ -29,6 +30,7 @@ def create_problem():
|
|||||||
=#
|
=#
|
||||||
|
|
||||||
# Your code goes here
|
# Your code goes here
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -36,19 +38,18 @@ def create_problem():
|
|||||||
@btime Problem{args['problem']}()
|
@btime Problem{args['problem']}()
|
||||||
println("")
|
println("")
|
||||||
println("Result for Problem $(lpad({args['problem']}, 3, "0")): ", Problem{args['problem']}())
|
println("Result for Problem $(lpad({args['problem']}, 3, "0")): ", Problem{args['problem']}())
|
||||||
''')
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
f.write(template)
|
f.write(template)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
|
|
||||||
today = datetime.datetime.now().strftime("%d %b %Y")
|
today = datetime.datetime.now().strftime("%d %b %Y")
|
||||||
parser = ArgumentParser(description=__doc__)
|
parser = ArgumentParser(description=__doc__)
|
||||||
# Add your arguments here
|
# Add your arguments here
|
||||||
parser.add_argument("-p", "--problem",
|
parser.add_argument("-p", "--problem", help="number of the problem to solve")
|
||||||
help="number of the problem to solve")
|
|
||||||
args = vars(parser.parse_args())
|
args = vars(parser.parse_args())
|
||||||
Problem = f"Problem{(args['problem']):0>3}.jl"
|
Problem = f"Problem{(args['problem']):0>3}.jl"
|
||||||
create_problem()
|
create_problem()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user