Sorry if this post is a bit confusing to read this is my first post on this site and this is the difficult question I asked, I tried my best. I also tried Google search and I can not find anything.
I am trying to make my own command line as an application in python, and I would like to know how to split the line if "\" is not in front of the space and removes the backslash.
This is what I mean.
>>> c = "play song I\ Want\ To\ Break\ Free"
>>> print c.split(" ")
['play', 'song', 'I\\', 'Want\\', 'To\\', 'Break\\', 'Free']
When I break cinto a space, it retains the backslash, but removes the space. This is how I want it to be like this:
>>> c = "play song I\ Want\ To\ Break\ Free"
>>> print c.split(" ")
['play', 'song', 'I ', 'Want ', 'To ', 'Break ', 'Free']
If someone can help me, it will be great!
Also, if you need regular expressions, you could explain this more, because I have never used them before.
Edit:
, , , ?