Created
October 10, 2014 15:22
-
-
Save metaperl/aedc900156b8f025539a to your computer and use it in GitHub Desktop.
parameter binding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm wondering if there is a Python module/class which aids parameter binding. The parameters will be bound from the command line and presumably set the parameters within a module, with the correct type, converting from the command line string to actual type | |
Here is a an example: | |
shell> share_trader.py | |
Welcome to Share Trader | |
======================= | |
parms: amount_to_spend=1000, symbol=None, stop_loss_percent=10, profit_percent=5 | |
Once all unbound parameters are bound, trading will begin: | |
share_trader_shell> amount_to_spend=500 | |
Parameter set. | |
parms: amount_to_spend=1000, symbol=None, stop_loss_percent=10, profit_percent=5 | |
share_trader_shell> symbol=RGDX | |
Parameter set. | |
All parameters bound. Beginning trading. | |
So the key question is: what module accepts a list of typed parameters and binds | |
them into an object with automatic type conversion? For instance `amount_to_spend` | |
gets set to a float while `symbol` gets set to a string. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment