Re: Google App Engine Code Challenge - write a tetris playing algorithm

2008-12-01 Thread Casey McGinty
On Sun, Nov 30, 2008 at 2:41 PM, russ.au <[EMAIL PROTECTED]> wrote: > I've got more features to add, depending on how > popular it is.. > Are you going to create a leader board to track the high scores? -- http://mail.python.org/mailman/listin

Re: Google App Engine Code Challenge - write a tetris playing algorithm

2008-12-01 Thread Casey McGinty
Well, I think its a cool idea. I might try it out if I can find some free cycles. And does the game logic assume the pieces come straight down? For example, what if you wanted to move a piece to the left or right after its past some vertical obstruction? For example If you place and upside down 'j

Re: Reverse zip() ?

2008-12-03 Thread Casey McGinty
> The corner case is when dealing with empty lists and there aren't > enough items to unpack. > > Another solution to zip(), with a slightly different behaviour for conner cases >>> a = (1,2,3) >>> b = (1,2,3) >>> c = (1,2,3,4) >>> zip(a,b) [(1, 1), (2, 2), (3, 3)] >>> map(None,a,b) [(1, 1),

Re: Project structure - Best practices

2008-12-05 Thread Casey McGinty
. If anyone wants to add some suggestions, I'd love to have more discussion to organize thoughts and see if any new ideas come out. As a starting point, what is a good markup language to use for some slick HTML and PDF output? - Casey McGinty [1] http://www.python.org/dev/peps/pep-0008/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Free place to host python files?

2009-01-07 Thread Casey McGinty
Check out nearlyfreespeech.net for a free account. You could store hundreds of scripts on there for about 12 cents a year. -- http://mail.python.org/mailman/listinfo/python-list

Making Variable Text Output More Pythonic?

2008-05-15 Thread Casey McGinty
Hi, I have some classes that print variable outputs depending on their internal state, like so: def __str__(self): out = [] if self.opt1: out += ['option 1 is %s' % self.opt1'] if self.opt2: out += ['option 2 is %s' % self.opt2'] return '\n'.join(out) Is there any way to

Re: Sanitised Newsgroup Feeds?

2008-05-15 Thread Casey McGinty
On Wed, May 14, 2008 at 7:47 PM, Paddy <[EMAIL PROTECTED]> wrote: > Hi, > Does anyone do a sanitised newsgroup feed? Something like what mail > filters do for email? > > Hi, I used to read the summary emails and had the same problem. I think

test

2008-05-15 Thread Casey McGinty
test -- http://mail.python.org/mailman/listinfo/python-list

Re: Organizing a Python project

2008-05-21 Thread Casey McGinty
> I'm starting work on what is going to become a fairly substantial > Python project, and I'm trying to find the best way to organize > everything. I'd like to add a follow up question. Are there any idioms for writing /usr/bin scripts to run installed package modules? For this I am assuming a s

Re: Code correctness, and testing strategies

2008-05-24 Thread Casey McGinty
> Seriously, 10 hours of testing for code developed in 10 hours? What > > kind of environment do you write code for? This may be practical for > > large companies with hordes of full-time testing & QA staff, but not > > for small companies with just a handful of developers (and where you > > need t

Re: finding icons for Apps

2008-05-25 Thread Casey McGinty
http://art.gnome.org/ http://www.gnome-look.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Organizing a Python project

2008-05-25 Thread Casey McGinty
On Sat, May 24, 2008 at 2:11 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > 2. In the top of your package directory it is typical to have a module > name > > '_package.py'. This is ideally where the main command line entry point > for > > the package code should be placed. > > Why the unders

Re: Struct usages in Python

2008-05-27 Thread Casey McGinty
>self.event[] = Event() *# Seems this is not allowed ?? * > self.event = [Event()] - Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Code execution in imported modules

2008-05-29 Thread Casey McGinty
On Thu, May 29, 2008 at 2:43 PM, Eric Wertman <[EMAIL PROTECTED]> wrote: > So I'm working on some file parsing and building up a stack of regular > expressions that I need to use. I was thinking of dropping them in an > external module. I was wondering.. if I put them in a file called > regex.py

Re: ClassName.attribute vs self.__class__.attribute

2008-06-05 Thread Casey McGinty
On Thu, Jun 5, 2008 at 5:40 AM, Gabriel Rossetti < [EMAIL PROTECTED]> wrote: > Hello everyone, > > I had read somewhere that it is preferred to use self.__class__.attribute > over ClassName.attribute to access class (aka static) attributes. I had done > this and it seamed to work, until I subclass

Re: ClassName.attribute vs self.__class__.attribute

2008-06-06 Thread Casey McGinty
On Thu, Jun 5, 2008 at 11:39 AM, Terry Reedy <[EMAIL PROTECTED]> wrote: > > If you want to access the attribute of a particular class, to read or > write, use that class. > SomeClass.attr > Note that no instance is required or relevant. > > If you want to read the attrubute of the class of an in

Re: Guide to organizing modules?

2008-06-06 Thread Casey McGinty
> > Yes, in the above post I meant to say package where I said module. > Right now all my functions are in the __init__.py script, and I would > consider separating them out into sub-packages, if it had any rhyme or > reason, but right now that escapes me. That's mostly what I'm trying > to ask for

Re: python-dbus example request

2008-06-26 Thread Casey McGinty
You will need this page to figure out the name of the device, and details on how to access it. However it is not python specific. http://people.freedesktop.org/~david/hal-spec/hal-spec.html -- http://mail.python.org/mailman/listinfo/python-list

Help with Borg design Pattern

2008-06-27 Thread Casey McGinty
Hi, I'm trying to implement a simple Borg or Singleton pattern for a class that inherits from 'dict'. Can someone point out why this code does not work? class MyDict( dict ): __state = {} def __init__(self): self.__dict__ = self.__state a = MyDict() a['one'] = 1 a['two'] = 2 print a

Re: Help with Borg design Pattern

2008-06-27 Thread Casey McGinty
On Fri, Jun 27, 2008 at 3:21 PM, Casey McGinty <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to implement a simple Borg or Singleton pattern for a class that > inherits from 'dict'. Can someone point out why this code does not work? > > class MyDict( dict

Re: Help with Borg design Pattern

2008-06-30 Thread Casey McGinty
On Fri, Jun 27, 2008 at 5:25 PM, Maric Michaud <[EMAIL PROTECTED]> wrote: > Yes it is, but it's rather unneeded in Python, we prefer simply create a > module level dictionnary, these tricks are used in language like C++ or > Java. > > In python : > > mymodule.py : > > ModuleOptions = {} > > otherm

Re: Interest not met.

2008-07-07 Thread Casey McGinty
On Thu, Jul 3, 2008 at 5:01 AM, david odey <[EMAIL PROTECTED]> wrote: > I write to inform you that the reason I subscribed to this web page > is not been met. > > I want to be sent sample codes in programming languages especially > python and an email tutorial on C#. I will be happy if these deman

Unit Testing Techniques

2008-07-10 Thread Casey McGinty
I'm familiar with the unittest module in Python, however I'm hoping someone can point me to some examples of more advanced usages of the framework. For example: 1. Using the framework to test a package with nested sub-packages and modules without having to hard code the location/name of each test

Re: Python Written in C?

2008-07-20 Thread Casey McGinty
On Sun, Jul 20, 2008 at 5:06 PM, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-07-21, Dan Upton <[EMAIL PROTECTED]> wrote: > > Using punch-cards and paper-tape. Real programmers can edit > their programs with a pointy stick and some home-made > sticky-tape. > > Doesn't everyone know that REA

DBUS/HAL Manager Interface Help

2008-07-25 Thread Casey McGinty
Can someone explain to me why this sample code does not work? I am trying to test if a device exists. dbus_test.py -- import dbus bus = dbus.SystemBus() proxy = bus.get_object( 'org.freedesktop.Hal', '/org/freedesktop/Hal/Manager' ) manager = dbus.Interfa

Re: Pwnie awards

2008-07-26 Thread Casey McGinty
One more award from award winner Tim Neshman ... http://www.thenewsh.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I check nbr of cores of computer?

2008-07-29 Thread Casey McGinty
On Tue, Jul 29, 2008 at 12:53 PM, defn noob <[EMAIL PROTECTED]> wrote: > How can I check how many cores my computer has? > Is it possible to do this in a Python-app? > -- > http://mail.python.org/mailman/listinfo/python-list > You can use the HAL interface from the DBUS module. See also the gnome

Re: Inserting into a combo box

2008-08-05 Thread Casey McGinty
What toolkit are you using? -- http://mail.python.org/mailman/listinfo/python-list

Getting PyUnit to run Package Test Modules

2008-04-22 Thread Casey McGinty
Hopefully this is an easy question for someone to answer. I have a directory structure like so: alltest.py prog.py ../package __init__.py mod1.py test_mod1.py modn. py (and so on...) Each test_mod*.py file contains some PyUnit test cases. I am using the following code in

Re: Getting PyUnit to run Package Test Modules

2008-04-22 Thread Casey McGinty
= __import__(name) components = name.split('.') for comp in components[1:]: print comp mod = getattr(mod,comp) alltests.addTest(unittest.findTestCases(mod)) return alltest On Tue, Apr 22, 2008 at 12:12 AM, Casey McGinty <[EMAIL PROTECTED]> wro

SMTPlib and SMTPd Performance Issues

2009-07-21 Thread Casey McGinty
Hi, I just wanted mention a few workarounds I've come up with for the Python SMTP modules in regards to performance. Before I started, I was getting about 15MB/s while sending e-mail from smtplib to smptd over a local connection. (i.e. both client/server running on the same machine). After the fo