Python is removing my quotes!

Robert Dailey rcdailey at gmail.com
Tue Aug 21 12:27:21 EDT 2007


Thank you for your response. The back slashes work! It's a bit annoying; but
I have Microsoft to thank for that.

On 8/21/07, Gary Herron <gherron at islandtraining.com> wrote:
>
> Robert Dailey wrote:
> > Hi,
> >
> > Note: I'm using Python on Windows
> >
> > I have an application that allows a user to submit a password as a
> > command line parameter. The password of choice may contain any
> > characters the user wishes, including quotes. If I do the following:
> >
> > python password.py "9999"MyPassword
> >
> > The resulting output when I print this inside the script is:
> >
> > 9999MyPassword
> >
> > Notice how the quotations have been stripped. Is it DOS doing this, or
> > Python? Is there a way I can fix it?
> >
> > Thanks.
>
> Not Python.  It never even sees those quotes.  Whatever system you are
> using for entering the text is stripping them.  Is it the command prompt
> (cmd.exe)?  If so then you can escape the quote by preceding it with a
> backslash.  (This is true of the DOS prompt and all the unix shells, and
> their windows ports, that I know about.)
>
> Gary Herron
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070821/347e464e/attachment.html>


More information about the Python-list mailing list