Can someone explain how Python's subprocess module communicates with Command Prompt?
Question: I am very new to programming and have been pouring over this site and others
to better understand how I can write a script in Python (version 3.4.1) that
does what I already know how to do in Command Prompt (version 6.3.9600).

In Command Prompt I can very easily type this (after the ">"):

    
    
    Z:\input\convertToRinex.exe Z:\input\74390010.T01
    

And everything works perfectly. The .T01 file is converted and the resulting
files appear in the input folder.

In Python I have no idea what I am doing. I've tried this:

    
    
    from subprocess import *
    call(['Z:\input\convertToRinex.exe', 'Z:\input\74390010.T01'])
    

And I get this error

    
    
    Error: CtrimbleFile - unable to open file:Z:\psm_rinex\inputU90010.T01Open
    

In a window that says Z:\input\convertToRinex.exe at the top. It happens so
fast that I had to use a screen recorder to read the error message.

I thought the list from Python would be translated into the exact same syntax
that already works in Command Prompt and the same thing would happen.

I am clearly missing something. Any advice would be greatly appreciated.


Answer: You need to escape the `\`, use forward slashes or use raw string `r`:

    
    
    'Z:\\input\\74390010.T01' # double \
    'Z:/input/74390010.T01' # forward / 
    r'Z:\input\74390010.T01' # raw string
    
    
    In [7]: print('Z:\input\74390010.T01')
    Z:\inputǣ90010.T01
    
    In [8]: print(r'Z:\input\74390010.T01')
    Z:\input\74390010.T01
    

`\` is used to
[escape](https://docs.python.org/2/reference/lexical_analysis.html#string-
literals) characters

