problems with file I/O while running python 3.2 scripts in windows cmd, but not in IDLE
<p>I am  a python noob, and am having problems running programs with open() functions  in cmd prompts. The code runs as expected in the python shell with IDLE, but everytime I open it by doubleclicking the icon coresponding to the script( I have .py associated with python), I get errors like </p>

<p><code>what file test.txt (I entered input)<br>
file 2 atest2.txt  (I entered intput)<br>
Traceback (most recent call last):<br>
File "C:\Users\Matthew\Desktop\file_io\find_differences_in_files.py", line 3,
in &lt;module&gt;<br>
    f=open(c,"r") # open c<br>
IOError: [Errno 22] Invalid argument: 'test.txt\r'</code></p>

<p>Similar problems occur in multiple similar programs, but here is a sample of code( FYI, this code finds the first difference in two .txt files) that worked in IDLE but not in cmd. Anybody have any clue what is going wrong?</p>

<pre><code>c=input("what file") # get file 1  
d=input("file 2") # get file 2  
f=open(c,"r") # open c   
g=open(d,"r") # open d  
p=f.readlines() # get every line of f   
q=g.readlines()   
i=0  
while i&lt;len(p) and i&lt;len(q):  
    if p[i]!=q[i]:   
        break # stop counting up  
    i+=1  
x=p[i] # store different line  
y=q[i] # store different line  
j=0  
while j&lt;len(x) or i&lt;len(y):       
    if x[j]!=y[j]:   
        break # stop counting up  
    j+=1  
print("The difference is in line %s column %s" % (i+1,j+1))  
c=input("press enter")
</code></pre>
