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): _co

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ó: >> >> > >> > ... >> > >> > >> > >> >> > After parsed by fe

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): > type(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 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 (object): > >

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 of

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

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 /usr/local/lib/p

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 [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 __i

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 whe

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. -- http://mai

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

2007-04-11 Thread goodwolf
On Apr 11, 10:15 am, Bruno Desthuilliers wrote: > goodwolf a écrit : > > > > > On Apr 11, 9:09 am, Bruno Desthuilliers > [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

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

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 on

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? >

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 actually

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 derive

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 t

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 th

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

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 o

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 u

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 https://www2.nextag.com/goto

[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 possibilit

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? -C

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 o

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) -- http://mail.python.org/mailman/listinfo/pytho

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): ./t

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

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 -- http://mail.python.org/

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

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 ? > > c

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.

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

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

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: [email protected] > Subject: Re: tuples, index method, Python's design > > (There is one other option: you care that 32 is so

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

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.

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 diagnosi

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

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 cas

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 des

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: [email protected] > > Subject: Re: tuples, index method

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 desir

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

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 thoug

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 (us

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 creat

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.

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]. Howeve

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 instan

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: [email protected] > Subject: passing class by reference does not work?? > > Here is my code: > > class A(): > val = 0 > > de

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,

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')

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

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 "f

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 this

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 ki

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: o

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 obj

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 wit

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 fee

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 wi

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

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 k

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'] > Unicod

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 = u"Ni\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+un

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 ca

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 meant

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 comma

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 > whol

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 as

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]>

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 appropria

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 = 0

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 = 0

text file vs. cPickle vs sqlite a design question

2007-04-11 Thread Dag
I have an application which works with lists of tuples of the form (id_nr,'text','more text',1 or 0). I'll have maybe 20-50 or so of these lists containing anywhere from 3 to over 3 tuples. The actions I need to do is either append a new tuple to the end of the list, display all the tuples

Re: Hellow World:)

2007-04-11 Thread Scott
The author of that book is qouted as saying: ''Note: My more recent book, Beginning Python is an expanded and revised version of this book.'' That qoute can be found at http://hetland.org/writing/practical-python/ However, from my personal experience some of the codes in beginning python have so

Re: pop() clarification

2007-04-11 Thread Jerry Hill
On 4/11/07, Scott <[EMAIL PROTECTED]> wrote: > I see says, "When removing a specific element from a list using pop() it > must be in this format: list.pop([i]). The tutorial (http://docs.python.org/tut/node7.html) says the following: pop( [i] ) Remove the item at the given position in the lis

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 = 0

Re: bittorent

2007-04-11 Thread Jonathan Smith
Linus Nordström wrote: > 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 a

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

2007-04-11 Thread KDawg44
On Apr 11, 11:58 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 11 Apr 2007 05:39:21 -0700, "KDawg44" <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > > ohhh okay. thanks so much. I knew that it came out as strings, i > > guess it makes sense that I would have to send

SOAPPY Install Issues

2007-04-11 Thread Robert Rawlins - Think Blue
Hi Guys, I've been trying hopelessly -ALL- afternoon to get python-xml and python-soappy working nicely, but for the -LIFE- of me I keep running into the same brick wall over and over. I'm running Debian and I've installed the latest stable builds of Python, Python-XML and Python-SOAPPY alo

  1   2   3   >