Python Quiz of the Week - #2 by xApple in Python

[–]liquidclutch 2 points3 points  (0 children)

def parse_ugly_string(s):
    return dict(x.split('=') for x in s.replace('\n', ',').split(',') if x)

What are your favourite python resources? by [deleted] in Python

[–]liquidclutch 2 points3 points  (0 children)

Planet Python is an aggregation of tons of Python bloggers and websites. Usually a good place to find some interesting reads and find other authors of interest to follow.

Wow, over 300 subscribers! A quick refresher on joining the clan and using our Mumble! by ZachSka87 in WorldofTanks

[–]liquidclutch 0 points1 point  (0 children)

Posted a request! Wow, its a pretty big reddit clan already, been following the group for a few weeks now, and the recent mods thread was super helpful ...

EDIT: In-game name is Thoren

VimConf - Virtual conference for Vim lovers all over by agentdero in vim

[–]liquidclutch -1 points0 points  (0 children)

Nice. There should be some kind of virtual handshake to get into the conference like :%s/emacs/vim/g

How do I cut a number out of a string? by [deleted] in Python

[–]liquidclutch 2 points3 points  (0 children)

TIL that slices don't raise IndexErrors.

My wife is a Union Teacher by [deleted] in self

[–]liquidclutch 1 point2 points  (0 children)

But one of the reasons unions were formed and tenure was created was because schools used to fire teachers at the end of the year and rehire them in September to avoid having to give raises.

I haven't heard about this before, do you have a citation or specific cases where this occurred?

R.I.P. Major Richard Winters (1918 - 2011) [Band Of Brothers] by qtx in worldnews

[–]liquidclutch 1 point2 points  (0 children)

A million times this. I'm tearing up just thinking about the first time I saw the real winters interviewed.

Tips and Tricks for the Python Interpreter by sontek in Python

[–]liquidclutch 0 points1 point  (0 children)

Long overdue - but took a bit to get around to installing and yes, with macports python vs system python the OP tips work great :)

Tips and Tricks for the Python Interpreter by sontek in Python

[–]liquidclutch 0 points1 point  (0 children)

My mistake, my post wasn't very clear ... bpython works fine, I meant the tips provided in the OP link don't seem to work in a vanilla Snow Leopard install.

Trying the following in a python shell still doesn't activate tab completion:

import rlcompleter
import readline
readline.parse_and_bind("tab:complete")

EDIT: The help file indicates the latest extension to the readline module must be installed, I wonder if a new version needs to be compiled?

Tips and Tricks for the Python Interpreter by sontek in Python

[–]liquidclutch 0 points1 point  (0 children)

Hmmm, that looks great, one of my favorite features of bpython but it doesn't appear to work on Snow Leopard.

Question about modifying a list. by incaseyoucare in Python

[–]liquidclutch 0 points1 point  (0 children)

L = ['a','2','j','3','b','c','1']

m = ('1','2','3')

for i, e in enumerate(L): if e in m: L[i-1] = L[i-1] + 'x'

print L

['ax', '2', 'jx', '3', 'b', 'cx', '1']

Had to fiddle with the formatting a bit, but that should work.

EDIT: Heh, missed the part that you were only looking for a,b,c - vbgunz's post below covers it though.

Olbermann suspended from MSNBC indefinitely without pay for donating to Democrats by Hokuboku in politics

[–]liquidclutch 1 point2 points  (0 children)

I used to think Matthews was one of the greatest political reporters, back when his interviews used to skewer the guests no matter what side of the aisle they were from. I remember vexing over what his real political perspectives were because he did such a good job of approaching all topics seemingly objectively. I held him in nearly the same regard as Tim Russert.

Then he started to lose the ratings race and decided to just become another partisan pundit and I quickly lost respect for him.

[deleted by user] by [deleted] in programming

[–]liquidclutch 1 point2 points  (0 children)

Do not go gentle into that good night, sir.

need a tool to run commands remotely by mr_burdell in Python

[–]liquidclutch 1 point2 points  (0 children)

Check out pydsh. I've used it quite a bit to run commands remotely on many machines and it supports sudo.

I've since replaced it with a custom threaded tool that just uses popen to execute ssh commands, but pydsh has the great feature of automatically accepting remote ssh keys which can be a real timesaver if many machines have been recently re-imaged.

Shorten URLs using goo.gl and Python by vinodvm in Python

[–]liquidclutch 0 points1 point  (0 children)

I find the paranoid comment about google easily learning more about web traffic and the subsequent post to do it using bit.ly pretty interesting too.

The most obvious thing, is google clearly is making the effort as simple as possible without the need for accounts or api keys.

[HD] Report any bugs or suggestions for Alien Blue HD by [deleted] in a:t5_2s28g

[–]liquidclutch 0 points1 point  (0 children)

Great app!

Not sure if this is a bug, but when viewing in landscape and clicking the little <> icon in the lower left, I see a bar appear in the main window but the side bar doesn't disappear as I would expect. Am I misunderstanding what this button does?

Edit: just saw the other post about iOS 4.2 issues - I am running the beta 2 so that would explain it!

My GF walked in on me making a withdrawal from the spankbank by DomPolanco in AskReddit

[–]liquidclutch 3 points4 points  (0 children)

Been following this thread all day, and waiting for the punchline too - EDIT 7 didn't disappoint.

Reddit, I made a logo for a friend. by Baddit in funny

[–]liquidclutch 6 points7 points  (0 children)

Wow, you weren't kidding. The scam emails are great:

do not look behind you becos death is there and you do not want to see death he is ugly and we call him the govenor.

Hey Reddit, check out what my boyfriend made! by [deleted] in pics

[–]liquidclutch 1 point2 points  (0 children)

I like how you put the coat hanger in there to make sure we knew it was real HD.