Re: Interfaces.

2007-11-15 Thread [EMAIL PROTECTED]
On Nov 15, 7:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I would argue that interfaces/(similar feature) are necessary in any > modern language because they provide a way of separating the > specification from the implementation of a module. > First of all, being a newbie, let me welco

Re: Interfaces.

2007-11-15 Thread Paddy
On Nov 16, 1:55 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > ... > I also had a new idea - when specifying the functionality of a module, > it would be nice to combine examples of valid behaviour / some sort of > testing. > ... Try the 'Pythonic' doctest module: http://en.wikipedia

Re: implement random selection in Python

2007-11-15 Thread Bruza
On Nov 15, 9:32 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Nov 15, 10:40�pm, Bruza <[EMAIL PROTECTED]> wrote: > > > > > I need to implement a "random selection" algorithm which takes a list > > of [(obj, prob),...] as input. Each of the (obj, prob) represents how > > likely an object,

Re: implement random selection in Python

2007-11-15 Thread [EMAIL PROTECTED]
On Nov 15, 10:40�pm, Bruza <[EMAIL PROTECTED]> wrote: > I need to implement a "random selection" algorithm which takes a list > of [(obj, prob),...] as input. Each of the (obj, prob) represents how > likely an object, "obj", should be selected based on its probability > of > "prob".To simplify the

Re: evaluating object returned by PyParser_SimpleParseString fun ction

2007-11-15 Thread Borse, Ganesh
Thanks for this. >>Terry>>Compile the string into a code object. Code objects can be executed by >>an exec statement or evaluated by a call to eval(). Can I call exec() or eval() as is from C or C++ program? What the equivalent calls for this in Python-C API? That's what I want to know. Regards

Last chance for PyCon talk & tutorial proposals!

2007-11-15 Thread David Goodger
Thanks to all the proposal authors so far, we have received lots of proposals for PyCon talks & tutorials. But we'd like to have even more. Alas, the proposal submission deadline should have been set after a weekend, not before. So we have decided to extend the proposal submission deadline to Mon

Re: implement random selection in Python

2007-11-15 Thread James Stroud
Bruza wrote: > I need to implement a "random selection" algorithm which takes a list > of [(obj, prob),...] as input. Each of the (obj, prob) represents how > likely an object, "obj", should be selected based on its probability > of > "prob".To simplify the problem, assuming "prob" are integers, an

Re: Interfaces.

2007-11-15 Thread James Stroud
Chris M wrote: > On Nov 15, 8:55 pm, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: >> Hi, >> >> Does anyone know what the state of progress with interfaces for python >> (last I can see ishttp://www.python.org/dev/peps/pep-0245/) >> >> I would argue that interfaces/(similar feature) are necessar

implement random selection in Python

2007-11-15 Thread Bruza
I need to implement a "random selection" algorithm which takes a list of [(obj, prob),...] as input. Each of the (obj, prob) represents how likely an object, "obj", should be selected based on its probability of "prob".To simplify the problem, assuming "prob" are integers, and the sum of all "prob"

Re: Interfaces.

2007-11-15 Thread Gabriel Genellina
En Thu, 15 Nov 2007 22:55:13 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > Does anyone know what the state of progress with interfaces for python > (last I can see is http://www.python.org/dev/peps/pep-0245/) You may be interested in PEP3119

Re: Memory problem

2007-11-15 Thread Gabriel Genellina
En Thu, 15 Nov 2007 10:10:06 -0300, Peter Otten <[EMAIL PROTECTED]> escribió: > Rolf Wester wrote: > >> Sorry, of course your are wright. I'm running Python2.5 on Linux, my >> program imports numpy, matplotlib, sys and a python module of my own. >> This module uses numpy and scipy.weave for imbe

Re: PyCheck for a classes defined in python and user data in PyObject_HEAD

2007-11-15 Thread Gabriel Genellina
En Fri, 16 Nov 2007 00:27:42 -0300, <[EMAIL PROTECTED]> escribió: > On Nov 1, 11:04 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Thu, 01 Nov 2007 22:13:35 -0300, <[EMAIL PROTECTED]> escribió: >> >> I'm in a situation when i don't really need to extend python with any >> >> classes o

Re: PyCheck for a classes defined in python and user data in PyObject_HEAD

2007-11-15 Thread sndive
On Nov 1, 11:04 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 01 Nov 2007 22:13:35 -0300, <[EMAIL PROTECTED]> escribió: > > > On Nov 1, 4:14 pm, [EMAIL PROTECTED] wrote: > >> q#1: > >> in C I want to check if a given PyObject is a xml.dom.minidom.Node (or > >> a derivative). > >> how

Re: Interfaces.

2007-11-15 Thread Chris M
On Nov 15, 8:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > Does anyone know what the state of progress with interfaces for python > (last I can see ishttp://www.python.org/dev/peps/pep-0245/) > > I would argue that interfaces/(similar feature) are necessary in any > modern languag

Re: no __len__ attribute in NodeList or the list base?

2007-11-15 Thread sndive
On Nov 15, 3:09 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > i extract class object from an instance of NodeList (minicompat.py) > > like so > > PyObject *pclass = PyObject_GetAttrString( nodelistinsance, > > "__class__"); > > but > > PyObject_GetAttrString(pclass,

Interfaces.

2007-11-15 Thread [EMAIL PROTECTED]
Hi, Does anyone know what the state of progress with interfaces for python (last I can see is http://www.python.org/dev/peps/pep-0245/) I would argue that interfaces/(similar feature) are necessary in any modern language because they provide a way of separating the specification from the implemen

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Istvan Albert
On Nov 15, 4:11 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Unless you're accusing both myself and the original poster of outright > lying, of faking our results, what's your explanation? I don't attribute it to malice, I think you're simply measuring something else. You b

PDF library

2007-11-15 Thread james_027
hi, I am looking for a python PDF library that starts with 'Q' ... I just found them somewhere in the internet but I can't find them now that I need it. Does someone knows this? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Design Patterns - composition vs. inheritance

2007-11-15 Thread Carl Banks
On Nov 15, 3:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > My response ended up being pretty long and heavy for a beginner, but you sound pretty smart. > In learning about design patterns, I've seen discussion about using > inheritance when an object's relationship to another object is

Re: Embedded Python - Blocking Python Function

2007-11-15 Thread Gabriel Genellina
En Thu, 15 Nov 2007 16:18:45 -0300, <[EMAIL PROTECTED]> escribió: > On Nov 15, 9:43 am, [EMAIL PROTECTED] wrote: >> On Nov 14, 4:20 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> >> wrote: >> >> > Not forcibly - you need some cooperation from the Main function. Maybe >> > setting a global variable th

Re: Redirecting sys.stdin

2007-11-15 Thread andy
On Nov 15, 4:09 pm, [EMAIL PROTECTED] wrote: > Can anyone tell me what I am doing wrong with the following code? When > python 2.4 is embedded it crashes because of the assignment to stdin. > > import sys; > > class RedirectB: > def readline(self): > return "bar"; > > sys.stdin = RedirectB();

Re: Printing user input?

2007-11-15 Thread Mohammed_M
Thanks Mike, Lorenzo & Cliff for your replies. I definately will be reading up on namespaces & scopes. Thanks again guys :) -- http://mail.python.org/mailman/listinfo/python-list

Re: pyopenglcontext binaries for 2.5 on win32

2007-11-15 Thread kyosohma
On Nov 14, 7:42 pm, [EMAIL PROTECTED] wrote: > On Nov 13, 12:03 am, gz <[EMAIL PROTECTED]> wrote: > > > > > no, I don't have them... I need them :) > > > I'd like to thank Giovanni Bajo for providing binaries for the various > > package dependencies, and geting me going with pyopengl. > > > Unfortu

Redirecting sys.stdin

2007-11-15 Thread andy
Can anyone tell me what I am doing wrong with the following code? When python 2.4 is embedded it crashes because of the assignment to stdin. import sys; class RedirectB: def readline(self): return "bar"; sys.stdin = RedirectB(); Thanks! Andy -- http://mail.python.org/mailman/listinfo/pyt

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Terry Reedy
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | (7) It occurs in Python 2.3, 2.4 and 2.5, but not 2.5.1. | | Do we treat this as a solved problem and move on? If the problem was fixed accidentally as an undocumented by product of a patch aimed at something else,

Re: ANN: PyInkblot - Creating Rorschach Inkblots using Genetic Algorithms

2007-11-15 Thread placid
On Nov 16, 1:47 am, SamFeltus <[EMAIL PROTECTED]> wrote: > I suspect you could make it visually far more interesting if you > replaced the colored pixels with colorful images, and mapped the I'm already planning of using images instead of coloured blocks. But first i want to try using a gradient f

Re: What is the function to evaluate code object returned byPyParser _SimpleParseString function?

2007-11-15 Thread Terry Reedy
"Borse, Ganesh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Py_CompileString takes the source code from file, isn't it? No. | As can be seen from the syntax of this function: "PyObject* Py_CompileString(char *str, char *filename, int start)" I am rather sure that the filenam

Re: Python Design Patterns - composition vs. inheritance

2007-11-15 Thread Diez B. Roggisch
> I think my main concern while getting my toes wet on this was to not > reference the owner object out of "thin air" but to pass it in when > pet is instantiated. I'm not sure what 'actor-passed' is yet, but it > gives me something to search for and learn about. I meant ctor, short-hand for const

Re: Python Design Patterns - composition vs. inheritance

2007-11-15 Thread Chris Mellon
On Nov 15, 2007 2:37 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > > As a very simplified example, if I had two classes, Pet and Owner, it > > seems that I would not have Pet inherit from Owner, since a pet 'has > > an' owner, but not 'is an' owner. If this is correct, does my code > > below

Fwd: Python Design Patterns - composition vs. inheritance

2007-11-15 Thread Matthieu Brucher
Sorry for the double post -- Forwarded message -- From: Matthieu Brucher <[EMAIL PROTECTED]> Date: 15 nov. 2007 23:38 Subject: Re: Python Design Patterns - composition vs. inheritance To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> 2007/11/15, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > (7) It occurs in Python 2.3, 2.4 and 2.5, but not 2.5.1. > Do we treat this as a solved problem and move on? I'm not comfortable with this. Better to identify the cause for certain. I'll look at it sometime if I get a chance. I have some 64-bit mult

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Steven D'Aprano
On Thu, 15 Nov 2007 21:51:21 +0100, Hrvoje Niksic wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > Someone please summarize. >>> >>> Yes, that would be good. >> >> On systems with multiple CPUs or 64-bit systems, or both, creating >> and/or deleting a multi-megabyte dictionary in rece

Re: Python Design Patterns - composition vs. inheritance

2007-11-15 Thread [EMAIL PROTECTED]
> Yes. Of course there are other ways, establishing the connection later, > and of course making the Owner know her pets. But your unidirectional, > ctor-passed implementation is sensible. I think my main concern while getting my toes wet on this was to not reference the owner object out of "thin

Re: Python Design Patterns - composition vs. inheritance

2007-11-15 Thread Carl Banks
On Nov 15, 3:37 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Also, I've seen talk that ideally you shouldn't have too many "dots" > > in your method calls, instead using delegates to the methods and > > attributes. Can anyone elaborate on this? Ideally, should I be writing > > getattr() m

Re: Insert image to a List box

2007-11-15 Thread Matimus
On Nov 15, 12:45 pm, linda.s <[EMAIL PROTECTED]> wrote: > I run the following code and got the error (I put a .gif file on the desktop) > Traceback (most recent call last): > File "11.py", line 25, in > for gifname in os.listdir(dirpath): > OSError: [Errno 2] No such file or directory: '.\\D

Re: Python beginner!

2007-11-15 Thread kyosohma
On Nov 15, 2:38 pm, "SMALLp" <[EMAIL PROTECTED]> wrote: > Could someone please paste some program in wxPython that uses inharitance. I > would be very thankfull. Most examples of wxPython use inheritance. I would recommend going to their website and downloading the demo as it has lots of code to l

RE: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Michael Bacarella
> On Thu, 15 Nov 2007 15:51:25 -0500, Michael Bacarella wrote: > > > Since some people missed the EUREKA!, here's the executive summary: > > > > Python2.3: about 45 minutes > > Python2.4: about 45 minutes > > Python2.5: about _30 seconds_ > > I'm really happy that upgrading to 2.5 sol

Re: Resolving declaring class of a method at runtime

2007-11-15 Thread Steven D'Aprano
On Thu, 15 Nov 2007 13:01:27 +0200, Janne Härkönen wrote: > Hello, > > Is there a simple way to resolve declaring class of a method at runtime > ? Have you tried looking at dir(TheClass) to see what it lists? Also helpful is TheClass.__dict__.keys(). Python has powerful introspection abilities

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Chris Mellon
On Nov 15, 2007 2:57 PM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 15 Nov 2007 10:51:08 -0600, Chris Mellon wrote: > > > I can't duplicate this in a dual CPU (64 bit, but running in 32 bit mode > > with a 32 bit OS) system. > > Can you try it running in 64-bit mode? > > What Python versi

Re: Python beginner!

2007-11-15 Thread Tony
On Nov 15, 8:38 pm, "SMALLp" <[EMAIL PROTECTED]> wrote: > Could someone please paste some program in wxPython that uses inharitance. I > would be very thankfull. HI SMALLp: welcome to Python! Here is a link that shows some basics of inheritance in Wx, try other searches on Google:) http://www.ib

Re: Python beginner!

2007-11-15 Thread Tony
On Nov 15, 8:57 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > > Please read this: > http://www.catb.org/~esr/faqs/smart-questions.html> > > Then ask again. > > /W Give me back the old comp.lang.python, where anyone could ask anything and be sure of a range of replies, instead of this sort

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Steven D'Aprano
On Thu, 15 Nov 2007 15:51:25 -0500, Michael Bacarella wrote: > Since some people missed the EUREKA!, here's the executive summary: > > Python2.3: about 45 minutes > Python2.4: about 45 minutes > Python2.5: about _30 seconds_ I'm really happy that upgrading to 2.5 solved the is

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Hrvoje Niksic
Steven D'Aprano <[EMAIL PROTECTED]> writes: >>> Someone please summarize. >> >> Yes, that would be good. > > On systems with multiple CPUs or 64-bit systems, or both, creating and/or > deleting a multi-megabyte dictionary in recent versions of Python (2.3, > 2.4, 2.5 at least) takes a LONG time

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Steven D'Aprano
On Thu, 15 Nov 2007 10:51:08 -0600, Chris Mellon wrote: > I can't duplicate this in a dual CPU (64 bit, but running in 32 bit mode > with a 32 bit OS) system. Can you try it running in 64-bit mode? What Python version are you running? -- Steven. -- http://mail.python.org/mailman/listinfo/pyth

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Steven D'Aprano
On Thu, 15 Nov 2007 11:11:57 -0800, Istvan Albert wrote: > On Nov 14, 6:26 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: > >> On systems with multiple CPUs or 64-bit systems, or both, creating >> and/or deleting a multi-megabyte dictionary in recent versions of >> Python (2.

Re: Python beginner!

2007-11-15 Thread Wildemar Wildenburger
SMALLp wrote: > Could someone please paste some program in wxPython that uses inharitance. I > would be very thankfull. > Please read this: http://www.catb.org/~esr/faqs/smart-questions.html> Then ask again. /W -- http://mail.python.org/mailman/listinfo/python-list

RE: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Michael Bacarella
> On Nov 15, 2:11 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > > There is nothing wrong with neither creating nor deleting > > dictionaries. > > I suspect what happened is this: on 64 bit > machines the data structures for creating dictionaries > are larger (because pointers take twice as much s

Insert image to a List box

2007-11-15 Thread linda.s
I run the following code and got the error (I put a .gif file on the desktop) Traceback (most recent call last): File "11.py", line 25, in for gifname in os.listdir(dirpath): OSError: [Errno 2] No such file or directory: '.\\Desktop\\' import os import Tkinter root = Tkinter.Tk() L = Tkint

Python beginner!

2007-11-15 Thread SMALLp
Could someone please paste some program in wxPython that uses inharitance. I would be very thankfull. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Design Patterns - composition vs. inheritance

2007-11-15 Thread Diez B. Roggisch
> As a very simplified example, if I had two classes, Pet and Owner, it > seems that I would not have Pet inherit from Owner, since a pet 'has > an' owner, but not 'is an' owner. If this is correct, does my code > below reflect this? I passed the owner object into the pet object's > constructor -

Python Design Patterns - composition vs. inheritance

2007-11-15 Thread [EMAIL PROTECTED]
In learning about design patterns, I've seen discussion about using inheritance when an object's relationship to another object is 'is-a' and composition when the relationship is 'has-a'. Since this is all new and I'm still learning, I was hoping someone can give me some pointers on best practices

extension to idle to clear screen - but how to write to screen?

2007-11-15 Thread owl
and here I thought I was going to finally be able to change the world AND contribute back to python with my amazing clear screen extension - but I can't get it to work. ;( Copying from ZoomHeight.py and someone else's clever print suggestion: - # My

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Aaron Watters
On Nov 15, 2:11 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > There is nothing wrong with neither creating nor deleting > dictionaries. I suspect what happened is this: on 64 bit machines the data structures for creating dictionaries are larger (because pointers take twice as much space), so you

Re: google earth / pythoncom

2007-11-15 Thread Tom Brown
On Thu, 2007-11-15 at 18:09 +, John Walsh wrote: > Hi, > > I'd like to write a python script to control Google Earth, > and I've read that Google Earth provides a COM api, and that > Python has a COM module 'pythoncom'. > I think what you are looking for you can download from here: http://s

Re: Creating Installer or Executable in Python

2007-11-15 Thread Nick Craig-Wood
Shane Geiger <[EMAIL PROTECTED]> wrote: > DanielJohnson wrote: > > I have a small project which has around 10 .py files and I run this > > project using command line arguments. I have to distribute this > > project to somebody. > > > > I was wondering how can I make an executable or some kind of >

Re: Embedded Python - Blocking Python Function

2007-11-15 Thread andy
On Nov 15, 9:43 am, [EMAIL PROTECTED] wrote: > On Nov 14, 4:20 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > Not forcibly - you need some cooperation from the Main function. Maybe > > setting a global variable that Main checks periodically. > > Thanks. I'll give that a try! > > Andy I

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Istvan Albert
On Nov 14, 6:26 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On systems with multiple CPUs or 64-bit systems, or both, creating and/or > deleting a multi-megabyte dictionary in recent versions of Python (2.3, > 2.4, 2.5 at least) takes a LONG time, of the order of 30+ minute

Re: Movement recognition in video file

2007-11-15 Thread mindmaster32
Thanks guys, I will give those solutions a try! [EMAIL PROTECTED] escreveu: > On Nov 15, 8:29 am, [EMAIL PROTECTED] wrote: > > Hi, > > > > I am looking for a python tool or module that helps me build a script > > that can perceive object moves in a video file captured by a (web) > > camera. My

Re: Printing user input?

2007-11-15 Thread J. Clifford Dyer
On Thu, Nov 15, 2007 at 09:03:26AM -0800, Mohammed_M wrote regarding Printing user input?: > > Hi, > I'm v.new to Python, so please don't be too harsh :) > I get a NameError with the code below - All I want to do is store some > input taken from the user in a variable called name, & then print na

google earth / pythoncom

2007-11-15 Thread John Walsh
Hi, I'd like to write a python script to control Google Earth, and I've read that Google Earth provides a COM api, and that Python has a COM module 'pythoncom'. Anyone know where to get pythoncom from - as a separate module, because I'm using the Python application that comes with my GPS chip, f

Which uses less memory?

2007-11-15 Thread [EMAIL PROTECTED]
I'm not sure if this is as easy a question as I'd like it to be, but here goes I'm working on an application that is very memory intensive, so we're trying to reduce the memory footprint of classes wherever possible. I have a need for a class which is able to have a type identifier which can

RE: formated local time

2007-11-15 Thread Looney, James B
You could use: import time time.strftime( "%Y-%m-%d %H:%M:%S" ) or time.strftime( "%Y-%m-%d %H:%M:%S", time.localtime() ) Output: '2007-11-15 11:02:34' Both strftime calls are equivalent, in this case. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > ] On

Re: Printing user input?

2007-11-15 Thread kyosohma
On Nov 15, 11:03 am, Mohammed_M <[EMAIL PROTECTED]> wrote: > Hi, > I'm v.new to Python, so please don't be too harsh :) > I get a NameError with the code below - All I want to do is store some > input taken from the user in a variable called name, & then print name > > # START CODE

Re: Printing user input?

2007-11-15 Thread Lorenzo E. Danielsson
On Thu, 2007-11-15 at 09:03 -0800, Mohammed_M wrote: > Hi, > I'm v.new to Python, so please don't be too harsh :) > I get a NameError with the code below - All I want to do is store some > input taken from the user in a variable called name, & then print name > > # START CODE

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Chris Mellon
On Nov 14, 2007 5:26 PM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 14 Nov 2007 18:16:25 +0100, Hrvoje Niksic wrote: > > > Aaron Watters <[EMAIL PROTECTED]> writes: > > > >> On Nov 12, 12:46 pm, "Michael Bacarella" <[EMAIL PROTECTED]> wrote: > >>> > >>> > It takes about 20 seconds for me.

Re: SPAM

2007-11-15 Thread just bob
"Lew" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > just bob wrote: >> "John Bean" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> On Wed, 14 Nov 2007 11:04:35 -0800, "just bob" >>> <[EMAIL PROTECTED]> wrote: >>> >>> Your SPAM appears to be non-existent. Vapour

Re: Movement recognition in video file

2007-11-15 Thread [EMAIL PROTECTED]
On Nov 15, 8:29 am, [EMAIL PROTECTED] wrote: > Hi, > > I am looking for a python tool or module that helps me build a script > that can perceive object moves in a video file captured by a (web) > camera. My main goal is to be able to count people entering a store > using the store's surveillance ca

Re: Volume id

2007-11-15 Thread Tim Golden
Gabor Urban wrote: > OK, you are right... Problem was not precise enough. I need to process CDs > to create a list. Does it ring a bell for you? On Windows, at least, you can do this with WMI: import win32com.client wmi = win32com.client.GetObject ("winmgmts:") for result in wmi.ExecQuery (

Printing user input?

2007-11-15 Thread Mohammed_M
Hi, I'm v.new to Python, so please don't be too harsh :) I get a NameError with the code below - All I want to do is store some input taken from the user in a variable called name, & then print name # START CODE == # Print name demo def PersonsDetails():

Re: Volume id

2007-11-15 Thread kyosohma
On Nov 15, 10:21 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Gabor Urban wrote: > > OK, you are right... Problem was not precise enough. I need to process CDs > > to create a list. Does it ring a bell for you? > > On Windows, at least, you can do this with WMI: > > > import win32com.client > > wmi

Re: Embedded Python - Blocking Python Function

2007-11-15 Thread andy
On Nov 14, 4:20 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Not forcibly - you need some cooperation from the Main function. Maybe > setting a global variable that Main checks periodically. Thanks. I'll give that a try! Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Aaron Watters
On Nov 14, 6:26 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On systems with multiple CPUs or 64-bit systems, or both, creating and/or > deleting a multi-megabyte dictionary in recent versions of Python (2.3, > 2.4, 2.5 at least) takes a LONG time, of the order of 30+ minute

Re: formated local time

2007-11-15 Thread [EMAIL PROTECTED]
On Nov 15, 7:19 am, Nikola Skoric <[EMAIL PROTECTED]> wrote: > I have been trying to find appropriate way to do get local time in > "-mm-dd hh:mm:ss" format, but the best I got is this: > datetime.datetime.fromtimestamp(time.mktime(time.localtime())) > It seems to me I'm missing a much simpler

Re: PyGilState_Ensure interrupts python critical sections

2007-11-15 Thread Chris Mellon
On Nov 15, 2007 4:50 AM, <[EMAIL PROTECTED]> wrote: > Many thanks for the clarification. Also good idea to focus on lock > ownership rather that thread activity in your diagram. > > To be honest I was not actually experiencing deadlock issues. I had > just deduced (incorrectly) that I might do so

Re: why there is no pythonscript insine web browsers?

2007-11-15 Thread kyosohma
On Nov 14, 9:42 am, Piet van Oostrum <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] (k) wrote: > >k> On Nov 12, 12:07 pm, Timuçin K z lay <[EMAIL PROTECTED]> wrote: > >>> I'm an old programmer coming from a cobol background and started to > >>> learn python. I'm using javasript for web based

RE: formated local time

2007-11-15 Thread Adam Pletcher
datetime also has the strftime method: import datetime datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') - Adam > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of [EMAIL PROTECTED] > Sent: Thursday, November 15, 2007 9:56 AM > To: python-list@py

Re: Volume id

2007-11-15 Thread Gabor Urban
OK, you are right... Problem was not precise enough. I need to process CDs to create a list. Does it ring a bell for you? Thanks 2007/11/15, Laszlo Nagy <[EMAIL PROTECTED]>: > > Gabor Urban wrote: > > Hi, > > > > I have a problem, which may be trivial, but I could not find an answer. > > > > I h

formated local time

2007-11-15 Thread Nikola Skoric
I have been trying to find appropriate way to do get local time in "-mm-dd hh:mm:ss" format, but the best I got is this: datetime.datetime.fromtimestamp(time.mktime(time.localtime())) It seems to me I'm missing a much simpler method, am I? -- "Now the storm has passed over me I'm left to drif

Re: Custom Tkinter scrollbar

2007-11-15 Thread jim-on-linux
On Wednesday 14 November 2007 18:22, [EMAIL PROTECTED] wrote: > I want to create a custom scrollbar using particular images, which > will then be placed on a canvas to control another window on the > canvas. Right now I am inheriting from scrollbar, but I do the > movement with custom functions.

logging.SocketHandler connections

2007-11-15 Thread oj
Hi folks, I'm writing some fairly simple logging code that makes use of the SocketHandler. The example server code works fine, as expected. (http:// docs.python.org/lib/network-logging.html) However, initially, I had tried it with a server that closed the connection after receiving each record,

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-15 Thread Aaron Watters
On Nov 14, 6:26 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > >> Someone please summarize. > > > Yes, that would be good. > > On systems with multiple CPUs or 64-bit systems, or both, creating and/or > deleting a multi-megabyte dictionary in recent versions of Python (2.3, > 2

Re: ANN: PyInkblot - Creating Rorschach Inkblots using Genetic Algorithms

2007-11-15 Thread SamFeltus
I suspect you could make it visually far more interesting if you replaced the colored pixels with colorful images, and mapped the images on a grid using Flash. -- http://mail.python.org/mailman/listinfo/python-list

Re: why there is no pythonscript insine web browsers?

2007-11-15 Thread Alberto Berti
> "Piet" == Piet van Oostrum <[EMAIL PROTECTED]> writes: Piet> CGI is server-side. The OP was asking for client-side Piet> embedding of Python. FireFox 3 aka "Gran Paradiso" can be compiled to have python scripting but for security reasons it can be used only on crome:// urls, which l

Re: Resolving declaring class of a method at runtime

2007-11-15 Thread Bjoern Schliessmann
Janne Härkönen wrote: class X: > ... def x(self): > ...pass > ... class Y(X): > ... def y(self): > ...pass > ... y = Y() y.x.im_class > y.y.im_class > > > What I would like to find out is the declaring class of method x, > ie. class X How to do this ? The g

Re: Movement recognition in video file

2007-11-15 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, > > I am looking for a python tool or module that helps me build a script > that can perceive object moves in a video file captured by a (web) > camera. My main goal is to be able to count people entering a store > using the store's surveillance camera. > > I know

Movement recognition in video file

2007-11-15 Thread mindmaster32
Hi, I am looking for a python tool or module that helps me build a script that can perceive object moves in a video file captured by a (web) camera. My main goal is to be able to count people entering a store using the store's surveillance camera. I know of some packages like Eyesweb (gestural re

ANN: PyInkblot - Creating Rorschach Inkblots using Genetic Algorithms

2007-11-15 Thread placid
Hi All, I've been working on a 'toy' application for the past month or so called PyInkblot. Simply mirroring a random plotting of half of a grid onto the second half, you can create pictures that look 'organic' like Rorschach Inkblot's. PyInkblot uses pygene for the Genetic Algorithm backend and

Re: Resolving declaring class of a method at runtime

2007-11-15 Thread Duncan Booth
"Janne Härkönen" <[EMAIL PROTECTED]> wrote: > $ python > Python 2.5.1 (r251:54863, May 18 2007, 16:56:43) > [GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin > Type "help", "copyright", "credits" or "license" for more information. class X: > ... def x(self): > ...pass >

Re: how to figure out if python was used as a cgi script

2007-11-15 Thread Bjoern Schliessmann
ce wrote: > is there a way to figure out which scripting language was used in > a cgi. I used to watch extensions (i.e. py, pl, asp or php) I'd say that ASP and PHP are rather rarely used for CGI scripts. Also, extensions are essentially meaningless. > nowadays i hardly see any extensions and re

Re: how to figure out if python was used as a cgi script

2007-11-15 Thread Laszlo Nagy
ce wrote: > hi, > > is there a way to figure out which scripting language was used in a > cgi. I used to watch extensions (i.e. py, pl, asp or php) nowadays i > hardly see any extensions and really it is hard to find out anything > from the generated HTML or even the HTML being sent out through the

Re: Memory problem

2007-11-15 Thread Peter Otten
Rolf Wester wrote: > Diez B. Roggisch wrote: >> Rolf Wester wrote: >>> I have a strange (for me) memory problem. When running a loop in a >>> Python program memory usage increases from about 4% up to 100%. I do a >>> gc.collect() every loop cycle but this doesn't help. There are about >>> 67000 o

Re: how to figure out if python was used as a cgi script

2007-11-15 Thread Diez B. Roggisch
ce wrote: > hi, > > is there a way to figure out which scripting language was used in a > cgi. I used to watch extensions (i.e. py, pl, asp or php) nowadays i > hardly see any extensions and really it is hard to find out anything > from the generated HTML or even the HTML being sent out through t

how to figure out if python was used as a cgi script

2007-11-15 Thread ce
hi, is there a way to figure out which scripting language was used in a cgi. I used to watch extensions (i.e. py, pl, asp or php) nowadays i hardly see any extensions and really it is hard to find out anything from the generated HTML or even the HTML being sent out through the FORM tag .. is there

Re: Volume id

2007-11-15 Thread Laszlo Nagy
Gabor Urban wrote: > Hi, > > I have a problem, which may be trivial, but I could not find an answer. > > I have to write a Python script, which does a directory tree walking > on given mounted disk. But I do need to extract the volume id, > somehow. And that's the problem. An additional issue, t

Resolving declaring class of a method at runtime

2007-11-15 Thread Janne Härkönen
Hello, Is there a simple way to resolve declaring class of a method at runtime ? Consider this simple example: $ python Python 2.5.1 (r251:54863, May 18 2007, 16:56:43) [GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin Type "help", "copyright", "credits" or "license" for more in

Re: PyGilState_Ensure interrupts python critical sections

2007-11-15 Thread billy . omahony
Many thanks for the clarification. Also good idea to focus on lock ownership rather that thread activity in your diagram. To be honest I was not actually experiencing deadlock issues. I had just deduced (incorrectly) that I might do so if I started using locks in my py code called from c-land. As

Re: Memory problem

2007-11-15 Thread Rolf Wester
Sorry, of course your are wright. I'm running Python2.5 on Linux, my program imports numpy, matplotlib, sys and a python module of my own. This module uses numpy and scipy.weave for imbedded C-code but no extension modules. I though the code to be to large to show, I hoped you could give me hint

Re: Memory problem

2007-11-15 Thread Diez B. Roggisch
Rolf Wester wrote: > Hi, > > I have a strange (for me) memory problem. When running a loop in a > Python program memory usage increases from about 4% up to 100%. I do a > gc.collect() every loop cycle but this doesn't help. There are about > 67000 objects that are tracked by the garbage collector

Memory problem

2007-11-15 Thread Rolf Wester
Hi, I have a strange (for me) memory problem. When running a loop in a Python program memory usage increases from about 4% up to 100%. I do a gc.collect() every loop cycle but this doesn't help. There are about 67000 objects that are tracked by the garbage collector. This number does vary a li

What is the function to evaluate code object returned by PyParser _SimpleParseString function?

2007-11-15 Thread Borse, Ganesh
Hi, Thanks for this information Py_CompileString takes the source code from file, isn't it? As can be seen from the syntax of this function: "PyObject* Py_CompileString(char *str, char *filename, int start)" I want to parse the code which is in memory - loaded from database. In that case, may I

  1   2   >