Re: optparse eats $

2011-04-19 Thread Michael Kent
Try this on your *nix command line: echo ">$100" On a *nix command line, the '$1' part of ">$100" will be seen as 'give me the value of the shell variable "1"', and since it has no value, will result in an empty string. So it's not optparse, or Python, because the literal string you intend to

Re: optparse eats $

2011-04-19 Thread Peter Otten
tazz_ben wrote: > So, I'm using optparse as follows: > > Command line: > python expense.py ">$100" -f ~/desktop/test.txt > ['>00'] > > > In Main: > > desc = '' > p = optparse.OptionParser(description=desc) > > utilities = optparse.OptionGroup(p, 'Utility Options') > utilities.add_option('--fi

Re: optparse eats $

2011-04-19 Thread John Gordon
In tazz_ben writes: > So, any ideas? Why is including a $ eating both the dollar signa and the 1? Unix command lines tend to assume any $ inside double-quotes is a shell variable name. Try enclosing in single-quotes instead. -- John Gordon A is for Amy, who fell down the

optparse eats $

2011-04-19 Thread tazz_ben
So, I'm using optparse as follows: Command line: python expense.py ">$100" -f ~/desktop/test.txt ['>00'] In Main: desc = '' p = optparse.OptionParser(description=desc) utilities = optparse.OptionGroup(p, 'Utility Options') utilities.add_option('--file', '-f', dest="file", help="Define