« first day (1388 days earlier)      last day (3786 days later) » 

23:01
why hello again you beautiful people
looks about confusedly
I think you're in the wrong room
nope ;)
The room seems to go worringly odd in the wee hours of the morning..
:P
it's 7:00pm here
23:16
@IntrepidBrit what are you still doing up? :p
(says the guy still up)
@corvid Congratulations. I hate you for being awake at a sociable hour :p
@JonClements The joys of having international clients, and having recently made the mistake of giving said clients access to my development server - which somehow has become another primary production server...
(mind you, one could have seen that one coming a mile off)
What're YOU still doing up?
@IntrepidBrit oh geeze - you're sounding like me - not sure if I should be proud or really sad for you :)
@JonClements Do you have unit tests?
more than I'd like for various projects, yup
Then you should feel pity for me
This was one of those - "you guys could REALLY do with something like this"
Throws together an example
Which now has become a thing
That I have to maintain
le sigh
23:22
Awww.... throws @IntrepidBrit a scooby snack
@JonClements Does that mean I'm Shaggy? And you're Scooby?
That can't be right, Scooby wouldn't share their Scooby snacks...
I'm a very generous puppy?
@JonClements Fanks
Anyway - it is bed time now... see you tomorrow?
@JonClements I'll probably still be up :). It's gonna be one of those nights
23:27
don't envy you at all
have fun? :p
Will do my utmost
salutes
Hi all, I have a list, How can I check that the list doesn't have one element which is an empty string
something like,, if not (len(lst) == 1 and lst[0] == ''):
Is the act of checking important? Or do you just want rid of the empty strings?
If it's the latter then you could try something like:
[x for x in list if x]
if any(el == '' for el in your_list) is the other option
It is important. This will tell me the list is not empty then I can do something with it. By Not empty I mean, lst[''] >> this has len 1, but has empty string inside
23:42
@Alexxio Then @JonClements 's solution should do the trick
I might have lst['', 'fst', 'second']
@IntrepidBrit let me try it
Could just reverse it to if not all(your_list)... but I'm definitely going to bed now... night
How about check if the list has one element?
I want to discard any list which has one element and the element is empty string
like lst['', 'fst', 'second'] -- this is needed,,, lst[''] -- This is not needed
I have strings being generated and I have to check not to use any which looks like lst['']
@JonClements haha, liar :P
Sorry, back. Ubuntu hates my laptop battery. I get zero warning before it dies
hehe
23:49
@Alexxio Ah gotcha. To be honest, it's probably a bit suspect why you might be getting lists that only contain an empty string
@Alexxio in that case, if you're only concerned about a list that's populated by a single empty string, then:
if len(lst) == 1 and lst[0]: ...
awesome, now can we have a negation of that?
so that it will check and if the string doesn't meet, it passes
if not(len(lst) == 1 and lst[0]): ...
?
(mind you, one sec. Need to check if python enforces the order in which it executes if statements)
I had tried this
something like,, if not (len(lst) == 1 and lst[0] == ''):
ok
that's fine, it does what I thought it did
So, I don't get what you're actually wanting then?
For some unknown reason, It didn't work
23:56
If it's a valid list, then do something with it?
This is what I did
if not (len(lst) == 1 and lst[0] == ''):
print "ffffffffffffff'

when I gave it lst[''], it printed
It doesn't print at my end
So that means it didn't pass some other criteria
Like being length 0
Or a string containing whitespace/control characters
ah, this yours
if not(len(lst) == 1 and lst[0]):
is working!!!
:-D

« first day (1388 days earlier)      last day (3786 days later) »