import array

byte_array = array.array('B', uploaded_file_instance.read(uploaded_file_instance.size))
...

Python Django UploadedFile instanc...

by slimkrazy.myopenid.com, November 30, 2011 03:36, 1 refactoring, tagged with python, django, files, binary strings

A third party library requi...

55502f40dc8b7c769880b10874abc9d0 Talk
import sys
from random import randint
for i in range(1, 7):
...

Python 6 bit password generator

by https://www.google.com/accounts/o8/id?id=AItOawl3BeAhTXKYDpKI7ld64fgVwaukoKGEuUo, September 04, 2011 04:17, 5 refactorings, tagged with random, python

I needed 6 random(ish) bits...

55502f40dc8b7c769880b10874abc9d0 Talk
import sys 
from math import log 

...

Python Haar Transform

by talonx, June 16, 2011 11:33, No refactoring, tagged with speed, python, haar

Using a list for storing th...

Dc8678ff6917f939f852bea6e469b829 Talk
def to_bits(number):
  bit = 1
  bits = []
...

Python extract bits from number

by Shay Erlichmen, June 09, 2011 10:48, 3 refactorings, tagged with python, bitwise

extract the bits components...

B5b3262f246b9c41f5298adc62747d52 Talk
# This file is part of python-magento-api

# python-magento-api is free software: you can redistribute it and/or
...

Python Python Magento API

by omouse, May 27, 2011 18:20, 1 refactoring, tagged with python, api, magento

A Python-based API to the M...

0fc5485611721e78b1583657212a046a Talk
#/usr/bin/env python

__author__ = 'Luiz Augusto de M. Morais'
...

Python isprime

by https://profiles.google.com/luizaugustomm, April 13, 2011 19:22, 3 refactorings, tagged with python, Prime, Prime Numbers

This code contains a functi...

55502f40dc8b7c769880b10874abc9d0 Talk
#!/usr/bin/env python
# -*- coding: utf-8 -*-

...

Python Python Koan Score Function

by lynxx, January 02, 2011 13:19, 6 refactorings, tagged with python, koans, gamble

I am brushing up on my Pyth...

16a142856cb73e3a64a989b121daddd3 Talk
def zip_plus(source_list, additional_list):
    """
        Like zip but does plus operation where zip makes a tuple
...

Python variations on zip

by https://www.google.com/accounts/o8/id?id=AItOawnsm--vLmQJ3pTQIjTkYd0hwwcCxZEprhY, December 15, 2010 01:52, 1 refactoring, tagged with python, lists

2 functions i need to build...

1afbba5d8a998738ce0d272860f8884e Talk
def isSyncronized(self):
        NO_SYNC = 1
        UNDER_DATE = 2
...

Python nested if blocks

by marcosvanetta, July 25, 2010 01:28, 3 refactorings, tagged with python, method, metaprogramming

I wanna know if anyone can ...

55502f40dc8b7c769880b10874abc9d0 Talk
def get_combinations(sequence,joker=10):
    """
    Checks duplicates in sequence, returns tuple with char and duplicate count
...

Python Poker sequence

by rullon.myopenid.com, May 11, 2010 13:27, 1 refactoring, tagged with python, poker

get max length of duplicate...

55502f40dc8b7c769880b10874abc9d0 Talk
def __init__(self, month, day, year):
        if type(month) != int:
            raise NotIntegerError, "month must be an integer"
...

Python Validating argument

by jluebbert.myopenid.com, April 03, 2010 08:08, 5 refactorings, tagged with python, validation, initialization

I'm learning python and I w...

55502f40dc8b7c769880b10874abc9d0 Talk
entries         = BlogEntry.objects.filter(status=True,sticky=False,control_tags=controlTag)[offset:(offset+limit)]
sticky_entries  = BlogEntry.objects.filter(status=True,sticky=True,control_tags=controlTag)

...

Python Django combining querysets

by rullon.myopenid.com, March 23, 2010 21:19, 1 refactoring, tagged with python, django

When i combine this way, re...

55502f40dc8b7c769880b10874abc9d0 Talk
import re

def process_html(str):
...

Python Regexp extraction in Python

by rullon.myopenid.com, March 17, 2010 10:22, 5 refactorings, tagged with python, regexp

Is it good way to extract p...

55502f40dc8b7c769880b10874abc9d0 Talk
numbers  = [int(raw_input("enter number: "))]
p = lambda x: ((x % 2) and x * 3 + 1) or x / 2

...

Python algoritmo collatz

by sergio, February 25, 2010 15:54, 2 refactorings, tagged with python

Considere que, para um dete...

A5f3d249cc5053cdc1eb4ede60fd2f45 Talk
def get_pos(rel_dates):
    """returns the positions of the dates closest to 25%, 50%, and 75%"""
    pos = [0] # first element
...

Python Return the indexes of speci...

by Tafkas, January 28, 2010 19:53, 5 refactorings, tagged with python, dates, relative position

The function takes an list ...

693a4661eaa71435ce5ebe61de64c5a4 Talk
def scale_dates(dates):
    rel_dates = []
    first_day = dates[0]
...

Python Scale data points with the ...

by Tafkas, January 22, 2010 12:55, 3 refactorings, tagged with python, date, timestamp

In order to print a chart t...

693a4661eaa71435ce5ebe61de64c5a4 Talk
class MetaClass(type):
    def __new__(cls, name, bases, attrs):
        return super(MetaClass, cls).__new__(cls, name, bases, attrs)
...

Python How to dynamically pass bas...

by dominno, December 08, 2009 07:47, No refactoring, tagged with python, metaclass

I need to dynamically creat...

25cf66e4ecb9887c788ef2d13a2f8c16 Talk
#!/usr/bin/python
# Criado em:Dom 12/Ago/2007 hs 10:49
# Last Change: Dom 12 Ago 2007 11:11:06 BRT
...

Python equação do segundo grau

by sergio, July 10, 2009 19:42, 1 refactoring, tagged with math, python

Equação do segundo graum ...

A5f3d249cc5053cdc1eb4ede60fd2f45 Talk
def slug_to_lower(fn):
    """
    Decorator to lowercase string arguments to a function.
...

Python String args to lower decorator

by justinlilly.myopenid.com, June 04, 2009 18:04, 5 refactorings, tagged with python, decorator

This was used to convert Mi...

55502f40dc8b7c769880b10874abc9d0 Talk
#?
import PIL
#?
...

Python Convert .pdf to .tiff

by setori88.myopenid.com, October 20, 2008 07:04, 5 refactorings, tagged with python, conversion, open office, PIL

Hello all

As the title s...

40975e93e1913ab7c55e019f69d64b1f Talk
#!/usr/bin/python

import socket,time
...

Python Connection Detection script

by matthew.scouten.myopenid.com, October 02, 2008 01:06, 3 refactorings, tagged with short, python, sockets

This is a Quick and Dirty s...

55502f40dc8b7c769880b10874abc9d0 Talk
#!/usr/bin/python
# -*- coding: utf-8 -*-

...

Python Parse XML from Yahoo weathe...

by kael, August 26, 2008 17:27, 3 refactorings, tagged with xml, python, rss, dom

Is there a more efficient w...

Ec5a58db4acc016568e0293d283cbc2d Talk
#!/usr/bin/python
# -*- coding: utf-8 -*-

...

Python Base64 image encoding and i...

by kael, August 25, 2008 19:05, 3 refactorings, tagged with image, python, hash, base64, sha224

Is this a correct a way to ...

Ec5a58db4acc016568e0293d283cbc2d Talk
#!/usr/bin/python
# -*- coding: utf-8 -*-

...

Python Query TinyUrl the fastest way

by kael, August 25, 2008 18:44, No refactoring, tagged with python, http, tinyurl, urllib, urllib2

I'm looking for the fastest...

Ec5a58db4acc016568e0293d283cbc2d Talk
i = 0
for j in ['foo', 'bar', 'baz']
    puts "#{i} #{j}"
...

Ruby Python's enumerate in Ruby?

by robby86533.identity.net, July 14, 2008 23:02, 4 refactorings, tagged with ruby, python, for, enumerate

What is the best way to emu...

Cbb09ca8a832170ec73186f5c8cafba4 Talk