Join the Stack Overflow Community
Stack Overflow is a community of 6.4 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I'm trying to pass an argument to python via windows command prompt, but am encountering the following error:

[Errno 22] Invalid argument

Command Prompt Code:

C:\Python27\python.exe "C:\Users\Apples\Documents\ArcGIS\Grapes\Blueberry_Cobbler\recipe.py C:\Users\Apples\Documents\ArcGIS\Grapes\Blueberry_Cobbler\input1.txt"

share|improve this question
    
try C:\Python27\python.exe "C:\Users\Apples\Documents\ArcGIS\Grapes\Blueberry_Cobbler\r‌​ecipe.py" "C:\Users\Apples\Documents\ArcGIS\Grapes\Blueberry_Cobbler\i‌​nput1.txt" – flau Aug 4 at 13:38
    
Thanks for getting back, sadly this didnt work, still throwing an error. – E. Weglarz Aug 4 at 13:40
    
The same error? – flau Aug 4 at 13:43
1  
You need the quotes as @iwin suggests. If you're still getting an error, edit your question to include the complete traceback. – eryksun Aug 4 at 13:43
1  
Thank you all, found the error traced back to missing one folder for the python.exe file. FIgures................ – E. Weglarz Aug 4 at 13:51

You are missing both a closing and opening "'s:

C:\Python27\python.exe 
"C:\Users\Apples\Documents\ArcGIS\Grapes\Blueberry_Cobbler\recipe.py" 
"C:\Users\Apples\Documents\ArcGIS\Grapes\Blueberry_Cobbler\input1.txt"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.