Scripts posted recently tagged to python in Kelpi

1- 10 of 121.

zodb and cherrypy working together

to python zodb cherrypy by nando.quintana

# easy_install ZODB3
# easy_install cherrypy
import cherrypy
import cgi
from ZODB import FileStorage, DB

launch a unix command from Python

to python unix linux command by nando.quintana

LOG_FILE_NAME = "access.log"
OLD_LOG_FILE_NAME = "old.log
from os import spawnlp, P_WAIT
spawnlp(P_WAIT, 'cp', 'cp', LOG_FILE_NAME, OLD_LOG_FILE_NAME)

Simple Twitter poster written in Python (with CLI)

to twitter python by saghul

#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import urllib2
import httplib

Simple Twitter poster written in Python

to twitter python by saghul

#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import urllib2
import httplib

remove CDATA from text using regular expressions

to regular expressions python cdata by nando.quintana

import re
content= """...<![CDATA[donostia-san sebastian]]>..."""
REGEXP = "<!\[CDATA\[(?P<text>[^\]]*)\]\]>"
regexp = re.compile(REGEXP)
content = regexp.sub('\g<text>',content)

discover if devmode is enabled in zope.conf

to python zope devmode config by nando.quintana

from zope.app.appsetup.appsetup import getConfigContext
def is_devmode_enabled():
    """Is devmode enabled in zope.conf?"""
    config_context = getConfigContext()
    return config_context.hasFeature('devmode')

Web orri baten kabezerak irakurri eta zein egoeratan dagoen jakiteko

to python http by jatsu

import httplib
def web_status(url):
    dominioa= url[url.find('/')+2:url.find('/',url.find('.'))]
    helbidea=url[url.find('/',url.find('.')):]
    conn =httplib.HTTPConnection(dominioa)

Python equivalent to "ls -lagFR"

to Recursively traverse list all hidden detailed files directories directory dir tree python equivalent ls -lagFR by anonymous

#!/usr/bin/env python
# Copyright 2008 by Aidin Abedi <fooguru@msn.com>
# Some parts are modifications of http://www.pixelbeat.org/talks/python/ls.py
# This script is essentially equivalent to "ls -lagFR"
# It recursively prints details of all (even hidden) files in a directory

language change form for django and jquery

to jquery django python by nando.quintana

<script type="text/javascript" src="/jquery-1.2.3.min.js"></script>
<script language="text/javascript" >
$(document).ready(function(){
  $("#languagecombo").change(function (){
    $("#languageform").submit()
hits counter