stdazi:
The RE-based solutions look good. Here is a pair of alternative
solutions:
s1 = 'foo bar- blah/hm.lala'
r1 = ['foo', 'bar', 'blah', 'hm', 'lala']
s2 = 'foobbbar.. xyz'
r2 = ['foo', 'bbbar', 'xyz']
table = "".join((c if c.isalpha() else " " for c) in map(chr,
range(256)))
#table = ""
> I'm relatively new to python but I already noticed that many lines of
> python code can be simplified to a oneliner by some clever coder. As
> the topics says, I'm trying to split lines like this :
>
> 'foo bar- blah/hm.lala' -> [foo, bar, blah, hm, lala]
>
> 'foobbbar.. xyz' -> [foo, bbbar,
> I'm relatively new to python but I already noticed that many lines of
> python code can be simplified to a oneliner by some clever coder. As
> the topics says, I'm trying to split lines like this :
>
> 'foo bar- blah/hm.lala' -> [foo, bar, blah, hm, lala]
>
> 'foobbbar.. xyz' -> [foo, bbbar
Hello!
I'm relatively new to python but I already noticed that many lines of
python code can be simplified to a oneliner by some clever coder. As
the topics says, I'm trying to split lines like this :
'foo bar- blah/hm.lala' -> [foo, bar, blah, hm, lala]
'foobbbar.. xyz' -> [foo, bbbar, xyz]