Coming from Matlab (new to python) I'm used to 'cheat' a bit setting varargin
manually in some cases... I need to adapt some code and would like to leave lines ASDF=...
and BSDF=...
unchanged. For this purpose I would want to set sys.argv[1]... can this be done and would this be considered bad practice?
#read ASDF and BSDF from a text file, with the section that is specified by the argument provided
if len(sys.argv) == 1:
sys.argv[1]='DEFAULT'
print('Using ' + sys.argv[1]):
ASDF = config.get(sys.argv[1],'ASDF');
BSDF = config.get(sys.argv[1],'BSDF');
elif len(sys.argv) == 2:
print('Using ' + sys.argv[1]):
ASDF = config.get(sys.argv[1],'ASDF');
BSDF = config.get(sys.argv[1],'BSDF');
else:
print('too many inputs, don''t confuse me...')
quit()