Parsing Command line arguments in python which has spaces

后端 未结 4 1215
借酒劲吻你
借酒劲吻你 2020-12-31 09:18

I am invoking the script from ant . I am getting it as a single string from the caller but python is strangely treating it as two individual strings.I have script that reads

4条回答
  •  甜味超标
    2020-12-31 09:42

    According to MS: https://msdn.microsoft.com/en-us/library/windows/desktop/17w5ykft(v=vs.85).aspx

    Backslashes are interpreted literally, unless they immediately precede a double quotation mark.

    I'm wondwring if Python on Windows uses this method: https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx

    To parse the command line to create sys.argv. In theory it should do it.

提交回复
热议问题