Debug command line option

69 views
Skip to first unread message

NerdFever.com

unread,
Jul 23, 2012, 11:57:01 AM7/23/12
to spyd...@googlegroups.com
Apologies for the newbie question.

I'm trying to walk thru a directory tree that is passed on the command line (in Windows), for example:

c:>doit.py "C:\Users\dave\right here"

To debug that in Spyder, I did Run>Configuration... then put  "C:\Users\dave\right here" (including the quotes) into the "Command line options" box under General Settings.

If I do: 

A = sys.argv[2] 
B = 'C:\\Users\\dave\\right here'
os.walk(A)
os.walk(B)

Then only the os.walk(B) works.  That seems to be because

A contains "C:\Users\dave\right here" (including the quotes), and
B contains C:\Users\dave\right here

Is there a straightforward way to get rid of the double quotes?

(I'm not sure why, but sys.argv[1] and sys.argv[3] both get populated with empty strings, too.)

BTW - if I leave out the double quotes, then I get:

sys.argv[1] == C:\Users\dave\right

and

sys.argv[2] = here

...so that doesn't work too well.  I seem to need the double quotes to avoid the whitespace break.

anatoly techtonik

unread,
Jul 24, 2012, 4:17:36 AM7/24/12
to spyd...@googlegroups.com
Looks like a bug. It will be more useful if it is added to issue tracker.
Reply all
Reply to author
Forward
0 new messages