Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Peter Otten <__peter__@web.de> Newsgroups: comp.lang.python Subject: Re: optparse eats $ Followup-To: comp.lang.python Date: Tue, 19 Apr 2011 22:36:58 +0200 Organization: None Lines: 34 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: solani.org 1303245413 7812 eJwFwYEBwCAIA7CXmLOVnSOF/n/CErx8qLMJbhiOYWBGB12VtyouJctTZn7TKJu9ljCp1T9L4hMV (19 Apr 2011 20:36:53 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Tue, 19 Apr 2011 20:36:53 +0000 (UTC) X-User-ID: eJwNwokRwDAIA7CVwmMbxknSsv8I7UkIGq+SYGJ+dM4Dq051XrcoaWMcNWk6Zyg7SNnWkS/H2z2+otCK4Acc1ROn Cancel-Lock: sha1:1GK1G3OnftSrjMfe0KuAo9fJoKQ= X-NNTP-Posting-Host: eJwFwYEBwCAIA7CXmJY6zrGM/n/Cktx82AdMIp22aumC0yHz0NMDfIP5MmC132n4RvnF7lJEnaK1V3QuXq1KIdSq6uQPItkbIA== Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3589 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('--file', '-f', dest="file", help="Define the active > file to analyze", default='', metavar='""') > > (options, arguments) = p.parse_args() > > print arguments <- What is becoming ['>00'] > > > So, any ideas? Why is including a $ eating both the dollar signa and the > 1? It ain't optparse, it's your shell: $ echo ">$100" >00 $ echo '>$100' >$100 $