On Wednesday, September 18, 2013 4:43:10 PM UTC+1, Carlos Córdoba wrote:
>
> Dave, could you post an example of the argument you are trying to pass? 
>
> El 18/09/13 10:40, Dave Hirschfeld escribió: 
> > In the RunConfig dialog I'm trying to pass to a script a command line 
> > argument which has a backslash in it. 
> > It seems that the backslash is getting converted to a forward slash, 
> > which in this instance doesn't make sense for the script in question. 
> > 
> > Is anyone else seeing this? 
> > 
> > I'm on the latest spyder checkout, python details: 
> > {'codename': 'An Afternoon Hack', 
> >  'commit_hash': 'af2a228', 
> >  'commit_source': 'repository', 
> >  'default_encoding': 'cp1252', 
> >  'ipython_path': 'c:\\dev\\code\\ipython\\IPython', 
> >  'ipython_version': '2.0.0-dev', 
> >  'os_name': 'nt', 
> >  'platform': 'Windows-7-6.1.7601-SP1', 
> >  'sys_executable': 'C:\\dev\\bin\\Anaconda\\python.exe', 
> >  'sys_platform': 'win32', 
> >  'sys_version': '2.7.5 |Anaconda 1.7.0 (64-bit)| (default, Jul  1 
> > 2013, 12:37:52) [MSC v.1500 64 bit (AMD64)]'} 
> > 
> > Thanks, 
> > Dave 
>
>
Sure - example below:

display_args.py
```

import sys


for arg in sys.argv:

    print arg

#
```
 
Run Settings -> Command line options: /Arg1:X /Arg2:Y /Arg3:X\Y

Press F5 

In [1]: runfile('C:/dev/code/sandbox/display_args.py', args='/Arg1:X 
/Arg2:Y /Arg3:X/Y', wdir='C:/dev/code/sandbox')

C:/dev/code/sandbox/display_args.py

/Arg1:X

/Arg2:Y

/Arg3:X/Y


In [2]:

So X\Y is being turned into X/Y in the runfile command. The args are the 
way they are because they're being passed on to a windows command line tool 
via subprocess and the tool expects forward slashes to denote arguments.

Thanks,
Dave

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to