ANN: PyQwt-5.0.0 released

2007-04-11 Thread Gerard Vermeulen
What is PyQwt ( http://pyqwt.sourceforge.net ) ? - it is a set of Python bindings for the Qwt C++ class library which extends the Qt framework with widgets for scientific and engineering applications. It provides a widget to plot 2-dimensional data and various widgets to display and

ANN: Next NYC Python User Group meeting, Tues May 8th, 2007, 6:30 pm

2007-04-11 Thread John Clark
My apologies for the comical timing of the below announcement - I actually sent the announcement on April 4th, but it obviously didn't clear the moderator's desk in time for the meeting mentioned below. In an attempt to avoid this same problem, let me announce next month's meeting now. The next

RELEASED Python 2.5.1, release candidate 1

2007-04-11 Thread Anthony Baxter
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.5.1 (release candidate 1). This is the first bugfix release of Python 2.5. Python 2.5 is now in bugfix-only mode; no new features are being added. According to the release notes,

ANN: pywinauto 0.3.7 now released

2007-04-11 Thread Mark Mc Mahon
Hi, 0.3.7 release of pywinauto is now available. pywinauto is an open-source (LGPL) package for using Python as a GUI automation 'driver' for Windows NT based Operating Systems (NT/W2K/XP/Vista?). SourceForge project page: http://sourceforge.net/projects/pywinauto Download from SourceForge

[ANN] Business Gauges 1.1.5 - a Python-powered Business Intelligence Dashboard Solution

2007-04-11 Thread Business Gauges Notifications
We're happy to announce the release of Business Gauges 1.1.5. A trial version is available for download from: http://www.businessgauges.com/download/ Business Gauges is a Python-powered business intelligence dashboard solution that uses desktop gadgets and programmable sensors to monitor

Re: Does python have the static function member like C++

2007-04-11 Thread goodwolf
On Apr 11, 5:19 am, 7stud [EMAIL PROTECTED] wrote: On Apr 10, 9:08 pm, 人言落日是天涯,望极天涯不见家 [EMAIL PROTECTED] wrote: I define the class like this: class AAA: counter = 0 def __init__(self): pass def counter_increase(): AAA.counter += 1 print couter

Re: __file__

2007-04-11 Thread Gabriel Genellina
En Tue, 10 Apr 2007 21:20:51 -0300, 7stud [EMAIL PROTECTED] escribió: I'm having trouble understanding what the definition of __file__ is. With this program: -- #data.py: def show(): print __file__ if __name__ == __main__: show() --- if I run data.py with the

Re: Does python have the static function member like C++

2007-04-11 Thread Bruno Desthuilliers
人言落日是天涯,望极天涯不见家 a écrit : I define the class like this: class AAA: counter = 0 def __init__(self): pass def counter_increase(): AAA.counter += 1 print couter now :, AAA.counter You probably want something like this: class AAA(object): _counter = 0

Re: Universal Feed Parser issue

2007-04-11 Thread Gabriel Genellina
En Wed, 11 Apr 2007 01:51:13 -0300, i3dmaster [EMAIL PROTECTED] escribió: On Apr 10, 6:45 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Tue, 10 Apr 2007 14:58:42 -0300, i3dmaster [EMAIL PROTECTED] escribió: ?xml version='1.0' encoding='utf-8'? feed

Re: Does python have the static function member like C++

2007-04-11 Thread Bruno Desthuilliers
goodwolf a écrit : (snip) 1. In this case you will prefer a classmethod instead a staticmethod. 2. If counter is the number of instances of class AAA then you will incrase counter inside __init__ method. class AAA (object): counter = 0 def __init__(self):

Re: tuples, index method, Python's design

2007-04-11 Thread Hendrik van Rooyen
Carsten Haese [EMAIL PROTECTED] wrote: I'm just a user with no influence on the development of Python itself, but in my humble opinion, the non-existence of tuple.index is more pythonic than its existence would be. I really cannot follow the logic behind this statement. I can write: L =

Re: Does python have the static function member like C++

2007-04-11 Thread goodwolf
On Apr 11, 9:09 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: goodwolf a écrit : (snip) 1. In this case you will prefer a classmethod instead a staticmethod. 2. If counter is the number of instances of class AAA then you will incrase counter inside __init__ method. class AAA

Calling Python from Javascript?

2007-04-11 Thread Kenneth McDonald
I know that there's some work out there to let Python make use of Javascript (Spidermonkey) via (I assume) some sort of bridging C/C++ code. Anyone know of efforts to allow the reverse? I'd really like to make use of Python when doing Mozilla DOM programming, and I can never get a clear idea

Re: About Trolltech QT OpenSource license.

2007-04-11 Thread Robert Kern
king kikapu wrote: As i said, i do not fully understand all this license stuff. All i want to ask is, i can make GPL software and gain money from this ? And if that so, then why they force you to buy the commercial lisence in such case ? Others have given good answers. I would only like to

No zlib in Python 2.4.4

2007-04-11 Thread shamzz
Hi, I've compiled (configure/make/make install) Python 2.4.4 from source on Suse Linux Enterprise Server 9 (x64). I need Python to be compiled with Zlib so that I can compile and use Zope. After installing Python, zlib doesn't seem to have been compiled with it, I've checked the

Re: Does python have the static function member like C++

2007-04-11 Thread Bruno Desthuilliers
goodwolf a écrit : On Apr 11, 9:09 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: goodwolf a écrit : (snip) 1. In this case you will prefer a classmethod instead a staticmethod. 2. If counter is the number of instances of class AAA then you will incrase counter inside __init__

Re: No zlib in Python 2.4.4

2007-04-11 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], shamzz wrote: Shouldn't zlib be compiled as a Python module automatically in Python 2.4.4. I'm guessing Python is doing some kind of check and not compiling zlib for some reason? It only gets compiled if the header files can be found. Is the zlib-dev or zlib-devel

Re: Calling Python from Javascript?

2007-04-11 Thread 7stud
On Apr 11, 1:50 am, Kenneth McDonald [EMAIL PROTECTED] wrote: I know that there's some work out there to let Python make use of Javascript (Spidermonkey) via (I assume) some sort of bridging C/C++ code. Anyone know of efforts to allow the reverse? I'd really like to make use of Python when

Re: No zlib in Python 2.4.4

2007-04-11 Thread Bernard Delmée
I need Python to be compiled with Zlib so that I can compile and use Zope. I am guessing you need zlib_dev.rpm (or somesuch) installed for the python build process to find the relevant headers. Sorry I cannot be more specific not being a SuSE user myself (anymore)... Bernard. --

Re: Does python have the static function member like C++

2007-04-11 Thread goodwolf
On Apr 11, 10:15 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: goodwolf a écrit : On Apr 11, 9:09 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: goodwolf a écrit : (snip) 1. In this case you will prefer a classmethod instead a staticmethod. 2. If counter is the

Re: installing pyqt4 on ubuntu 6.06

2007-04-11 Thread Paul Boddie
On 10 Apr, 20:48, Joshua J. Kugler [EMAIL PROTECTED] wrote: On Tuesday 10 April 2007 07:35, Pradnyesh Sawant wrote: Any pointers regarding what packages should i install to get the system into working condition would be very helpful It's next to impossible, due to conflicts with SIP, and

Re: No zlib in Python 2.4.4

2007-04-11 Thread shamzz
On Apr 11, 9:14 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: In [EMAIL PROTECTED], shamzz wrote: Shouldn't zlib be compiled as a Python module automatically in Python 2.4.4. I'm guessing Python is doing some kind of check and not compiling zlib for some reason? It only gets

Re: IPython 0.8.0 is out

2007-04-11 Thread Paddy
On Apr 11, 6:18 am, Fernando Perez [EMAIL PROTECTED] wrote: Hi all, The IPython team is happy to release version 0.8.0, with a lot of new enhancements, as well as many bug fixes. We hope you all enjoy it, and please report any problems as usual. WHAT is IPython? 1. An

THREADS use 100 % CPU all the time

2007-04-11 Thread matthiasjanes
Hi all, I have a application where I use different threads. actually all is working - BUT I just discovered that the [b]CPU is always 100 % [/ b]used. on the 32-bit machine athlon XP, as well as on the amd 64-bit AMD Athlon(TM) 64 X2 Dual-Core. I have to admit I'm not used to threads. I

Re: THREADS use 100 % CPU all the time

2007-04-11 Thread Thomas Krüger
[EMAIL PROTECTED] schrieb: while (True): pass Does anyone know how to run this without consuming all CPU. Your while loop is taking all the CPU time. Thomas -- sinature: http://nospam.nowire.org/signature_usenet.png -- http://mail.python.org/mailman/listinfo/python-list

Re: About Trolltech QT OpenSource license.

2007-04-11 Thread king kikapu
On Apr 11, 10:56 am, Robert Kern [EMAIL PROTECTED] wrote: Others have given good answers. I would only like to clarify what I think is the source of confusion here. While the FSF and many open source advocates make a distinction between the words commercial (meaning that someone derives money

Re: __file__

2007-04-11 Thread 7stud
Hi, Thanks for the response. On Apr 11, 12:49 am, Gabriel Genellina [EMAIL PROTECTED] wrote: __file__ corresponds to the filename used to locate and load the module, whatever it is. When the module is found on the current directory (corresponding to '' in sys.path), you get just the

UDT wrappers

2007-04-11 Thread Justin Ezequiel
Found a couple of papers that mention Python wrappers for UDT have been written but Google fails me. Do any of you know of such wrappers? Have downloaded UDT SDK but source is in C++. http://udt.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: tuples, index method, Python's design

2007-04-11 Thread Paul Boddie
On 10 Apr, 20:04, Chris Mellon [EMAIL PROTECTED] wrote: This is a rare enough use case and is easy enough to work around (convert it to a list, write a helper function) that I don't think it's worth any language change overhead at all. It isn't a language change: it's a change to the

Re: About Trolltech QT OpenSource license.

2007-04-11 Thread Paul Boddie
On 11 Apr, 11:51, king kikapu [EMAIL PROTECTED] wrote: Ok, i see...So i can use Qt OS edition and earn money from this as long as i explicitly say (is a reference to a GPL in a readme text file enough for this ?) that this software is under the GPL lisence and i have the obligation to give

New York City Python Users Group Meeting

2007-04-11 Thread John Clark
Greetings! The next New York City Python Users Group meeting is this Tuesday, April 10th, 6:30pm at at the Millennium Partners office at 666 Fifth Avenue (53rd St. and 5th Ave.) on the 8th Floor. We welcome all those in the NYC area who are interested in Python to attend. However, we need a list

Shutting down windows using win32api

2007-04-11 Thread Sily Ady
- 8:00? 8:25? 8:40? Find a flick in no time with theYahoo! Search movie showtime shortcut.-- http://mail.python.org/mailman/listinfo/python-list

Re: calling super()

2007-04-11 Thread Laszlo Nagy
John Clark wrote: Please be aware that super() has it's own set of gotchas - it's not as clean as you would hope. For more info: http://fuhm.org/super-harmful/ (I'm not the author, I was referred to this article while struggling with wxPython and super()) This was interesting! I'm using

Pass A Var To a Python Script?

2007-04-11 Thread Eric Price
Hi; How do I pass a variable to a python script? Something like this (which doesn't work): ./test.py?var=hello_world TIA, Eric _ Mortgage refinance is Hot. *Terms. Get a 5.375%* fix rate. Check savings

[OT] MSN client for console project

2007-04-11 Thread Andrés M .
Hey, there. I just wanted to tell you that Im designing an MSN client for console in Python. I know that the protocol kinda sucks, but Im afraid the chicks I meet in here just don't use Jabber. The 'never seen' thing I am planning for it, is picture support. I do not mean to have the

Re: Why does not my wx.html.HtmlWindow work?

2007-04-11 Thread Carsten Haese
On 7 Apr 2007 20:38:25 -0700, [EMAIL PROTECTED] wrote Below are my source code: [snip html.LoadPage( http://www.pythonthreads.com/articles/python/incorporating-into- wxpython-part-1.html) [snip] Have you tried loading a simpler page, something like http://www.google.com? -Carsten

Get Shift + TAB in ncurses.

2007-04-11 Thread andmarti
Anyone can help me getting the shift + tab key combination ? I tried with getch () but with no success. May be using the sys.stdin ?? Please, help would be very appreciated. -- Andrés M. - -- http://mail.python.org/mailman/listinfo/python-list

multithreading concept

2007-04-11 Thread saroj.nayak
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute

py script modify it's Modified Time?

2007-04-11 Thread est
I guess os.stat() could retrieve information about ctime, mtime of a path, but how can I change them? Is it possible to make it work both under Win32 and Linux? P.S. How to get the current running python? (Like WScript.ScriptFullName in vbscript) --

Re: Pass A Var To a Python Script?

2007-04-11 Thread rishi pathak
Hi, Use sys.argv to access the command line arguments eg: import sys print sys.argv[0] print sys.argv[1] Run the above script as /test.py hello world On 4/7/07, Eric Price [EMAIL PROTECTED] wrote: Hi; How do I pass a variable to a python script? Something like this (which doesn't work):

Re: Pass A Var To a Python Script?

2007-04-11 Thread Michael Bentley
On Apr 7, 2007, at 1:13 PM, Eric Price wrote: Hi; How do I pass a variable to a python script? Something like this (which doesn't work): ./test.py?var=hello_world The easiest thing would be to drop the '?var=': ./test.py hello_world Then in your script, use sys.argv to gather the

ANN: Next NYC Python User Group meeting, Tues May 8th, 2007, 6:30 pm

2007-04-11 Thread John Clark
My apologies for the comical timing of the below announcement - I actually sent the announcement on April 4th, but it obviously didn't clear the moderator's desk in time for the meeting mentioned below. In an attempt to avoid this same problem, let me announce next month's meeting now. The next

Re: THREADS use 100 % CPU all the time

2007-04-11 Thread A.B., Khalid
On Apr 11, 2:38 am, [EMAIL PROTECTED] wrote: Hi all, I have a application where I use different threads. actually all is working - BUT I just discovered that the [b]CPU is always 100 % [/ b]used. on the 32-bit machine athlon XP, as well as on the amd 64-bit AMD Athlon(TM) 64 X2 Dual-Core.

Re: Shutting down windows using win32api

2007-04-11 Thread Tim Golden
On a whim, given the terseness of your post, I cut-and-pasted your subject line into Google, added python for good measure, and looked at the results. I suggest you might do the same. Granted, maybe this will raise more questions, but at least it shows willing :) TJG --

Re: Why does not my wx.html.HtmlWindow work?

2007-04-11 Thread Jorgen Bodde
Hi, Coming from the wx community, I do know that the wx.HtmlWindow is NOT meant to load full blown web pages with. It has no concept of javascript, CSS, and other complex DOM properties. If you really want to display complex web pages in a window, look at wxMozilla or the wxIE binding. So the

Re: Parsing log in SQL DB to change IPs to hostnames

2007-04-11 Thread KDawg44
On Apr 11, 1:15 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On 10 Apr 2007 11:54:18 -0700, KDawg44 [EMAIL PROTECTED] declaimed the following in comp.lang.python: [- BEGIN ERROR ---] Traceback (most recent call last): File changeLogs.py, line 47, in ? cursor.execute(UPDATE

Re: tuples, index method, Python's design

2007-04-11 Thread Steven D'Aprano
On Wed, 11 Apr 2007 08:57:43 +0200, Hendrik van Rooyen wrote: I can write: L = [a,b,c,d,e,f] T= (a,b,c,d,e,f) The difference between the two things is that I can add to and change L, but not T. No, that's *one* difference between the two things. There are other differences, e.g. the

Re: __file__

2007-04-11 Thread John Machin
On Apr 11, 8:03 pm, 7stud [EMAIL PROTECTED] wrote: Hi, Thanks for the response. On Apr 11, 12:49 am, Gabriel Genellina [EMAIL PROTECTED] wrote: __file__ corresponds to the filename used to locate and load the module, whatever it is. When the module is found on the current directory

Re: THREADS use 100 % CPU all the time

2007-04-11 Thread matthiasjanes
On Apr 11, 1:36 pm, A.B., Khalid [EMAIL PROTECTED] wrote: On Apr 11, 2:38 am, [EMAIL PROTECTED] wrote: Hi all, I have a application where I use different threads. actually all is working - BUT I just discovered that the [b]CPU is always 100 % [/ b]used. on the 32-bit machine athlon

RE: tuples, index method, Python's design

2007-04-11 Thread Hamilton, William
-Original Message- From: [EMAIL PROTECTED] [mailto:python- [EMAIL PROTECTED] On Behalf Of Steven D'Aprano Sent: Wednesday, April 11, 2007 7:49 AM To: python-list@python.org Subject: Re: tuples, index method, Python's design (There is one other option: you care that 32 is somewhere

Re: tuples, index method, Python's design

2007-04-11 Thread Antoon Pardon
On 2007-04-11, Steven D'Aprano [EMAIL PROTECTED] wrote: On Wed, 11 Apr 2007 08:57:43 +0200, Hendrik van Rooyen wrote: I can write: L = [a,b,c,d,e,f] T= (a,b,c,d,e,f) The difference between the two things is that I can add to and change L, but not T. No, that's *one* difference

Re: tuples, index method, Python's design

2007-04-11 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Antoon Pardon wrote: On 2007-04-11, Steven D'Aprano [EMAIL PROTECTED] wrote: Lists are designed for sequences of homogeneous items, e.g.: L = [1, 2, 4, 8, 16, 32] while tuples are designed to be more like structs or records, with heterogeneous items, e.g.: T = (Fred,

Connection problems with irclib

2007-04-11 Thread Dropkick Punt
Hi. I've written a bot in python, using the irclib by Joel Rosdahl. Works fine from my linux box at home, but when I upload it to my shell at veritynet.net, can't seem to get it to connect to an irc server. It doesn't report any errors. Anyone have any idea how I might go about at least

Re: py script modify it's Modified Time?

2007-04-11 Thread kyosohma
On Apr 11, 6:14 am, est [EMAIL PROTECTED] wrote: I guess os.stat() could retrieve information about ctime, mtime of a path, but how can I change them? Is it possible to make it work both under Win32 and Linux? P.S. How to get the current running python? (Like WScript.ScriptFullName in

SOAP Webservices and Python

2007-04-11 Thread Robert Rawlins - Think Blue
Hello Chaps, I'm pretty new to the world of Python, but I'm slowly getting my head around things, and on today's agenda I'm looking at consuming SOAP web services. I've got an Adobe ColdFusion application which I've written that publishes the web service that I'm looking to consume, but I'm at

Re: Connection problems with irclib

2007-04-11 Thread Paul Boddie
On 11 Apr, 15:31, Dropkick Punt [EMAIL PROTECTED] wrote: Hi. I've written a bot in python, using the irclib by Joel Rosdahl. Works fine from my linux box at home, but when I upload it to my shell at veritynet.net, can't seem to get it to connect to an irc server. It may well be the case that

Re: tuples, index method, Python's design

2007-04-11 Thread Antoon Pardon
On 2007-04-11, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: In [EMAIL PROTECTED], Antoon Pardon wrote: On 2007-04-11, Steven D'Aprano [EMAIL PROTECTED] wrote: Lists are designed for sequences of homogeneous items, e.g.: L = [1, 2, 4, 8, 16, 32] while tuples are designed to be more like

Re: How to get IP address of client from CGI module?

2007-04-11 Thread Cameron Laird
In article [EMAIL PROTECTED], John Nagle [EMAIL PROTECTED] wrote: The documentation for Python's CGI module doesn't seem to say how to get the IP address of the client. Don't see an obvious way to get that info from reading the source, either. Ideas?

Python-URL! - weekly Python news and links (Apr 11)

2007-04-11 Thread Cameron Laird
QOTW: Dictionaries are one of the most useful things in Python. Make sure you know how to take adavantage of them... - Jeremy Sanders Python has consistently failed to disappoint me. - Tal Einat super() only works on new-style classes ... and has its own set of gotchas:

Re: tuples, index method, Python's design

2007-04-11 Thread Chris Mellon
On 4/11/07, Hamilton, William [EMAIL PROTECTED] wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:python- [EMAIL PROTECTED] On Behalf Of Steven D'Aprano Sent: Wednesday, April 11, 2007 7:49 AM To: python-list@python.org Subject: Re: tuples, index method, Python's

Re: tuples, index method, Python's design

2007-04-11 Thread Chris Mellon
On 4/10/07, BJörn Lindqvist [EMAIL PROTECTED] wrote: while not game_has_ended: for current_player in p: player_does_something(current_player) I'm curious why someone would even consider using a tuple in this case regardless. I think that much of the desire for tuple.index

Re: Connection problems with irclib

2007-04-11 Thread Dropkick Punt
On Wed, 11 Apr 2007 06:46:14 +, Paul Boddie wrote: On 11 Apr, 15:31, Dropkick Punt [EMAIL PROTECTED] wrote: Hi. I've written a bot in python, using the irclib by Joel Rosdahl. Works fine from my linux box at home, but when I upload it to my shell at veritynet.net, can't seem to get it to

run function in separate process

2007-04-11 Thread malkarouri
Hi everyone, I have written a function that runs functions in separate processes. I hope you can help me improving it, and I would like to submit it to the Python cookbook if its quality is good enough. I was writing a numerical program (using numpy) which uses huge amounts of memory, the memory

passing class by reference does not work??

2007-04-11 Thread wswilson
Here is my code: class A(): val = 0 def b(item, a): a.val = a.val + 1 return item + a.val def c(): d = [1, 2, 3] print [b(item, A()) for item in d] c() I expected this to output [2, 4, 6]. However, it outputs [2, 3, 4] which is not what I wanted. I

A general question

2007-04-11 Thread amit soni
Hi, I am using Matlab, Python and Java for sometime. Matlab looks to be very easy and having specified methods for almost each and everything. Java on the other hand has a good object oriented structure and is very fast. What are the advantages of Python over these two or any other language in

Re: run function in separate process

2007-04-11 Thread kyosohma
On Apr 11, 9:23 am, [EMAIL PROTECTED] wrote: Hi everyone, I have written a function that runs functions in separate processes. I hope you can help me improving it, and I would like to submit it to the Python cookbook if its quality is good enough. I was writing a numerical program (using

Re: passing class by reference does not work??

2007-04-11 Thread antred
def b(item, a): a.val = a.val + 1 return item + a.val This is where the problem lies, specifically the line a.val = a.val + 1 What happens here is that the 1st a.val refers to a member of the class instance a, called val ... which does not yet exist and is therefore created

Writing XML Logs

2007-04-11 Thread Robert Rawlins - Think Blue
Hello Chaps, I'm trying to write an application that will log to an XML file, that'll be later parsed by another application. The proposed log file will look something like this, listing different event elements and then a record for each time that event occurs. ?xml version=1.0

Re: passing class by reference does not work??

2007-04-11 Thread Alex Martelli
wswilson [EMAIL PROTECTED] wrote: Here is my code: class A(): val = 0 def b(item, a): a.val = a.val + 1 return item + a.val def c(): d = [1, 2, 3] print [b(item, A()) for item in d] c() I expected this to output [2, 4, 6]. However, it outputs [2,

Re: passing class by reference does not work??

2007-04-11 Thread wswilson
On Apr 11, 10:36 am, antred [EMAIL PROTECTED] wrote: def b(item, a): a.val = a.val + 1 return item + a.val This is where the problem lies, specifically the line a.val = a.val + 1 What happens here is that the 1st a.val refers to a member of the class instance a, called

RE: passing class by reference does not work??

2007-04-11 Thread Hamilton, William
-Original Message- From: [EMAIL PROTECTED] [mailto:python- [EMAIL PROTECTED] On Behalf Of wswilson Sent: Wednesday, April 11, 2007 9:24 AM To: python-list@python.org Subject: passing class by reference does not work?? Here is my code: class A(): val = 0 def b(item,

Re: passing class by reference does not work??

2007-04-11 Thread wswilson
On Apr 11, 10:40 am, [EMAIL PROTECTED] (Alex Martelli) wrote: wswilson [EMAIL PROTECTED] wrote: Here is my code: class A(): val = 0 def b(item, a): a.val = a.val + 1 return item + a.val def c(): d = [1, 2, 3] print [b(item, A()) for item in d]

Re: tuples, index method, Python's design

2007-04-11 Thread Steven D'Aprano
On Wed, 11 Apr 2007 13:13:20 +, Antoon Pardon wrote: Lists are designed for sequences of homogeneous items, e.g.: L = [1, 2, 4, 8, 16, 32] while tuples are designed to be more like structs or records, with heterogeneous items, e.g.: T = (Fred, 32, 12.789, {}, None, '\t') I think you

Re: run function in separate process

2007-04-11 Thread Alex Martelli
[EMAIL PROTECTED] wrote: ... somebody points me to a web page/reference that says how to call a function then reclaim the whole memory back in python. Meanwhile, the best that I could do is fork a process, compute the results, and return them back to the parent process. This I That's my

Seeking list of Python applications on OS X

2007-04-11 Thread Kevin Walzer
Hello, I am seeking to update this wiki page, which lists Mac OS X applications using Python in a significant way: http://wiki.python.org/moin/MacPython/MacSoftwareUsingPython This query is directed at developers of cross-platform Python applications who provide full support for the Mac. By

is asynchat broken or just not intended to work like other dispatchers? [PATCH]

2007-04-11 Thread Martin Maney
Simple asyncore application where I wanted to use an explicit map (1) rather than the automagic default. Worked fine until I tried to use asynchat to handle an interactive status and control connection (3) and found it had no notion about using a non-default map. After convincing myself that

Re: No zlib in Python 2.4.4

2007-04-11 Thread David E. Konerding DSD staff
On 2007-04-11, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Apr 11, 9:14 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: In [EMAIL PROTECTED], shamzz wrote: Shouldn't zlib be compiled as a Python module automatically in Python 2.4.4. I'm guessing Python is doing some kind of check

UnicodeEncodeError - a bit out of my element...

2007-04-11 Thread erikcw
Hi all, I'm trying to parse an email message, but am running into this exception. Traceback (most recent call last): File wa.py, line 336, in ? main() File wa.py, line 332, in main print out['msg'] UnicodeEncodeError: 'ascii' codec can't encode character u'\xd6' in position 238:

descriptor object for an attribute?

2007-04-11 Thread Eric Mahurin
Is there a standard way to get a descriptor object for an arbitrary object attribute - independent of whether it uses the descriptor/ property protocol or not. I want some kind of handle/reference/ pointer to an attribute. I know I could make my own class to do this (using the __dict__ of the

Re: run function in separate process

2007-04-11 Thread malkarouri
Thanks Mike for you answer. I will use the occasion to add some comments on the links and on my approach. I am programming in Python 2.5, mainly to avoid the bug that memory arenas were never freed before. The program is working on both Mac OS X (intel) and Linux, so I prefer portable approaches.

Re: descriptor object for an attribute?

2007-04-11 Thread Larry Bates
Eric Mahurin wrote: Is there a standard way to get a descriptor object for an arbitrary object attribute - independent of whether it uses the descriptor/ property protocol or not. I want some kind of handle/reference/ pointer to an attribute. I know I could make my own class to do this

SQLObject 0.7.5

2007-04-11 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.7.5 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started

Re: run function in separate process

2007-04-11 Thread malkarouri
On Apr 11, 3:58 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: [...] That's my favorite way to ensure that all resources get reclaimed: let the operating system do the job. Thanks a lot, Alex, for confirming the basic idea. I will be playing with your function later today, and will give more

Re: tuples, index method, Python's design

2007-04-11 Thread Paul Boddie
On 11 Apr, 16:14, Chris Mellon [EMAIL PROTECTED] wrote: If you want a language that just adds whatever methods anyone thinks of, along with whatever aliases for it any can think of, to every data type, you know where to find Ruby. Nobody is asking for Ruby, as far as I can see. I even

SQLObject 0.8.2

2007-04-11 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.8.2 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started

Re: troubles building python 2.5 on Windows XP x64 Windows Server 2003 sp1 Platform SDK

2007-04-11 Thread bhochstetler
On Apr 4, 5:04 pm, Martin v. Löwis [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] schrieb: I am needing to buildpython2.5 on Windows XP x64 Windows Server 2003 sp1PlatformSDKand am not finding anything documented on the process to use. Has anyone had any success with this? I did - I built

Re: tuples, index method, Python's design

2007-04-11 Thread Chris Mellon
On 11 Apr 2007 08:37:39 -0700, Paul Boddie [EMAIL PROTECTED] wrote: On 11 Apr, 16:14, Chris Mellon [EMAIL PROTECTED] wrote: If you want a language that just adds whatever methods anyone thinks of, along with whatever aliases for it any can think of, to every data type, you know where to

Re: UnicodeEncodeError - a bit out of my element...

2007-04-11 Thread kyosohma
On Apr 11, 10:16 am, erikcw [EMAIL PROTECTED] wrote: Hi all, I'm trying to parse an email message, but am running into this exception. Traceback (most recent call last): File wa.py, line 336, in ? main() File wa.py, line 332, in main print out['msg'] UnicodeEncodeError:

Re: UnicodeEncodeError - a bit out of my element...

2007-04-11 Thread liupeng
I cut from Sam Python Phrasebook Converting Unicode to Local Strings import string locStr = El uniStr = uNi\u00F1o print uniStr.encode('utf-8') print uniStr.encode('utf-16') print uniStr.encode('iso-8859-1') #Combine local and unicode results #in new unicode string newStr = locStr+uniStr

Re: Seeking list of Python applications on OS X

2007-04-11 Thread Frank Niessink
Hi Kevin, 2007/4/11, Kevin Walzer [EMAIL PROTECTED]: Hello, I am seeking to update this wiki page, which lists Mac OS X applications using Python in a significant way: Task Coach is developed with python and wxPython and is distributed as dmg. See http://www.taskcoach.org Cheers, Frank --

bittorent

2007-04-11 Thread Linus Nordström
Hello Im planing playing a bit whit bittorrent, but I'm having some trouble about where to start. So if anyone could point me in the right direction it would be much appreciated. The best would be if there are some already written modules that handle downloading and seeding torrents, but if that

SQLObject 0.9.0b1

2007-04-11 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.9.0b1 release of SQLObject, the first beta of the upcoming 0.9 release. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is

Shebang or Hashbang for modules or not?

2007-04-11 Thread Chris Lasher
Should a Python module not intended to be executed have shebang/ hashbang (e.g., #!/usr/bin/env python) or not? I'm used to having a shebang in every .py file but I recently heard someone argue that shebangs were only appropriate for Python code intended to be executable (i.e., run from the

Re: Parsing log in SQL DB to change IPs to hostnames

2007-04-11 Thread Steve Holden
KDawg44 wrote: [ ... ] ohhh okay. thanks so much. I knew that it came out as strings, i guess it makes sense that I would have to send it back IN as a string. Changed that and now it works! THanks so much. I just specified once specific field so that it would not change the whole db

pop() clarification

2007-04-11 Thread Scott
As said before I'm new to programming, and I need in depth explaination to understand everything the way I want to know it, call it a personality quirk ;p. With pop() you remove the last element of a list and return its value: Now I know list is a bad name, but for the sake of arguement lets

Re: bittorent

2007-04-11 Thread Terry Reedy
Linus Nordström [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Hello | Im planing playing a bit whit bittorrent, but I'm having some trouble | about where to start. So if anyone could point me in the right | direction it would be much appreciated. | The best would be if there are

Re: Universal Feed Parser issue

2007-04-11 Thread i3dmaster
On Apr 11, 12:06 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 11 Apr 2007 01:51:13 -0300, i3dmaster [EMAIL PROTECTED] escribió: On Apr 10, 6:45 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Tue, 10 Apr 2007 14:58:42 -0300, i3dmaster [EMAIL PROTECTED] escribió: ?xml

Re: Shebang or Hashbang for modules or not?

2007-04-11 Thread Paddy
On Apr 11, 5:29 pm, Chris Lasher [EMAIL PROTECTED] wrote: Should a Python module not intended to be executed have shebang/ hashbang (e.g., #!/usr/bin/env python) or not? I'm used to having a shebang in every .py file but I recently heard someone argue that shebangs were only appropriate for

Creating Unique Dictionary Variables from List

2007-04-11 Thread Greg Corradini
Hello All, I'm attempting to create multiple dictionaries at once, each with unique variable names. The number of dictionaries i need to create depends on the length of a list, which was returned from a previous function. The pseudo code for this problem would be: returnedlist = [x,y,z] count =

Creating Unique Dictionary Variables from List

2007-04-11 Thread Greg Corradini
Hello All, I'm attempting to create multiple dictionaries at once, each with unique variable names. The number of dictionaries i need to create depends on the length of a list, which was returned from a previous function. The pseudo code for this problem would be: returnedlist = [x,y,z] count =

  1   2   3   >