Fwd: Cisco's $100,000 Developer Contest

2008-11-06 Thread Guido van Rossum
This seems of interest to Python developers all over the world. Develop a Python app to run on a Cisco router and win real money! --Guido -- Forwarded message -- From: Guido van Rossum [EMAIL PROTECTED] Date: Thu, Nov 6, 2008 at 1:14 PM Subject: Re: For Guido van Rossum: Cisco's

Re: subprocess and PPID

2008-11-06 Thread Michele Petrazzo
Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Michele Petrazzo wrote: I have a code that execute into a Popen a command (ssh). I need that, if the python process die, the parent pid (PPID) of the child don't become 1 (like I can seen on /proc/$pid$/status ), but it has to die,

Re: subprocess and PPID

2008-11-06 Thread Michele Petrazzo
[EMAIL PROTECTED] wrote: It's possible in linux and with subprocess? AFAIK, there is no easy way to do this. If the parent python process is doing a controlled exit, just kill the child via close() on Popen() handle. Like I do ;) If the parent is doing a uncontrolled exit (say via a

(Windows) Dropping stuff onto a Python script

2008-11-06 Thread daniel . haude
Hello people, I'd like to have the functionality known from real executables that if I drag-drop a file icon on top of the app, the app starts and has the file's path as command-line argument. However, this doesn't seem to work with Python scripts because Windows sees those just as files, not

contextlib.nested()

2008-11-06 Thread brasse
Hello! I have been running in to some problems when using contextlib.nested(). My problem arises when using code similar to this: from __future__ import with_statement from contextlib import nested class Foo(object): def __init__(self, tag, fail=False): print 'ctor', tag

Re: (Windows) Dropping stuff onto a Python script

2008-11-06 Thread Tim Golden
[EMAIL PROTECTED] wrote: Hello people, I'd like to have the functionality known from real executables that if I drag-drop a file icon on top of the app, the app starts and has the file's path as command-line argument. However, this doesn't seem to work with Python scripts because Windows sees

Re: How to build the pysqlite? Where to find the sqlite3.h?

2008-11-06 Thread Thorsten Kampe
* Kurda Yon (Wed, 5 Nov 2008 17:52:08 -0800 (PST)) On Nov 5, 1:55 pm, Thorsten Kampe [EMAIL PROTECTED] wrote: You (and Kurda) keep on talking the wrong stuff. First: you don't need pysqlite2. SQLite support is included in the latest Python as module sqlite3. By the way, I think the above

Re: developing python extensions with CDT and Pydev in Eclipse

2008-11-06 Thread Fabio Zadrozny
I have tried all of those things (on Linux), but without success. Has anyone tried this under Linux? Have you asked on CDT? (the basic idea is that python behaves as a regular program launched, so, that should be something straightforward to do). Cheers, Fabio --

Re: How to build the pysqlite? Where to find the sqlite3.h?

2008-11-06 Thread Thorsten Kampe
* Shawn Milochik (Wed, 5 Nov 2008 14:32:15 -0500) On Wed, Nov 5, 2008 at 1:55 PM, Thorsten Kampe You (and Kurda) keep on talking the wrong stuff. First: you don't need pysqlite2. SQLite support is included in the latest Python as module sqlite3. If for whatever reason you need the

Re: Extract frame from wmv

2008-11-06 Thread Martin
Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Tim Golden wrote: Alternatively, you might be able to commandline control mencoder or ffmpeg itself to do this. Not sure, but there must be *something* among those millions of command-line options! FFmpeg--yes! Unfortunately it looks

Re: Rewriting a bash script in python

2008-11-06 Thread Tim Rowe
2008/11/6 Lawrence D'Oliveiro [EMAIL PROTECTED]: Nothing wrong with rapid prototyping. :) That's one requirements capture methodology, certainly. Actually, there's quite a lot wrong with rapid prototyping, but there's quite a lot wrong with all other requirements capture methodologies too, so

Re: Snippets management

2008-11-06 Thread Robert Lehmann
On Wed, 05 Nov 2008 19:55:51 -0600, Edwin wrote: Hi there, I've been looking for a snippet manager and found PySnippet but it requires PyGTK. Do you know any other option that doesn't need much? [snip] If you're looking for a snippet manager for actually *using* it (not educational

Re: contextlib.nested()

2008-11-06 Thread Robert Lehmann
On Thu, 06 Nov 2008 01:02:34 -0800, brasse wrote: Hello! I have been running in to some problems when using contextlib.nested(). My problem arises when using code similar to this: from __future__ import with_statement from contextlib import nested class Foo(object): def

_checkversion.py

2008-11-06 Thread user
As part of the Python 2.5 distribution there are some Tools. Are the notions behind checkversions.py still considered current? I find that there is no _checkversion.py in my site-packages. Colin W. -- http://mail.python.org/mailman/listinfo/python-list

Re: Snippets management

2008-11-06 Thread Edwin
Robert Lehmann [EMAIL PROTECTED] writes: On Wed, 05 Nov 2008 19:55:51 -0600, Edwin wrote: Hi there, I've been looking for a snippet manager and found PySnippet but it requires PyGTK. Do you know any other option that doesn't need much? [snip] If you're looking for a snippet manager for

Re: How to re-import a function from a module?

2008-11-06 Thread Diez B. Roggisch
Kurda Yon wrote: Hi, I have the following small problem. I run Python interactively. In the beginning of the run I import many functions from many modules. Than I execute some commands and notice that one of the imported functions contains a mistake. I open another terminal in which I open

Step-by-step exec

2008-11-06 Thread gregory . lielens
Hi, I am using a small python file as an input file (defining constants, parameters, input data, ...) for a python application. The input file is simply read by an exec statement in a specific dictionary, and then the application retrieve all the data it need from the dictionary... Everything is

Re: Error loading modules

2008-11-06 Thread M.-A. Lemburg
The easiest way to debug such import problems is by telling Python to be verbose: python -vv -c import some_module The generated output will then list all the locations where Python looks for the module and is often handy to track down reasons for Python not being able to load a module. --

Re: Extract frame from wmv

2008-11-06 Thread Martin
Tim Golden wrote: Martin wrote: Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Tim Golden wrote: Alternatively, you might be able to commandline control mencoder or ffmpeg itself to do this. Not sure, but there must be *something* among those millions of command-line options!

email for gpg encrypted?

2008-11-06 Thread Neal Becker
I know we have 'email' module. Is there something I could use to produce properly mime-encoded gpg encrypted messages? -- http://mail.python.org/mailman/listinfo/python-list

bind to HTMLayout or ubrowser

2008-11-06 Thread oyster
http://www.terrainformatica.com/htmlayout/ uses its own lightweight HTML rendering engine, helps you to create applications with the Web style user interface http://ubrowser.com/ is a library that makes it a little easier to embed the Mozilla Gecko rendering engine into your application is there

Re: Step-by-step exec

2008-11-06 Thread [EMAIL PROTECTED]
On Nov 6, 4:27 pm, [EMAIL PROTECTED] wrote: Hi, I am using a small python file as an input file (defining constants, parameters, input data, ...) for a python application. The input file is simply read by an exec statement in a specific dictionary, and then the application retrieve all the

Re: Extract frame from wmv

2008-11-06 Thread Tim Golden
Martin wrote: Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Tim Golden wrote: Alternatively, you might be able to commandline control mencoder or ffmpeg itself to do this. Not sure, but there must be *something* among those millions of command-line options! FFmpeg--yes!

Re: bind to HTMLayout or ubrowser

2008-11-06 Thread Diez B. Roggisch
oyster wrote: http://www.terrainformatica.com/htmlayout/ uses its own lightweight HTML rendering engine, helps you to create applications with the Web style user interface http://ubrowser.com/ is a library that makes it a little easier to embed the Mozilla Gecko rendering engine into your

Re: Step-by-step exec

2008-11-06 Thread gregory . lielens
On Nov 6, 1:02 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Nov 6, 4:27 pm, [EMAIL PROTECTED] wrote: Hi, I am using a small python file as an input file (defining constants, parameters, input data, ...) for a python application. The input file is simply read by an exec statement

Re: Ordering python sets

2008-11-06 Thread Mr . SpOOn
On Wed, Nov 5, 2008 at 10:03 PM, Arnaud Delobelle [EMAIL PROTECTED] wrote: Only hashable objects can go in a set. By default a class you define is not hashable (unless it descends from a hashable class). To remedy this you can define a __hash__ method in your class. IIRC the only

Re: 2.6, 3.0, and truly independent intepreters

2008-11-06 Thread sturlamolden
On Nov 4, 6:51 pm, Paul Boddie [EMAIL PROTECTED] wrote: The language features look a lot like what others have already been offering for a while: keywords for parallelised constructs (clik_for) which are employed by solutions for various languages (C# and various C ++ libraries spring

Re: Snippets management

2008-11-06 Thread Robert Lehmann
On Thu, 06 Nov 2008 05:23:25 -0600, Edwin wrote: [snip] As I'm learning Python sometimes I look for different approaches to the same problem so I use Git branches in order to save every try. It's just that I'm looking for a 'global' place in my system where I can save code ideas and useful

Re: contextlib.nested()

2008-11-06 Thread brasse
On Nov 6, 11:43 am, Robert Lehmann [EMAIL PROTECTED] wrote: On Thu, 06 Nov 2008 01:02:34 -0800, brasse wrote: Hello! I have been running in to some problems when using contextlib.nested(). My problem arises when using code similar to this: from __future__ import with_statement from

Re: subprocess and PPID

2008-11-06 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Michele Petrazzo wrote: Lawrence D'Oliveiro wrote: See the prctl(2) man page. Just seen. It can be, bust since I cannot modify the child process and this syscall must be called from the child, I cannot use it. You do the fork and then the exec, right? So do

Error importing wxPython

2008-11-06 Thread ron . reidy
Hi, I just installed wxPython from http://wxpython.org/download.php. When I import (import wx), I get this error: ImportError: DLL load failed: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail. Has

spam

2008-11-06 Thread skip
I'm pretty sure all of the spam is automated, so your message won't get through to anyone. D'Arcy Well, it got through to us adding to our spam problem. Right. I apologize that so much spam seems to be leaking through still. I am working on the problem. I'm pretty sure at this

Python25\Tools\checkversions.py

2008-11-06 Thread Colin J. Williams
Is _checkversion.py used at all currently? Colin W. -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.6, 3.0, and truly independent intepreters

2008-11-06 Thread sturlamolden
On Nov 5, 8:44 pm, Andy O'Meara [EMAIL PROTECTED] wrote: In a few earlier posts, I went into details what's meant there:

Re: subprocess and PPID

2008-11-06 Thread [EMAIL PROTECTED]
On Nov 6, 3:09 pm, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Michele Petrazzo wrote: Lawrence D'Oliveiro wrote: See the prctl(2) man page. Just seen. It can be, bust since I cannot modify the child process and this syscall must

Re: contextlib.nested()

2008-11-06 Thread Diez B. Roggisch
brasse wrote: Hello! I have been running in to some problems when using contextlib.nested(). My problem arises when using code similar to this: from __future__ import with_statement from contextlib import nested class Foo(object): def __init__(self, tag, fail=False):

SocketServer shutdown deadlock

2008-11-06 Thread Okko Willeboordse
All, With Python 2.5 SocketServer features the shutdown method that can be called from another thread to stop the serve_forever loop. However; When the shutdown method is called before serve_forever, shutdown will never return. This can happen when a server is stopped during startup. In other

Re: Trying to set a date field in a access databse

2008-11-06 Thread M.-A. Lemburg
On 2008-11-05 21:12, [EMAIL PROTECTED] wrote: Hi, I cannot get the following code to work import win32com.client import time engine = win32com.client.Dispatch(DAO.DBEngine.36) db=engine.OpenDatabase(rtestdate2.mdb) access = db.OpenRecordset(select * from test) access.AddNew()

I need a simple windows form handle.

2008-11-06 Thread 一首诗
Hi all, Today I was writing a simple test app for a video decoder library. I use python to parse video files and input data to the library. I got a problem here, I need a windows form, and send the form handle to the library as a parameter, then it can output video on the form. Here is my

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread I D
Hello James, Thanks for your response. But I cannot use a third party software, I need to use the exisiting API's within python. As I am new to python, I suspected that I should go by a simpler approach and so scrapped off the below code and wrote a very simple UDP server code as follows:

CGI Python problem

2008-11-06 Thread [EMAIL PROTECTED]
Hi all, I'm trying to get python to work with cgi for a small intranet site, however even a simply hello world test isn't working. Here is the test file: #!/usr/bin/python # -*- coding: UTF-8 -*- # enable debugging import cgitb; cgitb.enable() print Content-Type: text/plain;charset=utf-8 print

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread James Mills
On Fri, Nov 7, 2008 at 12:57 AM, I D [EMAIL PROTECTED] wrote: Thanks for your response. But I cannot use a third party software, I need to use the exisiting API's within python. Why ? Even this seems to lose packets, I would really appreciate if any pointers can be provided to improve my

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread I D
On Thu, Nov 6, 2008 at 10:27 AM, James Mills [EMAIL PROTECTED]wrote: On Fri, Nov 7, 2008 at 12:57 AM, I D [EMAIL PROTECTED] wrote: Thanks for your response. But I cannot use a third party software, I need to use the exisiting API's within python. Why ? @Sam@ That is the requirement of

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread Ben Sizer
On Nov 6, 12:46 am, James Mills [EMAIL PROTECTED] wrote: Try these instead:  * UDPServer -http://trac.softcircuit.com.au/circuits/browser/examples/udpserver.py  * UDPClient   -http://trac.softcircuit.com.au/circuits/browser/examples/udpclient.py Since there's no contact details on the

More __init__ methods

2008-11-06 Thread Mr . SpOOn
Hi, I know there can be only one __init__ method (at least, I think). Often I need an object to be created in different ways, for example passing a string as argument, or an integer, or another object. To achieve this I put the default value of the arguments to None and then I some if...elif

Re: More __init__ methods

2008-11-06 Thread Tim Golden
Mr.SpOOn wrote: Hi, I know there can be only one __init__ method (at least, I think). Often I need an object to be created in different ways, for example passing a string as argument, or an integer, or another object. To achieve this I put the default value of the arguments to None and then I

Re: Error importing wxPython

2008-11-06 Thread Mike Driscoll
On Nov 6, 8:09 am, [EMAIL PROTECTED] wrote: Hi, I just installed wxPython fromhttp://wxpython.org/download.php.  When I import (import wx), I get this error: ImportError: DLL load failed: The application has failed to start because its side-by-side configuration is incorrect. Please see the

Re: More __init__ methods

2008-11-06 Thread Marc 'BlackJack' Rintsch
On Thu, 06 Nov 2008 16:49:08 +0100, Mr.SpOOn wrote: I know there can be only one __init__ method (at least, I think). Often I need an object to be created in different ways, for example passing a string as argument, or an integer, or another object. To achieve this I put the default value

Re: Error importing wxPython

2008-11-06 Thread Chris Mellon
On Thu, Nov 6, 2008 at 8:09 AM, [EMAIL PROTECTED] wrote: Hi, I just installed wxPython from http://wxpython.org/download.php. When I import (import wx), I get this error: ImportError: DLL load failed: The application has failed to start because its side-by-side configuration is incorrect.

Re: CGI Python problem

2008-11-06 Thread Tim Chase
I've placed this file in both public_html and as a test in public_html/ cgi-bin directories in my local user account (I dont have root access - its a corparate network). The file definitely has read and execute permission (744) as have the assoicated directories. My guess would be the

Re: Python 2.3.7 Does not compile on Ubuntu 8.10 i386

2008-11-06 Thread zenzike
I came across this today, and found a similar bug in launchpad [1]. The following commands worked for me (including cleaning up beforehand): cd Python-2.3.7 make distclean ./configure BASECFLAGS=-U_FORTIFY_SOURCE make I hope that helps. zenzike [1]

Re: Python 2.6, GUI not working on vista?

2008-11-06 Thread alphadog
On Oct 5, 4:13 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Michel Claveau - NoSpam SVP ; merci wrote: Another way is to de-activate UAC. Please don't be stupid! How about a compromise: Disable UAC. Install Python for all. Re-

Re: CGI Python problem

2008-11-06 Thread Tim O'Toole
Thanks for replying Tim, Here is the permissions, which I think are definitely right now: drwxrwxrwx 8 4.0K Nov 6 13:34 public_html/ drwxrwxrwx 2 4.0K Nov 6 13:35 cgi-bin/ [inside public_html] -rw-r-xr-x 1 117 Nov 6 11:39 test_pl.cgi* [inside cgi-bin]

Re: Printing with interspersed element

2008-11-06 Thread Kirk Strauser
At 2008-10-30T21:10:09Z, Paulo J. Matos [EMAIL PROTECTED] writes: Thanks for the tip but that has an issue when dealing with potentially millions of objects. You are creating a string in memory to then dump to a file [or screen] while you could dump to the file [or screen] as you go through

Re: contextlib.nested()

2008-11-06 Thread Diez B. Roggisch
Diez, Robert, OK. The practice of going live or doing non-trivial initialization in __enter__ is new to me. I'm new to Python with a C++ background, so that shouldn't be a surprise. :-) Ideally I would like to put all initialization in __init__ since then I would be able to use my object

Problem with shelve

2008-11-06 Thread bluesmanu
Hi all, I am trying to use the shelve module to save an object of a 'Electron' class I made into a file. The writing goes well but the reading goes : e=f['0'] Traceback (most recent call last): File stdin, line 1, in module File shelve.py, line 113, in __getitem__ value =

Re: Finding the instance reference of an object

2008-11-06 Thread Joe Strout
On Nov 5, 2008, at 12:29 AM, Dennis Lee Bieber wrote: C++: void foo(PersonPtr who) { who-zipcode = 12345; } Please show us the type definition of PersonPtr Sorry, that'd be obvious to anyone experienced in C++, but I shouldn't assume. It would be: typedef Person*

Re: Finding the instance reference of an object

2008-11-06 Thread Joe Strout
On Nov 4, 2008, at 12:57 PM, Hendrik van Rooyen wrote: 4. You now see how a mutating an object within a function tells you NOTHING about how the reference to that object was passed. 5. You see that the first three languages above are passing a reference by value and using that to mutate and

Weird behavior with lexical scope

2008-11-06 Thread mrstevegross
I ran into a weird behavior with lexical scope in Python. I'm hoping someone on this forum can explain it to me. Here's the situation: I have an Outer class. In the Outer class, I define a nested class 'Inner' with a simple constructor. Outer's constructor creates an instance of Inner. The code

Re: Python 2.6, GUI not working on vista?

2008-11-06 Thread Steve Holden
alphadog wrote: On Oct 5, 4:13 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Michel Claveau - NoSpam SVP ; merci wrote: Another way is to de-activate UAC. Please don't be stupid! How about a compromise: Disable UAC. Install Python

Re: spam

2008-11-06 Thread D'Arcy J.M. Cain
On Thu, 6 Nov 2008 07:32:26 -0600 [EMAIL PROTECTED] wrote: I'm pretty sure all of the spam is automated, so your message won't get through to anyone. D'Arcy Well, it got through to us adding to our spam problem. Right. I apologize that so much spam seems to be leaking

Re: 2.6, 3.0, and truly independent intepreters

2008-11-06 Thread Walter Overby
Hi, I've been following this discussion, and although I'm not nearly the Python expert that others on this thread are, I think I understand Andy's point of view. His premises seem to include at least: 1. His Python code does not control the creation of the threads. That is done at the app

Re: Weird behavior with lexical scope

2008-11-06 Thread Arnaud Delobelle
mrstevegross [EMAIL PROTECTED] writes: I ran into a weird behavior with lexical scope in Python. I'm hoping someone on this forum can explain it to me. Here's the situation: I have an Outer class. In the Outer class, I define a nested class 'Inner' with a simple constructor. Outer's

Re: Weird behavior with lexical scope

2008-11-06 Thread mrstevegross
def __init__(self, Inner=Inner): Ok, the Inner=Inner trick works. What the heck does that do, anyway? I've never seen that formulation. --Steve -- http://mail.python.org/mailman/listinfo/python-list

python bug when subclassing list?

2008-11-06 Thread Hamish McKenzie
I want to write a Vector class and it makes the most sense to just subclass list. I also want to be able to instantiate a vector using either: Vector( 1, 2, 3 ) OR Vector( [1, 2, 3] ) so I have this: class Vector(list): def __new__( cls, *a ): try:

Looking for a nitty-gritty Python Ajax middleware script to fire off a number of processors

2008-11-06 Thread David Shi
Dear All,   I am looking for a nitty-gritty Python Ajax script to fire off a number of processing programmes, periodically checking their operations, sending messages back to an HTML div form by sending back the links of generated data files, to be downloaded by end users.   I am using .NET IIS

Spring Python 0.8.0 has been released/Spring Python goes green

2008-11-06 Thread Goldfish
Spring Python, the python version of the Spring Framework, has just released version 0.8.0. This release contains a refactored IoC container supporting four formats (XMLConfig, PythonConfig/@Object, PyContainerConfig, and SpringJavaConfig); replacement of the term component with object in all

.pyc keeps running and never stops

2008-11-06 Thread David Shi
Dear All,   I am using Python 2.5 and used py_compile to produce a .pyc file.  The script runs well.  However, the .pyc keeps running and never stops.   Advices will be deeply appreciated.   Regards.   David -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with shelve

2008-11-06 Thread Paul Rudin
[EMAIL PROTECTED] writes: Hi all, I am trying to use the shelve module to save an object of a 'Electron' class I made into a file. The writing goes well but the reading goes : e=f['0'] Traceback (most recent call last): File stdin, line 1, in module File shelve.py, line 113, in

Re: Weird behavior with lexical scope

2008-11-06 Thread skip
def __init__(self, Inner=Inner): Steve Ok, the Inner=Inner trick works. What the heck does that do, anyway? Steve I've never seen that formulation. Understanding that will put you on the path to scoping enlightenment. Consider when that default assignment is established and how that

Re: Spring Python 0.8.0 has been released/Spring Python goes green

2008-11-06 Thread Goldfish
The Links section has some faults in it. Here is a corrected copy: Links: For more information, please visit the website at http://springpython.webfactional.com Framework download at

Re: More __init__ methods

2008-11-06 Thread Mr . SpOOn
On Thu, Nov 6, 2008 at 4:59 PM, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: class A(object): def __init__(self, a, b, c): self.a = a # ... @classmethod def from_string(cls, s): # ... return cls(a, b, c) Thanks. I think it's time to study

Re: Red Hat 32 bit RPM for python 2.4+

2008-11-06 Thread Michael Torrie
Pravin Sinha wrote: Hi Michael , Actually my requirement is to use 32 bit version of pyOpenSSL on 64 bit linux machine, Python 64 bit is not able to load 32 bit pyOpenSSL, so I wanted to install 32 bit python on 64 bit Linux. Again building that locally is not straight forward as I guess

Re: Snippets management

2008-11-06 Thread Stef Mientki
Edwin wrote: Hi there, I've been looking for a snippet manager and found PySnippet but it requires PyGTK. Do you know any other option that doesn't need much? I'm sort of new to python and user interfaces seem a bit far for me right now, that's why I thought having to install PyGTK was

Re: More __init__ methods

2008-11-06 Thread Tim Golden
Mr.SpOOn wrote: On Thu, Nov 6, 2008 at 4:59 PM, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: class A(object): def __init__(self, a, b, c): self.a = a # ... @classmethod def from_string(cls, s): # ... return cls(a, b, c) Thanks. I think it's time to

Re: CGI Python problem

2008-11-06 Thread Tim Chase
Here is the permissions, which I think are definitely right now: drwxrwxrwx 8 4.0K Nov 6 13:34 public_html/ drwxrwxrwx 2 4.0K Nov 6 13:35 cgi-bin/ [inside public_html] -rw-r-xr-x 1 117 Nov 6 11:39 test_pl.cgi* [inside cgi-bin] -rw-r-xr-x 1 168

Re: SocketServer shutdown deadlock

2008-11-06 Thread Okko Willeboordse
If I wait until _BaseServer__serving is True before calling shutdown things go better. Okko Willeboordse wrote: All, With Python 2.5 SocketServer features the shutdown method that can be called from another thread to stop the serve_forever loop. However; When the shutdown method is

Re: More __init__ methods

2008-11-06 Thread Mr . SpOOn
On Thu, Nov 6, 2008 at 7:44 PM, Tim Golden [EMAIL PROTECTED] wrote: While that's no bad thing, you don't really need to do that simply to understand these examples: they're just saying do whatever you need to to make these method class methods, not instance methods. Yes. I think this changes

Re: Weird behavior with lexical scope

2008-11-06 Thread Kirk Strauser
At 2008-11-06T16:57:39Z, mrstevegross [EMAIL PROTECTED] writes: class Outer: class Inner: def __init__(self): pass def __init__ (self): a = Inner() Outer() Try instead: class Outer: def __init__(self): a = self.Inner() -- Kirk Strauser The Day Companies

Re: 2.6, 3.0, and truly independent intepreters

2008-11-06 Thread sturlamolden
On Nov 6, 6:05 pm, Walter Overby [EMAIL PROTECTED] wrote: I don't understand how this would help. If these large data structures reside only in one remote process, then the overhead of proxying the data into another process for manipulation requires too much IPC, or at least so Andy

Re: Error importing wxPython

2008-11-06 Thread Ron Reidy
Thank you Chris. That worked perfectly. On Thu, Nov 6, 2008 at 9:05 AM, Chris Mellon [EMAIL PROTECTED] wrote: On Thu, Nov 6, 2008 at 8:09 AM, [EMAIL PROTECTED] wrote: Hi, I just installed wxPython from http://wxpython.org/download.php. When I import (import wx), I get this error:

Re: Weird behavior with lexical scope

2008-11-06 Thread [EMAIL PROTECTED]
On Nov 6, 9:57 pm, mrstevegross [EMAIL PROTECTED] wrote: I ran into a weird behavior with lexical scope in Python. I'm hoping someone on this forum can explain it to me. Here's the situation: I have an Outer class. In the Outer class, I define a nested class 'Inner' with a simple constructor.

python bug when subclassing list?

2008-11-06 Thread Hamish McKenzie
I want to write a Vector class and it makes the most sense to just subclass list. I also want to be able to instantiate a vector using either: Vector( 1, 2, 3 ) OR Vector( [1, 2, 3] ) so I have this: class Vector(list): def __new__( cls, *a ): try: print a

Re: Finding the instance reference of an object

2008-11-06 Thread Arnaud Delobelle
I know this thread has grown quite personal for some of its participants. I am posting in a spirit of peace and understanding :) Joe Strout [EMAIL PROTECTED] writes: [...] Um, no, I've admitted that it's a reference all along. Indeed, that's pretty much the whole point: that variables in

List to Text back to List

2008-11-06 Thread SimonPalmer
Hi, I am looking for a way to convert a List of floating point numbers to and from text. I am embedding it in an XML document and am looking for a neat way to serialise and de-serialise a list from a text node. I can easily write something to do it manually but I wondered whether List had native

Re: python bug when subclassing list?

2008-11-06 Thread Arnaud Delobelle
Hamish McKenzie [EMAIL PROTECTED] writes: I want to write a Vector class and it makes the most sense to just subclass list. I also want to be able to instantiate a vector using either: Vector( 1, 2, 3 ) OR Vector( [1, 2, 3] ) so I have this: class Vector(list): def __new__(

Re: List to Text back to List

2008-11-06 Thread Chris Rebert
On Thu, Nov 6, 2008 at 12:04 PM, SimonPalmer [EMAIL PROTECTED] wrote: Hi, I am looking for a way to convert a List of floating point numbers to and from text. I am embedding it in an XML document and am looking for a neat way to serialise and de-serialise a list from a text node. I can easily

Re: List to Text back to List

2008-11-06 Thread SimonPalmer
On Nov 6, 8:11 pm, Chris Rebert [EMAIL PROTECTED] wrote: On Thu, Nov 6, 2008 at 12:04 PM, SimonPalmer [EMAIL PROTECTED] wrote: Hi, I am looking for a way to convert a List of floating point numbers to and from text.  I am embedding it in an XML document and am looking for a neat way to

Re: List to Text back to List

2008-11-06 Thread Chris Rebert
On Thu, Nov 6, 2008 at 12:18 PM, SimonPalmer [EMAIL PROTECTED] wrote: On Nov 6, 8:11 pm, Chris Rebert [EMAIL PROTECTED] wrote: On Thu, Nov 6, 2008 at 12:04 PM, SimonPalmer [EMAIL PROTECTED] wrote: Hi, I am looking for a way to convert a List of floating point numbers to and from text. I am

Re: List to Text back to List

2008-11-06 Thread Arnaud Delobelle
SimonPalmer [EMAIL PROTECTED] writes: I looked at pickle, but the problem is that I want my XML to be readable by languages other than python, so it sort of precludes it. JSON would be perfect, but I think the module only exists in 2.6, is that right? Unfortunately I am bound to 2.4.

Re: More __init__ methods

2008-11-06 Thread Larry Bates
Mr.SpOOn wrote: On Thu, Nov 6, 2008 at 7:44 PM, Tim Golden [EMAIL PROTECTED] wrote: While that's no bad thing, you don't really need to do that simply to understand these examples: they're just saying do whatever you need to to make these method class methods, not instance methods. Yes. I

Re: locating the chorus in a MIDI song?

2008-11-06 Thread Aaron Brady
On Nov 3, 10:20 pm, Joe Strout [EMAIL PROTECTED] wrote: We've got a need to generate short samples of songs that are in MIDI   format, to provide a preview function in a web app.  We'd like to do   something more clever than just taking the middle 20 seconds (or   whatever) of the song --

Re: More __init__ methods

2008-11-06 Thread Ben Finney
Mr.SpOOn [EMAIL PROTECTED] writes: On Thu, Nov 6, 2008 at 4:59 PM, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: class A(object): def __init__(self, a, b, c): self.a = a # ... @classmethod def from_string(cls, s): # ... return cls(a,

Re: How to re-import a function from a module?

2008-11-06 Thread Aaron Brady
On Nov 5, 7:36 pm, Kurda Yon [EMAIL PROTECTED] wrote: Hi, I have the following small problem. I run Python interactively. In the beginning of the run I import many functions from many modules. Than I execute some commands and notice that one of the imported functions contains a mistake. I

Re: More __init__ methods

2008-11-06 Thread Arnaud Delobelle
Ben Finney [EMAIL PROTECTED] writes: [...] All you need to know to understand the above is that it will have essentially the same result as: class A(object): # ... def _from_string(cls, s): # ... return cls(a, b, c) from_string =

Re: More __init__ methods

2008-11-06 Thread Ben Finney
Mr.SpOOn [EMAIL PROTECTED] writes: class foo: def __init__(self, a, b): self.a = a self.b = b @classmethod def from_string(self, ..): ... ... What I mean is: I can't use anymore __init__ as the default constructor, but I always have

Re: Step-by-step exec

2008-11-06 Thread Aaron Brady
On Nov 6, 7:11 am, [EMAIL PROTECTED] wrote: On Nov 6, 1:02 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Nov 6, 4:27 pm, [EMAIL PROTECTED] wrote: Hi, I am using a small python file as an input file (defining constants, parameters, input data, ...) for a python application.

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread Steve Holden
I D wrote: Hello James, Thanks for your response. But I cannot use a third party software, I need to use the exisiting API's within python. As I am new to python, I suspected that I should go by a simpler approach and so scrapped off the below code and wrote a very simple UDP server code as

Re: I need a simple windows form handle.

2008-11-06 Thread Aaron Brady
On Nov 6, 7:50 am, 一首诗 [EMAIL PROTECTED] wrote: Hi all, Today I was writing a simple test app for a video decoder library. I use python to parse video files and input data to the library. I got a problem here, I need a windows form, and send the form handle to the library as a parameter,

Re: List to Text back to List

2008-11-06 Thread Aaron Brady
On Nov 6, 2:18 pm, SimonPalmer [EMAIL PROTECTED] wrote: On Nov 6, 8:11 pm, Chris Rebert [EMAIL PROTECTED] wrote: On Thu, Nov 6, 2008 at 12:04 PM, SimonPalmer [EMAIL PROTECTED] wrote: Hi, I am looking for a way to convert a List of floating point numbers to and from text.  I am

  1   2   3   >