[IPython-user] More Windows questions part 2 - \/ characters revisited
Ville Vainio
vivainio at gmail.com
Tue Aug 16 03:38:07 CDT 2005
On 8/16/05, Ville Vainio <vivainio at gmail.com> wrote:
> problems. I think it should be extended at least to shell aliases and
> (for consistency) to magics as well. Try them on your own box for a
Ok, I take the part about shell aliases and magics back because there
appears to be some complications regarding filenames with spaces.
example:
[group\foo]|67> ls
16.08.2005 10:51 <DIR> .
16.08.2005 10:51 <DIR> ..
16.08.2005 10:51 <DIR> foo bar
[group\foo]|68> !ls foo\ bar
ls: foo\: No such file or directory
ls: bar: No such file or directory
[group\foo]|69> cd foo\ bar
[foo\foo bar]|70>
So implementing just the ! form should be enough for the moment.
Interestingly:
[group\foo]|84> !ls 'foo bar'
ls: \foo bar': No such file or directory
[group\foo]|85> !ls "foo bar"
ls: \foo bar": No such file or directory
That's all I have time for ATM, perhaps the repr approach is not the
optimal one either. Perhaps using a triple quoted string with
additional empty char that is removed afterwards would do the trick.
i.e.
"hallo foo\"
Would mean
"""hallo foo\_"[:-1]
(note the trailing underscore which is deleted afterwards by
slicing... it's there to prevent syntax error if \ is the last char).
It's a bit of a funny hack, but will do the trick.
--
Ville Vainio ॐ http://tinyurl.com/2prnb
More information about the IPython-user
mailing list