Re: string character count

2009-06-30 Thread Emile van Sebille
On 6/30/2009 1:43 PM nn said... On Jun 30, 1:56 pm, MRAB wrote: >>> len("text12345.txt".split(".", 1)[0]) 9 >>> len("textstringwithoutdot".split(".", 1)[0]) 20 Also: >>> len("text.12345.txt".partition('.')[0]) 4 >>> len("text.12345.txt".rpartition('.')[0]) 10 >>> unless you've got fi

Re: pep 8 constants

2009-06-30 Thread MRAB
Eric S. Johansson wrote: I've been working with speech recognition for 15 years. I've written something on the order of 10,000 lines of Python code both as open source and private projects. I've tried it least two dozen editors and they all fail miserably because they're focused on keyboard use

Re: invoking a method from two superclasses

2009-06-30 Thread Scott David Daniels
Mitchell L Model wrote: In Python 3, how should super() be used to invoke a method defined in C > that overrides its two superclasses A and B, in particular __init__? ... I've discovered the surprising fact described in the documentation of super

MIT OpenCourseWare Introduction to Computer Science and Programming

2009-06-30 Thread sato.ph...@gmail.com
I am wondering if anyone else is also going through the MIT OpenCourseWare Intro to CS class. http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-00Fall-2007/CourseHome/index.htm I've been doing the assignments and, as this class didn't include any answer key, was hoping to se

Re: invoking a method from two superclasses

2009-06-30 Thread Mitchell L Model
Allow me to add to my previous question that certainly the superclass methods can be called explicitly without resorting to super(), e.g.: class C(A, B): def __init__(self): A.__init__(self) B.__init__(self) My question is really whether there is any way of get

Re: MIT OpenCourseWare Introduction to Computer Science and Programming

2009-06-30 Thread sato.ph...@gmail.com
I should note that the course utilized python when teaching computer science. On Jun 30, 5:23 pm, "sato.ph...@gmail.com" wrote: > I am wondering if anyone else is also going through the MIT > OpenCourseWare Intro to CS class. > > http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Scien

Re: PEP 376

2009-06-30 Thread Tarek Ziadé
On Wed, Jul 1, 2009 at 12:52 AM, Carl Banks wrote: > On Jun 30, 12:41 pm, Tarek Ziadé wrote: >> Hello, >> >> I would like to propose this PEP for inclusion into Python 2.7 / 3.2 >> >> http://www.python.org/dev/peps/pep-0376/ >> >> It has been discussed a lot already in the distutils-SIG, but new >

Re: Determining if a function is a method of a class within a decorator

2009-06-30 Thread Carl Banks
On Jun 29, 6:01 pm, David Hirschfield wrote: > So is there > a pattern I can follow that will allow me to determine whether the > objects I'm given are plain functions or belong to a class? > > Thanks in advance, class HomemadeUnboundMethod(object): def __init__(self,func): self.fun

Re: PEP 376

2009-06-30 Thread Lawrence D'Oliveiro
In message , Tarek Ziadé wrote: > I would like to propose this PEP for inclusion into Python 2.7 / 3.2 > > http://www.python.org/dev/peps/pep-0376/ Why are you using MD5? -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 376

2009-06-30 Thread Carl Banks
On Jun 30, 5:55 pm, Lawrence D'Oliveiro wrote: > In message , Tarek > > Ziadé wrote: > > I would like to propose this PEP for inclusion into Python 2.7 / 3.2 > > >http://www.python.org/dev/peps/pep-0376/ > > Why are you using MD5? I doubt it's the design aim for eggs to be cryptographically secur

Re: csv blank fields

2009-06-30 Thread norseman
Mag Gam wrote: I am using the csv package to parse a compressed .csv.gz file. So far its working perfectly fine but it fails when I have a missing value in on of the fields. For example, I have this Abc,def,,jkl Is it possible to fill the missing column with a null? I want, Abc,def,NULL,jkl

Re: Determining if a function is a method of a class within a decorator

2009-06-30 Thread David Hirschfield
Unfortunately that still requires two separate decorators, when I was hoping there was a way to determine if I was handed a function or method from within the same decorator. Seems like there really isn't, so two decorators is the way to go. Thanks, -David Carl Banks wrote: On Jun 29, 6:01 pm

Re: invoking a method from two superclasses

2009-06-30 Thread Carl Banks
On Jun 30, 5:34 pm, Mitchell L Model wrote: > Allow me to add to my previous question that certainly the superclass > methods can be called explicitly without resorting to super(), e.g.: > >     class C(A, B): >         def __init__(self): >             A.__init__(self) >             B.__init__(se

Re: invoking a method from two superclasses

2009-06-30 Thread Carl Banks
On Jun 30, 6:23 pm, Carl Banks wrote: > On Jun 30, 5:34 pm, Mitchell L Model wrote: > > > Allow me to add to my previous question that certainly the superclass > > methods can be called explicitly without resorting to super(), e.g.: > > >     class C(A, B): > >         def __init__(self): > >    

Multi thread reading a file

2009-06-30 Thread Mag Gam
Hello All, I am very new to python and I am in the process of loading a very large compressed csv file into another format. I was wondering if I can do this in a multi thread approach. Here is the pseudo code I was thinking about: Let T = Total number of lines in a file, Example 100 (1 mil

Re: packaging apps

2009-06-30 Thread David Lyon
On Tue, 30 Jun 2009 11:11:15 -0400, Ronn Ross wrote: > I have a simple application that has a glade file and a .py file. How would > I package that into an installer for Windows, Mac, and a deb file? Can > anyone point me in the right direction? I don't think there is a simple way to do that just

Re: PEP 376

2009-06-30 Thread Scott David Daniels
Carl Banks wrote: On Jun 30, 5:55 pm, Lawrence D'Oliveiro wrote: In message , Tarek Ziadé wrote: I would like to propose this PEP for inclusion into Python 2.7 / 3.2 http://www.python.org/dev/peps/pep-0376/ Why are you using MD5? I doubt it's the design aim for eggs to be cryptographically

Re: PEP 376

2009-06-30 Thread Joachim Strömbergson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Aloha! Carl Banks wrote: > On Jun 30, 5:55 pm, Lawrence D'Oliveiro central.gen.new_zealand> wrote: >> In message , Tarek >> >> Ziadé wrote: >>> I would like to propose this PEP for inclusion into Python 2.7 / 3.2 >>> http://www.python.org/dev/peps/pe

Re: invoking a method from two superclasses

2009-06-30 Thread Mitchell L Model
>From: Scott David Daniels >Date: Tue, 30 Jun 2009 16:49:18 -0700 >Message-ID: >Subject: Re: invoking a method from two superclasses > >Mitchell L Model wrote: >>In Python 3, how should super() be used to invoke a method defined in C > > that overrides its two superclasses A and B, in particular

Re: invoking a method from two superclasses

2009-06-30 Thread Scott David Daniels
Mitchell L Model wrote: From: Scott David Daniels Date: Tue, 30 Jun 2009 16:49:18 -0700 Message-ID: Subject: Re: invoking a method from two superclasses Mitchell L Model wrote: In Python 3, how should super() be used to invoke a method defined in C that overrides its two superclasses A and B,

Re: invoking a method from two superclasses

2009-06-30 Thread Gabriel Genellina
En Tue, 30 Jun 2009 21:34:02 -0300, Mitchell L Model escribió: Allow me to add to my previous question that certainly the superclass methods can be called explicitly without resorting to super(), e.g.: class C(A, B): def __init__(self): A.__init__(self) B.

Streaming Webcam over network

2009-06-30 Thread Nik Martelaro
Hi eveyone, I am working on a project that requires streaming video from a webcam over LAN and displaying the live video on the remote computer. Basically, I am creating a specialized video chat client. I can get really nice video locally using VideoCapture and Pygame, however have only been able t

Re: Multi thread reading a file

2009-06-30 Thread Gabriel Genellina
En Tue, 30 Jun 2009 22:52:18 -0300, Mag Gam escribió: I am very new to python and I am in the process of loading a very large compressed csv file into another format. I was wondering if I can do this in a multi thread approach. Does the format conversion involve a significant processing time

Re: Making code run in both source tree and installation path

2009-06-30 Thread ryles
On Jun 29, 12:20 pm, Javier Collado wrote: > Hello, > > I would like to be able to run the main script in a python project > from both the source tree and the path in which it's installed on > Ubuntu. The script, among other things, imports a package which in > turns makes use of some data files t

<    1   2