Decent 2D animation with Windows.Forms GUI

2008-03-25 Thread Admin.397
Hi folks, I'm running a simple 2D game using Pygame but really would like a decent GUI and am currently testing out wxPython. As it turns out, I can't get Pygame working in a wxPython canvas and instead turned to openGL - which is painfully slow at reading through an array of points. Can anyone ad

Re: subprocess.popen function with quotes

2008-03-25 Thread Gabriel Genellina
En Wed, 26 Mar 2008 02:15:28 -0300, skunkwerk <[EMAIL PROTECTED]> escribió: > On Mar 25, 9:25 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Wed, 26 Mar 2008 00:39:05 -0300, skunkwerk <[EMAIL PROTECTED]>   >> escribió: >> >> >>    i'm trying to call subprocess.popen on the 'rename' f

Re: subprocess.popen function with quotes

2008-03-25 Thread Kurt Smith
On Wed, Mar 26, 2008 at 12:15 AM, skunkwerk <[EMAIL PROTECTED]> wrote: > On Mar 25, 9:25 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > En Wed, 26 Mar 2008 00:39:05 -0300, skunkwerk <[EMAIL PROTECTED]> > > escribió: > > > > > >>i'm trying to call subprocess.popen on the 'rename' f

Re: My python interpreter became mad !

2008-03-25 Thread castironpi
On Mar 25, 7:45 pm, John Machin <[EMAIL PROTECTED]> wrote: > Furkan Kuru incorrigibly top-posted: > > > Ok, you're right. > > > but I did not give it a chance "not trying python interpreter in another > > directory" > > I don't understand that sentence. > > > so if we assume the problem exists in e

Re: subprocess.popen function with quotes

2008-03-25 Thread skunkwerk
On Mar 25, 9:25 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 26 Mar 2008 00:39:05 -0300, skunkwerk <[EMAIL PROTECTED]>   > escribió: > > >>    i'm trying to call subprocess.popen on the 'rename' function in > >> linux.  When I run the command from the shell, like so: > > >> rename -

Re: Prototype OO

2008-03-25 Thread Gabriel Genellina
En Wed, 26 Mar 2008 01:27:15 -0300, <[EMAIL PROTECTED]> escribió: > On Mar 25, 11:24 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> On Wed, 26 Mar 2008 06:49:57 +0800, "Delaney, Timothy (Tim)" >> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: >> >> > As an aside, having lived

4GB USB flash drives for only $14.49

2008-03-25 Thread jimtruck
Hi guys, www.dealsusb.com has 4GB USB flash drives for only $14.49 Free Shipping with warranty Jimmy -- http://mail.python.org/mailman/listinfo/python-list

Re: Prototype OO

2008-03-25 Thread castironpi
On Mar 25, 11:24 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Wed, 26 Mar 2008 06:49:57 +0800, "Delaney, Timothy (Tim)" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > As an aside, having lived much of my early life on a hobby farm, I've > > often wondered to m

Re: subprocess.popen function with quotes

2008-03-25 Thread Gabriel Genellina
En Wed, 26 Mar 2008 00:39:05 -0300, skunkwerk <[EMAIL PROTECTED]> escribió: >>i'm trying to call subprocess.popen on the 'rename' function in >> linux. When I run the command from the shell, like so: >> >> rename -vn 's/\.htm$/\.html/' *.htm >> >> it works fine... however when I try to do i

Re: last mouse movment or keyboard hit

2008-03-25 Thread Gabriel Genellina
En Wed, 26 Mar 2008 00:38:08 -0300, Ron Eggler <[EMAIL PROTECTED]> escribió: > I would like to get the time of the most recent human activity like a > cursor > movement or a key hit. > Does anyone know how I can get this back to start some action after there > has been no activity for X minutes/

Re: subprocess.popen function with quotes

2008-03-25 Thread skunkwerk
also, i've tried the Shell=True parameter for Popen, but that didn't seem to make a difference On Mar 25, 8:31 pm, skunkwerk <[EMAIL PROTECTED]> wrote: > Hi, >i'm trying to call subprocess.popen on the 'rename' function in > linux. When I run the command from the shell, like so: > > rename -v

last mouse movment or keyboard hit

2008-03-25 Thread Ron Eggler
Hi, I would like to get the time of the most recent human activity like a cursor movement or a key hit. Does anyone know how I can get this back to start some action after there has been no activity for X minutes/seconds? Thank you! -- chEErs roN -- http://mail.python.org/mailman/listinfo/pytho

Re: Files, directories and imports - relative to the current directory only

2008-03-25 Thread ptrk . mcm
On Mar 25, 11:27 am, ptn <[EMAIL PROTECTED]> wrote: > Hello, group. > > I can only read files and import modules that are in the same > directory > as the one my script is. Here is a test script (path.py): > > import os > import uno # some module I wrote > > print list(os.

subprocess.popen function with quotes

2008-03-25 Thread skunkwerk
Hi, i'm trying to call subprocess.popen on the 'rename' function in linux. When I run the command from the shell, like so: rename -vn 's/\.htm$/\.html/' *.htm it works fine... however when I try to do it in python like so: p = subprocess.Popen(["rename","-vn","'s/\.htm$/ \.html/'","*.htm"],st

RE: Can I run a python program from within emacs?

2008-03-25 Thread Sells, Fred
I use a .emacs file (attached) that some associates gave me nearly 20 years ago. Some of it is OBE now, but it still works for me on both windows and Linux. With this file I can cntrl-c cntrl-c (i.e. ^c twice to run the current buffer). Don't ask me to explain it, it just works. > -Orig

Re: python hash() function

2008-03-25 Thread Alvin Delagon
Thanks for the fast replies guys. Very much appreciated. :) --- Alvin -- http://mail.python.org/mailman/listinfo/python-list

Re: How to send a var to stdin of an external software

2008-03-25 Thread Bryan Olson
Benjamin Watine wrote: > OK, so if I understand well what you said, using queue allow to be sure > that the data is passed in totality before coninuing with next > instruction. That make sense. Right. > Using thread and queue seems to be very more slow than using files > redirection with bash.

announcing allmydata.org "Tahoe", the Least-Authority Filesystem, v1.0

2008-03-25 Thread zooko
Folks: This open source project is written entirely in Python, except of course for the performance-intensive or system-integration parts that are written in C/C++ -- things like erasure coding and encryption. Python has served as well. It is elegant enough and simple enough, and the imple

TUTORIALS ON PROGRAMMING LANGUAGES

2008-03-25 Thread Santhosh1992
languages Have the complete details regarding programming languages. http://operatingsys.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python hash() function

2008-03-25 Thread Dan Bishop
On Mar 25, 9:22 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Alvin Delagon" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | Hello, > | > | >>> hash("foobar") > | -1969371895 > | > | Anyone can explain to me how the hash() function in python does its work? > A > | link to its

Re: python hash() function

2008-03-25 Thread Christian Heimes
Alvin Delagon schrieb: > Hello, > hash("foobar") > -1969371895 > > Anyone can explain to me how the hash() function in python does its work? A > link to its source could help me a lot also. I'm looking for a way to > replicate this function in php. Thanks in advance. The code is in Objects/

Re: python hash() function

2008-03-25 Thread Terry Reedy
"Alvin Delagon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hello, | | >>> hash("foobar") | -1969371895 | | Anyone can explain to me how the hash() function in python does its work? A | link to its source could help me a lot also. I'm looking for a way to | replicate this funct

python hash() function

2008-03-25 Thread Alvin Delagon
Hello, >>> hash("foobar") -1969371895 Anyone can explain to me how the hash() function in python does its work? A link to its source could help me a lot also. I'm looking for a way to replicate this function in php. Thanks in advance. --- Alvin -- http://mail.python.org/mailman/listinfo/python

4gb USB Flash drive for $14.49

2008-03-25 Thread craigtrucko
Hey Guys, dealsusb.com has a 4gb USB Flash drive for $14.49 Free Shipping and no rebates. Now we can backup our smaller Databases onto a USB really cheap. craig -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling a shared library using C types

2008-03-25 Thread Nathan Harmston
Hi, Just as a follow up to this...I ve discovered that its an issue with building shared libraries on mac os and it works fine on a Linux box :S. Thanks Nathan On 25/03/2008, Nathan Harmston <[EMAIL PROTECTED]> wrote: > > > > On 25/03/2008, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > > > E

Re: My python interpreter became mad !

2008-03-25 Thread Gabriel Genellina
En Tue, 25 Mar 2008 22:14:39 -0300, Furkan Kuru <[EMAIL PROTECTED]> escribió: > I did not think he/she/anyone would ask the question in the main thread > without trying the interpreter a few times starting it from different > directories. Perhaps *you* would do that, but that is far beyond a ne

Re: embedded python pythonpath

2008-03-25 Thread Gabriel Genellina
En Tue, 25 Mar 2008 22:22:41 -0300, Furkan Kuru <[EMAIL PROTECTED]> escribió: > On 3/26/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > >> En Tue, 25 Mar 2008 20:38:39 -0300, Furkan Kuru <[EMAIL PROTECTED]> >> escribió: >> >> > Actually, I do not want any .py or .pyc files around my executabl

Re: embedded python pythonpath

2008-03-25 Thread Furkan Kuru
On 3/26/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Tue, 25 Mar 2008 20:38:39 -0300, Furkan Kuru <[EMAIL PROTECTED]> > escribió: > > > Actually, I do not want any .py or .pyc files around my executable. > > (including userdict, sys, site etc) > > I want to have just single zip file for a

Re: My python interpreter became mad !

2008-03-25 Thread Furkan Kuru
On 3/26/08, John Machin <[EMAIL PROTECTED]> wrote: > > > > but I did not give it a chance "not trying python interpreter in another > > directory" > > I don't understand that sentence. ok let me explain: I did not think he/she/anyone would ask the question in the main thread without trying the in

urllib2.urlopen gives error 10060

2008-03-25 Thread Jinshi
Hello, everyone, I am quite new to python and I don't know how to solve this problem. I hope someone can help me. I just did a test in python shell: >>> import urllib2 >>> urllib2.urlopen("http://python.org";) Traceback (most recent call last): File "c:\Zope\", line 1, in ? File "C:\Zop

Re: embedded python pythonpath

2008-03-25 Thread Gabriel Genellina
En Tue, 25 Mar 2008 20:38:39 -0300, Furkan Kuru <[EMAIL PROTECTED]> escribió: > Actually, I do not want any .py or .pyc files around my executable. > (including userdict, sys, site etc) > I want to have just single zip file for all python files. Putting all of them into pythonNN.zip (NN dependi

Re: dynamically created names / simple problem

2008-03-25 Thread John Nagle
Robert Bossy wrote: > Jules Stevenson wrote: >> >> Hello all, >> >> I'm fairly green to python and programming, so please go gently. The >> following code >> >> for display in secondary: >> >> self.("so_active_"+display) = wx.CheckBox(self.so_panel, -1, >> "checkbox_2") >> >> Errors, because of t

Re: My python interpreter became mad !

2008-03-25 Thread John Machin
Furkan Kuru incorrigibly top-posted: > Ok, you're right. > > but I did not give it a chance "not trying python interpreter in another > directory" I don't understand that sentence. > so if we assume the problem exists in every directory, it has something > to do with pythonpath. Why would/

Re: what are generators?

2008-03-25 Thread Miki
On Mar 24, 8:17 am, [EMAIL PROTECTED] wrote: > I'm looking for a cool trick using generators.  Know any exercises I > can work? Simple one the comes to mind is flattening a list: >>> list(flatten([1, [[2], 3], [[[4)) [1, 2, 3, 4] >>> HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot

Re: Beta testers needed for a high performance Python application server

2008-03-25 Thread Graham Dumpleton
On Mar 26, 11:00 am, Damjan <[EMAIL PROTECTED]> wrote: > >> I'm looking for beta testers for a high performance, event-driven Python > >> application server I've developed. > > >> About the server: the front end and other speed-critical parts of the > >> server are written in portable, multithreade

Re: how to dynamically create class methods ?

2008-03-25 Thread jv
Steven D'Aprano wrote: > On Tue, 25 Mar 2008 14:17:16 -0600, j vickroy wrote: > >> As per your suggestion, I tried looking at include/code.h and >> include/funcobject.h (my MS Windows distribution does not appear to >> contain .c files). However, since I'm not a C programmer, I did not >> find th

Re: Beta testers needed for a high performance Python application server

2008-03-25 Thread Damjan
>> I'm looking for beta testers for a high performance, event-driven Python >> application server I've developed. >> >> About the server: the front end and other speed-critical parts of the >> server are written in portable, multithreaded C++. ... > Why not just put it on the net somewhere and tel

Re: Filtering a Python list to uniques

2008-03-25 Thread Mensanator
On Mar 25, 6:30 pm, kellygreer1 <[EMAIL PROTECTED]> wrote: > What is the best way to filter a Python list to its unique members? > I tried some method using Set but got some "unhashable" error. > > lstone = [ 1, 2, 3, 3, 4, 5, 5, 6 ] > # how do i reduce this to > lsttwo = [ 1, 2, 3, 4, 5, 6 ] > > I

Re: Filtering a Python list to uniques

2008-03-25 Thread Furkan Kuru
set(lstone) works fine in python 2.5.1 Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> lstone = [ 1, 2, 3, 3, 4, 5, 5, 6 ] >>> set(lstone) set([1, 2, 3, 4, 5, 6]) On 3/26/08, kellygr

Re: Filtering a Python list to uniques

2008-03-25 Thread bearophileHUGS
Kelly Greer: > What is the best way to filter a Python list to its unique members? If Python is "batteries included", then an industrial-strength unique() seems one of the most requested 'batteries' that's not included :-) I feel that it's coming in Python 2.6/3.x. In the meantime: http://aspn.act

Re: embedded python pythonpath

2008-03-25 Thread Furkan Kuru
Actually, I do not want any .py or .pyc files around my executable. (including userdict, sys, site etc) I want to have just single zip file for all python files. I had a look at py2exe source codes but could not figure out how it just looks into a zip file. So maybe I have to compile the svn vers

Filtering a Python list to uniques

2008-03-25 Thread kellygreer1
What is the best way to filter a Python list to its unique members? I tried some method using Set but got some "unhashable" error. lstone = [ 1, 2, 3, 3, 4, 5, 5, 6 ] # how do i reduce this to lsttwo = [ 1, 2, 3, 4, 5, 6 ] Is there a page on this in the Python in a Nutshell or the Python Cookbook

Re: Beta testers needed for a high performance Python application server

2008-03-25 Thread Graham Dumpleton
On Mar 26, 7:31 am, Minor Gordon <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm looking for beta testers for a high performance, event-driven Python > application server I've developed. > > About the server: the front end and other speed-critical parts of the > server are written in portable, mult

Re: embedded python pythonpath

2008-03-25 Thread Gabriel Genellina
Furkan Kuru gmail.com> writes: > I've tried below code (Setting pythonpath environment variable) > and then initialize python interpreter but the embedded python interpreter did not get the newly assigned PYTHONPATH. > I ve looked at the sys.path in python code (that is run by the embedded int

Re: _tkinter fails when installing Python 2.4.4

2008-03-25 Thread jgelfand
On Mar 25, 5:52 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > jgelfand schrieb: > > > > > I'm installing Python 2.4.4 on a CentOS release 4.6 (Final) [RedHat > > Enterprise Linux 4.6] 64-bit machine. Running "./configure --prefix="/ > > usr/local/yosi/ciao-4.0/ots" --enable-shared" appears to

Re: My python interpreter became mad !

2008-03-25 Thread Furkan Kuru
Ok, you're right. but I did not give it a chance "not trying python interpreter in another directory" so if we assume the problem exists in every directory, it has something to do with pythonpath. you can try setting pythonpath to some directory and put a re.py there and try from any directory st

RE: Prototype OO

2008-03-25 Thread Delaney, Timothy (Tim)
John Machin wrote: > On Mar 23, 12:32 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> John Machin schrieb: >> >>> On Mar 21, 11:48 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> [1] Just one example:http://docs.mootools.net/Class/Class.js >> >>> Mootools being something a cowork

Re: how to dynamically create class methods ?

2008-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2008 14:17:16 -0600, j vickroy wrote: > As per your suggestion, I tried looking at include/code.h and > include/funcobject.h (my MS Windows distribution does not appear to > contain .c files). However, since I'm not a C programmer, I did not > find the .h files all that helpful. I

Re: what does ^ do in python

2008-03-25 Thread Tim Chase
> In most of the languages ^ is used for 'to the power of'. > > No, not in most languages. In most languages (C, C++, Java, C#, Python, > Fortran, ...), ^ is the xor operator ;) ...and in Pascal it's the pointer-dereferencing operator... -tkc -- http://mail.python.org/mailman/listinfo/python-

Re: what does ^ do in python

2008-03-25 Thread Matthieu Brucher
Hi, In most of the languages ^ is used for 'to the power of'. > No, not in most languages. In most languages (C, C++, Java, C#, Python, Fortran, ...), ^ is the xor operator ;) Matthieu -- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and h

Re: what does ^ do in python

2008-03-25 Thread Heiko Wundram
Am Dienstag, 25. März 2008 23:02:00 schrieb Dark Wind: > In most of the languages ^ is used for 'to the power of'. In python we have > ** for that. But what does ^ do? ^ is the binary exclusive-or (xor) operator. Possibly it helps to see the following (numbers are in binary) to get the drift: 0

Re: what does ^ do in python

2008-03-25 Thread Christian Heimes
Dark Wind schrieb: > Hi, > > In most of the languages ^ is used for 'to the power of'. In python we have > ** for that. But what does ^ do? > I could not get it just by using it ... some examples are: > 1^1 returns 0 > 2^2 returns 0 > 1^4 returns 5 > 4^1 returns 5 > 3^5 returns 6 > 5^3 returns 6 .

Re: what does ^ do in python

2008-03-25 Thread Guilherme Polo
2008/3/25, Dark Wind <[EMAIL PROTECTED]>: > Hi, > > In most of the languages ^ is used for 'to the power of'. In python we have > ** for that. But what does ^ do? It is bitwise xor. Some more information can be found at http://docs.python.org/ref/bitwise.html > I could not get it just by using it

Re: Does python hate cathy?

2008-03-25 Thread castironpi
On Mar 23, 8:05 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > When I run this script, I got the following exception: > > Exception exceptions.AttributeError: "'NoneType' object has no > > attribute 'population'" in > <__main__.Person instance at 0xb7d8ac6c>> ignored > > > To to newcomer like me, th

what does ^ do in python

2008-03-25 Thread Dark Wind
Hi, In most of the languages ^ is used for 'to the power of'. In python we have ** for that. But what does ^ do? I could not get it just by using it ... some examples are: 1^1 returns 0 2^2 returns 0 1^4 returns 5 4^1 returns 5 3^5 returns 6 5^3 returns 6 .. just curious Thank you -- http:/

embedded python pythonpath

2008-03-25 Thread Furkan Kuru
Hello, It is somehow related with c++ and python. I've tried below code (Setting pythonpath environment variable) and then initialize python interpreter but the embedded python interpreter did not get the newly assigned PYTHONPATH. I ve looked at the sys.path in python code (that is run by the emb

Re: _tkinter fails when installing Python 2.4.4

2008-03-25 Thread Diez B. Roggisch
jgelfand schrieb: > I'm installing Python 2.4.4 on a CentOS release 4.6 (Final) [RedHat > Enterprise Linux 4.6] 64-bit machine. Running "./configure --prefix="/ > usr/local/yosi/ciao-4.0/ots" --enable-shared" appears to be fine, but > I get the following error message when I run "make": > > buildi

RE: Breaking the barrier of a broken paradigm... part 1

2008-03-25 Thread Ryan Ginstrom
> On Behalf Of Bruno Desthuilliers > >> for line in open("/etc/passwd"): > > NB : this idiom relies on the VM automatically closing files, > which is not garanteed on each and every implementation > (IIRC, jython won't do it). This is ok for Q&D throwaway > scripts targeting CPython, but should

_tkinter fails when installing Python 2.4.4

2008-03-25 Thread jgelfand
I'm installing Python 2.4.4 on a CentOS release 4.6 (Final) [RedHat Enterprise Linux 4.6] 64-bit machine. Running "./configure --prefix="/ usr/local/yosi/ciao-4.0/ots" --enable-shared" appears to be fine, but I get the following error message when I run "make": building '_tkinter' extension gcc -p

[Fwd: Beta testers needed for a high performance Python application server]

2008-03-25 Thread Minor Gordon
One thing I forgot to add: the code is GPLv2, though I'll consider alternative licenses for specific users. Original Message Subject: Beta testers needed for a high performance Python application server Date: Tue, 25 Mar 2008 20:31:39 + From: Minor Gordon <[EMAIL PROTECTED

Re: My python interpreter became mad !

2008-03-25 Thread John Machin
Furkan Kuru top-posted: > Most probably X-Spam added itself to your path. What is "X-Spam"? Added itself to Benjamin's path [not mine] in such a fashion that it is invoked when one does "import re"? > you should look at your PATH and PYTHONPATH environment variables. Most *IM*probably. Read the

Beta testers needed for a high performance Python application server

2008-03-25 Thread Minor Gordon
Hello all, I'm looking for beta testers for a high performance, event-driven Python application server I've developed. About the server: the front end and other speed-critical parts of the server are written in portable, multithreaded C++. The back end is an embedded CPython interpreter. The s

Re: how to dynamically create class methods ?

2008-03-25 Thread Gabriel Genellina
En Tue, 25 Mar 2008 17:17:16 -0300, j vickroy <[EMAIL PROTECTED]> escribió: > Arnaud Delobelle wrote: >> On Mar 25, 6:13 pm, j vickroy <[EMAIL PROTECTED]> wrote: >>> Hello, >>> >>> Here is some pseudo-code that hopefully illustrates what I want to do: >>> >>> records = list(...) >>> for record i

Re: python, dbus and pointers help.

2008-03-25 Thread Glich
A replay from ubuntu forums: by Roptaty: Using dbus you can only get information from Pidgin, you cant modify the information. To do this, you need to write a plugin loaded in Pidgin. (See http://developer.pidgin.im/wiki/DbusHowto ) -- http://mail.python.org/mailman/listinfo/python-list

Re: how to dynamically create class methods ?

2008-03-25 Thread j vickroy
Arnaud Delobelle wrote: > On Mar 25, 6:13 pm, j vickroy <[EMAIL PROTECTED]> wrote: >> Hello, >> >> Here is some pseudo-code that hopefully illustrates what I want to do: >> >> records = list(...) >> for record in records: >> new_fcn = define_a function_for(record) >> instance = my_new_class

Re: Circular references not being cleaned up by Py_Finalize()

2008-03-25 Thread blackpawn
> Does the Noddy example use GC (Py_TPFLAGS_HAVE_GC)? Container objects > must use the cycle GC or circular referneces aren't broken. Have you > tried calling PyGC_Collect() multiple times? Yeah the Noddy example is from "2.1.3 Supporting cyclic garbage collection" part of the Python docs. They l

Re: Circular references not being cleaned up by Py_Finalize()

2008-03-25 Thread Paul McGuire
On Mar 25, 2:32 pm, blackpawn <[EMAIL PROTECTED]> wrote: > I've been trying to get garbage collection of circular references to > work properly with no success then I noticed the documentation stating > that it just doesn't: > > From documentation on Py_Finalize() -> "Memory tied up in circular > r

Re: "Soup Strainer" for ElementSoup?

2008-03-25 Thread erikcw
On Mar 25, 12:17 am, John Nagle <[EMAIL PROTECTED]> wrote: > erikcwwrote: > > Hi all, > > > I was reading in the Beautiful Soup documentation that you should use > > a "Soup Strainer" object to keep memory usage down. > > > Since I'm already using Element Tree elsewhere in the project, I > > figure

Re: PyGTK localisation on Win32

2008-03-25 Thread Jarek Zgoda
jwesonga pisze: > I've built an app on linux which we have managed to localise into at > least three languages, the app runs well using this command LANG=fr_FR > python app.py which would translate the app into french. We've tried > the replicate the same principle on windows but so far nothing wor

Re: setattr what is the parent object?

2008-03-25 Thread Gabriel Genellina
En Tue, 25 Mar 2008 15:46:57 -0300, Jules Stevenson <[EMAIL PROTECTED]> escribió: > I'm trying to use setattr to dynamically name and layout gui wx widgets, > this is all fine and dandy until I've run up against something where I > simply don't know what the object is, please see the amended **d

Re: Circular references not being cleaned up by Py_Finalize()

2008-03-25 Thread Christian Heimes
blackpawn schrieb: > So what's the deal here? :) I want all objects to be freed when I > shut down and their destruction functions to be properly called. Is > there really no way to make this happen? Does the Noddy example use GC (Py_TPFLAGS_HAVE_GC)? Container objects must use the cycle GC or

Re: Files, directories and imports - relative to the current directory only

2008-03-25 Thread Gabriel Genellina
En Tue, 25 Mar 2008 15:35:34 -0300, Bjoern Schliessmann <[EMAIL PROTECTED]> escribió: > ptn wrote: >> Traceback (most recent call last): >> File "path.py", line 4, in >> f = open('~/read/foo.txt') >> IOError: [Errno 2] No such file or >> directo

Re: Circular references not being cleaned up by Py_Finalize()

2008-03-25 Thread Marc 'BlackJack' Rintsch
On Tue, 25 Mar 2008 12:32:17 -0700, blackpawn wrote: > So what's the deal here? :) I want all objects to be freed when I > shut down and their destruction functions to be properly called. Then you want something that's not guaranteed by the language. Ciao, Marc 'BlackJack' Rintsch --

Re: how to dynamically create class methods ?

2008-03-25 Thread Arnaud Delobelle
On Mar 25, 6:13 pm, j vickroy <[EMAIL PROTECTED]> wrote: > Hello, > > Here is some pseudo-code that hopefully illustrates what I want to do: > > records = list(...) > for record in records: >     new_fcn = define_a function_for(record) >     instance = my_new_class_instance() >     setattr(instance

Circular references not being cleaned up by Py_Finalize()

2008-03-25 Thread blackpawn
I've been trying to get garbage collection of circular references to work properly with no success then I noticed the documentation stating that it just doesn't: >From documentation on Py_Finalize() -> "Memory tied up in circular references between objects is not freed. " I copy pasted the Noddy

Re: any good g.a.'s?

2008-03-25 Thread castironpi
On Mar 25, 11:03 am, Tim Chase <[EMAIL PROTECTED]> wrote: > > Any good genetic algorithms involving you-split, i-pick? > > I've always heard it as "you divide, I decide"... > > That said, I'm not sure how that applies in a GA world.  It's > been a while since I've done any coding with GAs, but I do

Re: Disable resize button

2008-03-25 Thread myonov
On Mar 24, 5:45 pm, Francesco Bochicchio <[EMAIL PROTECTED]> wrote: > Il Mon, 24 Mar 2008 04:38:50 -0700, myonov ha scritto: > > > > > Hi! > > > I need to disable resize button in Tkinter. I inherit the Frame class. > > Then in the constructor i make my buttons, labels, etc. Then I pack them > > an

Re: Beautiful Soup Looping Extraction Question

2008-03-25 Thread Stefan Behnel
Hi, again, not BS related, but still a solution. Tess wrote: > Let's say I have a file that looks at file.html pasted below. > > My goal is to extract all elements where the following is true: align="left"> and . Using lxml: from lxml import html tree = html.parse("file.html") for el in

Re: Inheritance question

2008-03-25 Thread Tzury Bar Yochay
Hi all, I would like to thank you all for all the suggestions. what I did was simply extending the super class data with data from its child using the id example, Foo.id = 1 is now = [1] and the FooSon does self.id.append(2) the system designer wanted inheritance+java and I wanted Python +Functi

setattr what is the parent object?

2008-03-25 Thread Jules Stevenson
I'm trying to use setattr to dynamically name and layout gui wx widgets, this is all fine and dandy until I've run up against something where I simply don't know what the object is, please see the amended **don't know** in the following code. class MyFrame2(wx.Frame): def __init__(self, *a

Re: Inheritance question

2008-03-25 Thread castironpi
On Mar 25, 12:01 pm, Robert Bossy <[EMAIL PROTECTED]> wrote: > Hi, > > I'm not sure what you're trying to actually achieve, but it seems that > you want an identificator for classes, not for instances. In this case, > setting the id should be kept out of __init__ since it is an instance > initializ

Re: Files, directories and imports - relative to the current directory only

2008-03-25 Thread Bjoern Schliessmann
ptn wrote: > Traceback (most recent call last): > File "path.py", line 4, in > f = open('~/read/foo.txt') > IOError: [Errno 2] No such file or > directory: '~/read/foo.txt' > [...] > So, what's wrong here? Maybe there's something I haven't set up

Re: Does python hate cathy?

2008-03-25 Thread Hrvoje Niksic
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes: > On Tue, 25 Mar 2008 14:58:51 +, Edward A. Falk wrote: > >> In article <[EMAIL PROTECTED]>, >> Patrick Mullen <[EMAIL PROTECTED]> wrote: >> >>>Then again, I can count the number of times I have ever needed __del__ >>>with no fingers (never

how to dynamically create class methods ?

2008-03-25 Thread j vickroy
Hello, Here is some pseudo-code that hopefully illustrates what I want to do: records = list(...) for record in records: new_fcn = define_a function_for(record) instance = my_new_class_instance() setattr(instance, 'myfcn', new_fcn) instance.execute() # instance.execute() calls ins

Re: Does python hate cathy?

2008-03-25 Thread Marc 'BlackJack' Rintsch
On Tue, 25 Mar 2008 14:58:51 +, Edward A. Falk wrote: > In article <[EMAIL PROTECTED]>, > Patrick Mullen <[EMAIL PROTECTED]> wrote: > >>Then again, I can count the number of times I have ever needed __del__ >>with no fingers (never used it!). Still, quite interesting to >>explore. > > I use

Re: Beautiful Soup Looping Extraction Question

2008-03-25 Thread Tess
Paul - you are very right. I am back to the drawing board. Tess -- http://mail.python.org/mailman/listinfo/python-list

Re: Inheritance question

2008-03-25 Thread Robert Bossy
Hi, I'm not sure what you're trying to actually achieve, but it seems that you want an identificator for classes, not for instances. In this case, setting the id should be kept out of __init__ since it is an instance initializer: make id static and thus getid() a classmethod. Furthermore, if yo

Re: Issues with Python + Batch File

2008-03-25 Thread Gabriel Genellina
En Tue, 25 Mar 2008 08:55:12 -0300, tarun <[EMAIL PROTECTED]> escribió: > I've a batch file which invoks a python file. The python code in the file > brings up a GUI. The GUI is of a test tool which can execute scripts. > > I tried using the following 2 sample of code for my batch file: > > *

Re: Breaking the barrier of a broken paradigm... part 1

2008-03-25 Thread Bruno Desthuilliers
john s. a écrit : > On Mar 24, 9:39 pm, "Ryan Ginstrom" <[EMAIL PROTECTED]> wrote: >>> On Behalf Of john s. >>> import os, sys, string, copy, getopt, linecache >>> from traceback import format_exception >>> #The file we read in... >>> fileHandle = "/etc/passwd" >>> srcFile = open(fileHandle,'r') >>

Re: Inheritance question

2008-03-25 Thread Gerard Flanagan
On Mar 25, 4:37 pm, Brian Lane <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > > Gerard Flanagan wrote: > > Use the child class when calling super: > > > -- > > class Foo(object): > > def __init__(self): > > self.id

Re: A "roadmap" for ctypes wrapping?

2008-03-25 Thread Alaric Haag
In article <[EMAIL PROTECTED]>, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Alaric Haag schrieb: > > Hi all, > > > > stuff deleted > > > > == > > Can anyone with some "wrapping" experience add/modify/enhance the above? > > Use gccxml to gather the typedefs. And look at Gary Bis

Re: Breaking the barrier of a broken paradigm... part 1

2008-03-25 Thread Gabriel Genellina
En Tue, 25 Mar 2008 07:44:59 -0300, john s. <[EMAIL PROTECTED]> escribió: >> for line in open("/etc/passwd"): >> user, _pwd = line.split(":") >^- Ok this one here we are taking a string spliting it > into to variables... >user gets one (the first) and _pwd gets to

Files, directories and imports - relative to the current directory only

2008-03-25 Thread ptn
Hello, group. I can only read files and import modules that are in the same directory as the one my script is. Here is a test script (path.py): import os import uno # some module I wrote print list(os.walk('~/hacking/python')) f = open('~/read/foo.txt')

Re: Inheritance question

2008-03-25 Thread Eric Brunel
On Tue, 25 Mar 2008 16:37:00 +0100, Brian Lane <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Gerard Flanagan wrote: > >> Use the child class when calling super: >> >> -- >> class Foo(object): >> def __init__(self): >>

Re: importing a csv file as a Numeric array

2008-03-25 Thread Gabriel Genellina
En Tue, 25 Mar 2008 06:46:57 -0300, Rahul <[EMAIL PROTECTED]> escribió: > What's a good way of importing a csv text file of floats into a > Numeric array? I tried the csv module and it seems to work well so > long as I've ints. Does anyone have any suggestions / snippets that > work to import a c

Re: Outlook 2003 and Python

2008-03-25 Thread cuordileone
On Mar 25, 3:52 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > cuordileone wrote: > > Good Day. > > > I woul like to ask you if it is possible to make a program in python > > that move the email messages that I had received in outlook 2003, to a > > specific folder, accoding to the sender's name: > >

Re: Creating dynamic objects with dynamic constructor args

2008-03-25 Thread Robert Bossy
[EMAIL PROTECTED] wrote: > I'd like to create objects on the fly from a pointer to the class > using: instance = klass() But I need to be able to pass in variables > to the __init__ method. I can recover the arguments using the > inspect.argspec, but how do I call __init__ with a list of argu

Finding Will Ware

2008-03-25 Thread Bill Horst
I am looking for Will Ware, but his website (willware.net) is not responding, so I'm guessing at a email addresses for him. Please let me know where he can be reached. (Will, this is regarding Sue Bauter, who was a close friend of mine at ISU in '72. Please reply so I can correspond with you abo

Re: Inheritance question

2008-03-25 Thread Diez B. Roggisch
Anthony wrote: > On Mar 25, 2:31 pm, Tzury Bar Yochay <[EMAIL PROTECTED]> wrote: >> I wish it was that simple but 'a = Foo().getid()' is actually creating >> a new instance of Foo whereas I want the data of the Foo instanced by >> __init__ of FooSon(). > > I don't think Foo.__init__(self) creates

Re: Inheritance question

2008-03-25 Thread Hrvoje Niksic
Brian Lane <[EMAIL PROTECTED]> writes: > Basically, you can't do what you are trying to do without using a > different variable, ...or abusing the __foo private identifier trick. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >