Use Python from env
This commit is contained in:
parent
737a382adf
commit
10981540ae
@ -3,15 +3,15 @@
|
|||||||
Creation of templates for the problems of Project Euler
|
Creation of templates for the problems of Project Euler
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
|
||||||
import datetime
|
import datetime
|
||||||
import inspect
|
import inspect
|
||||||
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
|
|
||||||
def create_problem():
|
def create_problem():
|
||||||
with open(Problem, "w+") as f:
|
with open(Problem, "w+") as f:
|
||||||
template = inspect.cleandoc(
|
template = inspect.cleandoc(
|
||||||
f'''#!/usr/bin/env python3
|
f'''#!/usr/bin/env python
|
||||||
"""
|
"""
|
||||||
Created on {today}
|
Created on {today}
|
||||||
|
|
||||||
@ -35,8 +35,7 @@ def create_problem():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
print(f"Result for Problem {args['problem']} is {{compute()}}")
|
||||||
print(f"Result for Problem {args['problem']}: {{compute()}}")
|
|
||||||
'''
|
'''
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -44,7 +43,6 @@ def create_problem():
|
|||||||
|
|
||||||
|
|
||||||
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user