Setup arguments, workflow
This commit is contained in:
1 parent
933153950e
commit
d93ee140f7
4 files changed
+41
-4
No files matched your search
Generated
+3
@@ -1,4 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.14" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.14" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
@@ -1,6 +1,23 @@
|
||||
def main():
|
||||
print("Hello from pyaoc!")
|
||||
import argparse
|
||||
|
||||
def main(day: int, test: bool = False) -> str:
|
||||
print("Called main...")
|
||||
print("Day is: {}".format(day))
|
||||
print("Testing: {}".format(test))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Advent of Code Event 2015 Python solutions'
|
||||
)
|
||||
parser.add_argument("-t", "--test", action="store_true")
|
||||
parser.add_argument(
|
||||
"-d",
|
||||
"--day",
|
||||
type=int,
|
||||
choices=range(1, 25),
|
||||
help="Integer day number to solve for (1-25)."
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
main(day=args.day, test=args.test)
|
||||
+3
-1
@@ -4,4 +4,6 @@ version = "0.1.0"
|
||||
description = "Add your description here"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.14"
|
||||
dependencies = []
|
||||
dependencies = [
|
||||
"argparse>=1.4.0",
|
||||
]
|
||||
@@ -2,7 +2,22 @@ version = 1
|
||||
revision = 3
|
||||
requires-python = ">=3.14"
|
||||
|
||||
[[package]]
|
||||
name = "argparse"
|
||||
version = "1.4.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/18/dd/e617cfc3f6210ae183374cd9f6a26b20514bbb5a792af97949c5aacddf0f/argparse-1.4.0.tar.gz", hash = "sha256:62b089a55be1d8949cd2bc7e0df0bddb9e028faefc8c32038cc84862aefdd6e4", size = 70508, upload-time = "2015-09-12T20:22:16.217Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f2/94/3af39d34be01a24a6e65433d19e107099374224905f1e0cc6bbe1fd22a2f/argparse-1.4.0-py2.py3-none-any.whl", hash = "sha256:c31647edb69fd3d465a847ea3157d37bed1f95f19760b11a47aa91c04b666314", size = 23000, upload-time = "2015-09-14T16:03:16.137Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyaoc"
|
||||
version = "0.1.0"
|
||||
source = { virtual = "." }
|
||||
dependencies = [
|
||||
{ name = "argparse" },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [{ name = "argparse", specifier = ">=1.4.0" }]
|
||||
Reference in new issue
Block a user