View xml2dict.py
# Simple xml to dict parser | |
# | |
# It's usable only for small documents due low performance | |
# comparing with lxml | |
from xml.etree import cElementTree as etree | |
from cStringIO import StringIO | |
def builder(ptag, attrib, pchild): | |
child = [] |
View tcolor.py
#!/usr/bin/env python2 | |
import sys | |
COLORS = [ | |
('16', '000000'), | |
('17', '00005f'), | |
('18', '000087'), | |
('19', '0000af'), | |
('20', '0000d7'), | |
('21', '0000ff'), |
View simple_notify.py
import sys | |
from subprocess import Popen, PIPE | |
def notify(title, body=None, timeout=-1, appname='simple-notify'): | |
cmd = [ | |
'dbus-send', | |
'--type=method_call', | |
'--print-reply=literal', | |
'--dest=org.freedesktop.Notifications', | |
'/org/freedesktop/Notifications', |
View nya.py
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
import re | |
import sys | |
import os.path | |
from urllib2 import build_opener | |
from urllib import urlencode | |
from lxml import html |
View vk-cli.py
#!/usr/bin/env python2 | |
import sys | |
import re | |
from urllib2 import build_opener, HTTPCookieProcessor | |
from urllib import urlencode | |
from cookielib import CookieJar | |
from netrc import netrc |
NewerOlder