<pie_[bnc]>
gchristensen: int("".join([x for x in s if x.isalpha()])) ?
<pie_[bnc]>
not sure if the funciton name is correct
<pie_[bnc]>
anyway theres probably some reason this is terrib;e
<pie_[bnc]>
also not isalpha
<pie_[bnc]>
also instead of that maybe isint
<pie_[bnc]>
also all the ways it could go bad
<pie_[bnc]>
eh just use parser combinators ;P
<Guanin>
pie_[bnc], gchristensen I'd go with isdigit: int("".join([x for x in "foo19" if x.isdigit()]))
__monty__ has joined #nixos-chat
Taneb has joined #nixos-chat
Synthetica has joined #nixos-chat
psyanticy has joined #nixos-chat
drakonis has joined #nixos-chat
<monsieurp>
Guanin's solution is more elegant
<gchristensen>
which was that?
<Guanin>
gchristensen, int("".join([x for x in "foo19" if x.isdigit()]))
<Guanin>
But it was basically the one from pie_[bnc] with the correct filtering
<gchristensen>
ahh oops I missed that one
<gchristensen>
nice
<Guanin>
as far as I understand it, that one should be the most "pythonic" way
<Guanin>
As they prefer list comprehension over higher order functions
<adisbladis>
Guanin: It also performs about twice as well as the regex solution
<Guanin>
Yeah, regex is nearly never the way to go, in my opinion (not necessarily because it's slow, but because it's a hell to maintain for people not fluent in regex)
<eyJhb>
Anyone have experience with vim plugins in Python?
<eyJhb>
Guanin: also RegEx is easy to screw up
<monsieurp>
eyJhb: whats the actual question wrt vim + python?
<eyJhb>
monsieurp: well, basically I am trying to figure out the best way to combine vim+python, to make a simple plugin which takes the current word under the cursor, make a HTTP POST to a website, parses it, displays it using a menu, users chooses another one, another HTTP POST is made and then finally the word is replaced with the chosen one
<eyJhb>
So currently I am trying to 1. pass argument to a python function, 2. get the return value from that function (either string or dict)
<joepie91>
dear Lidl: perhaps it's time to invest in plastic air bags?
<samueldr>
haven't you heard? PLASTIC = BAD
<samueldr>
(only sith deal in absolutisms, etc)
mrCyborg has quit [Ping timeout: 260 seconds]
<eyJhb>
__monty__: synonyms :p
<eyJhb>
But I can't get ANYTHING to work
<eyJhb>
Also, the documentation is horrible
<eyJhb>
joepie91: I thought you had added a space between the brackets? <>
Synthetica has quit [Quit: Connection closed for inactivity]
mrCyborg has joined #nixos-chat
psyanticy has quit [Quit: Connection closed for inactivity]
drakonis has joined #nixos-chat
mrCyborg has quit [Quit: WeeChat 2.7]
wildtrees has joined #nixos-chat
arcnmx has quit [Ping timeout: 260 seconds]
<colemickens>
I don't know whether to be more upset at my battery or the fact that upower can't be told to leave my damn computer alone when the battery reports 1%>