On 2016-12-04 22:52, Steve D'Aprano wrote:
On Mon, 5 Dec 2016 07:26 am, DFS wrote:

$python program.py column1=2174 and column2='R'

Here is a simple script demonstrating the issue:


# --- program.py ---
import sys
print "argv:", sys.argv
print ' '.join(sys.argv[1:])



I haven't tested it on Windows, but on Linux it behaves as you describe (and
as Linux users will expect):

[steve@ando ~]$ python program.py column1=2174 and column2='R'
argv: ['program.py', 'column1=2174', 'and', 'column2=R']
column1=2174 and column2=R

[snip]

On Windows:

    py.exe program.py column1=2174 and column2='R'

gives:

    argv: ['program.py', 'column1=2174', 'and', "column2='R'"]
    column1=2174 and column2='R'

and:

    py.exe program.py column1=2174 and column2="R"

gives:

    argv: ['program.py', 'column1=2174', 'and', 'column2=R']
   column1=2174 and column2=R

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to