Custom ArgumentsParser to make the process of adding terminal args fast and easy.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
ArgumentsParser.py
README.md

README.md

Binary Torch Sdn. Bhd.

ArgumentsParser

Content

Custom ArgumentsParser to make the process of adding terminal args fast and easy.

Article

How to use Argument Parser in Python

Usage

  • step 1: import statement
from ArgumentsParser import ArgumentsParser
  • step 2: Define your arguments
args = [
	{
		"name" : "traning",
		"help" : "Path to traning data",
		"required" : True
	},
	{
		"name" : "testing",
		"help" : "Path to testing data",
		"required" : False
	}
]
  • step 3: create the object and call setup method
argumentsParser = ArgumentsParser()
data = argumentsParser.setup(args)
  • step 4: run from terminal:
python filename.py --traning traningpath --testing testingpath
  • step 5: accessing data
print(data["traning"])