Re: Optimize function similiar to dict.update() but adds common values

2005-12-14 Thread Peter Otten
Gregory Piñero wrote: > def add_freqs(freq1,freq2): > """Add two word freq dicts""" > newfreq={} > for key,value in freq1.items(): > newfreq[key]=value+freq2.get(key,0) > for key,value in freq2.items(): > newfreq[key]=value+freq1.get(key,0) > return newfreq > A

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Rudy Schockaert
Activestate just bundles teh standard python with the pywin32 module of Mark Hammond and provides the documentation in a handy one-file CHM format.Besides that there is  no difference as far as I know. On 12/14/05, S.Chang <[EMAIL PROTECTED]> wrote: Hi,Anyone knows the difference(s) between the Pyt

Re: allow_none=True in SimpleXMLRPCServer

2005-12-14 Thread Dody Suria Wijaya
Hi, I faced the same same situation, and my quick problem solving was copying SimpleXMLRPCServer.py to current directory, and "patch" this line: response = xmlrpclib.dumps(response, methodresponse=1) into response = xmlrpclib.dumps(response, methodresponse=1, allow_none=True) Another better a

Re: Still Loving Python

2005-12-14 Thread Daniel Crespo
> So wxPython doesn't need a runtime? I don't think so. wxPython for me > sucks under Linux (built on gtk2) and I don't like its API at all. It > seems a bit awkward to me. Anyway... what do you mean with "much better" ? It's much better: - Its portability is superior over PyGTK - Its look & feel

Re: Windows Services

2005-12-14 Thread alf
Also think through which Windows account will run the service, and what permissions it will need. A little up front work here will be appreciated by the people who have to install your service. -- http://mail.python.org/mailman/listinfo/python-list

Re: allow_none=True in SimpleXMLRPCServer

2005-12-14 Thread Daniel Crespo
Thank you very much! I will try it as soon as possible, and write you back with my results. Best regards Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Still Loving Python

2005-12-14 Thread Daniel Crespo
By the way: > Under windows, only needs some dlls py2exe does this job :) Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Still Loving Python

2005-12-14 Thread Paul Boddie
Alex Martelli wrote: > Jérôme Laheurte <[EMAIL PROTECTED]> wrote: > > Sorry for the harsh tone, I just think GUI builders are *evil*. Except > > maybe for QT Designer, which has a nice model where you implement > > callbacks by subclassing the generated classes. At least you don't have to > > look

Re: Optimize function similiar to dict.update() but adds common values

2005-12-14 Thread Gregory Piñero
Thanks Peter, those are some really good ideas. I can't wait to try them out tonight. Here's a question about your functions. if I only look at the keys in freq2 then won't I miss any keys that are in freq1 and not in freq2? That's why I have the two loops in my original function. -Greg On 1

Re: disassemble, was(How do (not) I distribute my Python progz?)

2005-12-14 Thread Paul Boddie
Juergen Kareta wrote: > look at: > http://www.crazy-compilers.com/decompyle/ > > it's only a online service. But if it works, it would be nice to have > such a tool as standalone programm. And the next search result for decompyle on Google is... http://packages.debian.org/unstable/python/decompyl

Re: Newbie needs help with regex strings

2005-12-14 Thread Paul McGuire
This isn't a regex solution, but uses pyparsing instead. Pyparsing helps you construct recursive-descent parsers, and maintains a code structure that is easy to compose, read, understand, maintain, and remember what you did 6-months after you wrote it in the first place. Download pyparsing at htt

Re: Python C/API - *arg,**kwds variable argumnents

2005-12-14 Thread [EMAIL PROTECTED]
I saw that in 2.4, although it's not clear how I can make it work. the argument char *format and char *keywords[] are fixed there. Does anyone have a working example? I'm just wondering if there are plans or already an API/C in python core similar to __Pyx_GetStarArgs. It seems like a very usefull

Re: Python C/API - *arg,**kwds variable argumnents

2005-12-14 Thread [EMAIL PROTECTED]
essentially I already use PyArg_ParseTupleAndKeywords, but that seems to emulate fixed arg list definitions like - func (x,y,t=0,u=1) -- http://mail.python.org/mailman/listinfo/python-list

Re: writing a Mail Server

2005-12-14 Thread gene tani
[EMAIL PROTECTED] wrote: > Hello, > I have to implement a mail server type program for a project using > python. I have already implemented smtp and pop3 protocol to send and > retrieve mail at the client side. I used an existing mail server > account to test the code. Now, I need to write the fun

Re: Help: how to run python applications as NT service?

2005-12-14 Thread zxo102
Thanks for your help, Larry. Finally, I got it my python script run as NT service with the attached python code which is from the site: http://www.schooltool.org/products/schooltool-calendar/documentation/how-to/running-as-a-windows-service/schooltool-service.py/view ##

Re: Optimize function similiar to dict.update() but adds common values

2005-12-14 Thread Steve Holden
Gregory Piñero wrote: [top-posting rearranged] > On 12/14/05, Peter Otten <[EMAIL PROTECTED]> wrote: > >>Gregory Piñero wrote: >> >> >>>def add_freqs(freq1,freq2): >>>"""Addtwowordfreqdicts""" >>>newfreq={} >>>forkey,valueinfreq1.items(): >>>newfreq[key]=value+freq2.get(key,0) >>>forkey,valueinfre

Re: ElementTree - Why not part of the core?

2005-12-14 Thread Fredrik Lundh
Istvan Albert wrote: > don't know how this works, the link now seems to be: > > http://svn.python.org/view/python/trunk/Lib/xmlcore/etree/ people are moving things around, but xml.etree.ElementTree should still work when they're done. ("xml" dispatches to either xmlcore or _xmlplus, depending on

Re: Still Loving Python

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, Daniel Crespo <[EMAIL PROTECTED]> ha scritto: > Under windows, only needs some dlls (they are its runtime), and works > perfect. The same exe works on Win98, ME, 2000, XP. Of course that > there are some differences between these OSs. It's the same for Gtk > I tried both a lot, and

Re: Difference between ActivePython and Python.org

2005-12-14 Thread BartlebyScrivener
I fretted about which to pick and have advised here that the difference (if any) should be explained on the Python.org download page. I chose ActiveState because I'm on Windows XP, which means that the Win32 Extensions get installed automatically, along with other goodies (the PythonWin IDE, a pret

Re: ElementTree - Why not part of the core?

2005-12-14 Thread Fredrik Lundh
Gregory Petrosyan wrote: > This I've got after > > make install > > and > > [EMAIL PROTECTED]:~$ python > > When launching ./python from ./trunk, everything is OK. Is it a problem > with me or with installation? things are being moved around, and installation seems to be broken at the moment (it

Re: Optimize function similiar to dict.update() but adds common values

2005-12-14 Thread Peter Otten
Gregory Piñero wrote: > Here's a question about your functions. if I only look at the keys in > freq2 then won't I miss any keys that are in freq1 and not in freq2? No. As I start with a copy of freq1, all keys of freq1 are already there. There is probably a loop involved, but it in Python's un

Re: "0 in [True,False]" returns True

2005-12-14 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Steve Holden wrote: >> >>It would be somewhat more self-documenting, but why not just use one >> >>name to indicate the state and another, only meaningful in certain >> >>states, to indicate the callback? >> > Why should I do that? Checking the type of a variable is conc

Re: Threading in python

2005-12-14 Thread Carl J. Van Arsdall
> These answers assume you're using CPython; Jython and IronPython have > different answers. > > This confuses me. What is CPython versus Jython and IronPython? I'm using compiled source from python.org, would this be CPython? >> 1. Who schedules which threads run and when? Is this somet

Re: Newbie needs help with regex strings

2005-12-14 Thread Fredrik Lundh
Scott wrote: > I have a file with lines in the following format. > > pie=apple,quantity=1,cooked=yes,ingredients='sugar and cinnamon' > Pie=peach,quantity=2,ingredients='peaches,powdered sugar' > Pie=cherry,quantity=3,cooked=no,price=5,ingredients='cherries and sugar' > > I would like to pull out

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Alan Franzoni
S.Chang on comp.lang.python said: > Hi, > Anyone knows the difference(s) between the Python binaries from > ActiveState and Python.org? ActivePython is a 'batteries included' distro. I think it's great for Windows - it includes a lot of manuals in CHM format and the Win32 extensions. The inter

Re: Newbie needs help with regex strings

2005-12-14 Thread Christopher Subich
Paul McGuire wrote: > This isn't a regex solution, but uses pyparsing instead. Pyparsing > helps you construct recursive-descent parsers, and maintains a code > structure that is easy to compose, read, understand, maintain, and > remember what you did 6-months after you wrote it in the first place

Question about tuple lengths

2005-12-14 Thread Carl J. Van Arsdall
From my interpreter prompt: >>> tuple = ("blah") >>> len(tuple) 4 >>> tuple2 = ("blah",) >>> len (tuple2) 1 So why is a tuple containing the string "blah" without the comma of length four? Is there a good reason for this or is this a bug? -- Carl J. Van Arsdall [EMAIL PROTECTED] Build

Re: Threading in python

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, Carl J. Van Arsdall <[EMAIL PROTECTED]> ha scritto: > This confuses me. What is CPython versus Jython and IronPython? I'm > using compiled source from python.org, would this be CPython? CPython is the official distribution, the one you find on python.org It's C and Python based.

Worthwhile to reverse a dictionary

2005-12-14 Thread rudysanford
I just started messing with programming and started with Python. Part of my first project deals with translating numerical values to letters. I would like to be able to do the reverse as well, letters to numbers, sort of a table for lookup and a table for reverse lookup. I thought that a dictiona

Re: Newbie needs help with regex strings

2005-12-14 Thread Dennis Benzinger
Catalina Scott A Contr AFCA/EVEO schrieb: > I have a file with lines in the following format. > > pie=apple,quantity=1,cooked=yes,ingredients='sugar and cinnamon' > Pie=peach,quantity=2,ingredients='peaches,powdered sugar' > Pie=cherry,quantity=3,cooked=no,price=5,ingredients='cherries and sugar'

Re: IsString

2005-12-14 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>>So Python behaves demonstrably different from BOTH call by value and call >>>by reference. Consequently, it is neither of them. >> Right. *Python* behaves differently. That's not the same thing as >> Python's calling behaving differ

Re: ElementTree - Why not part of the core?

2005-12-14 Thread Fredrik Lundh
> > When launching ./python from ./trunk, everything is OK. Is it a problem > > with me or with installation? > > things are being moved around, and installation seems to be broken at the > moment (it doesn't install the Lib/xmlcore tree) if you have time, can you update and try again ? (let me k

Re: Question about tuple lengths

2005-12-14 Thread Jean-Paul Calderone
On Wed, 14 Dec 2005 09:54:31 -0800, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: > > From my interpreter prompt: > > >>> tuple = ("blah") > >>> len(tuple) >4 > >>> tuple2 = ("blah",) > >>> len (tuple2) >1 > >So why is a tuple containing the string "blah" without the comma of >length four? Is t

Re: OO in Python? ^^

2005-12-14 Thread Magnus Lycka
Christopher Subich wrote: > Doesn't work; duck typing is emphatically not subclass-typing. For this > system to still work and be as general as Python is now (without having > to make all variables 'object's), we'd need true interface checking. > That is, we'd have to be able to say: > > imple

Re: Newbie: executing a system command from my Python app

2005-12-14 Thread Magnus Lycka
Dan M wrote: > Have done so. Thanks for pointing out the shutils module! I keep finding > more and more excellent modules available. Do we have a Python equivalent > to Perl's CPAN? See http://www.python.org/pypi -- http://mail.python.org/mailman/listinfo/python-list

Re: I want a Python Puppy !

2005-12-14 Thread Magnus Lycka
Paul Rubin wrote: > Are you seriously saying that whatever distro came out most recently > (and therefore have the latest Python version) gets to be your > favorite? You're going to have to change favorites practically every > week. Python is very high on the agenda for the Ubuntu project, and *t

Re: Worthwhile to reverse a dictionary

2005-12-14 Thread Will McGugan
[EMAIL PROTECTED] wrote: > I just started messing with programming and started with Python. Part > of my first project deals with translating numerical values to letters. > I would like to be able to do the reverse as well, letters to numbers, > sort of a table for lookup and a table for reverse l

Re: Newbie needs help with regex strings

2005-12-14 Thread Dennis Benzinger
Christopher Subich schrieb: > Paul McGuire wrote: > > [...] > For the example listed, pyparsing is even overkill; the OP should > probably use the csv module. But the OP wants to parse lines with key=value pairs, not simply lines with comma separated values. Using the csv module will just separa

Re: Visual Python, really "Visual"?

2005-12-14 Thread Kevin Walzer
Maurice LING wrote: > Tolga wrote: >> After a very rapid entrance into the Python, I have immediately looked >> for a good IDE. Komodo and Wing IDE look very good and I think they are >> enough. But now, I am searching for a Pyhton environment which should >> look like Delphi / Kylix, Borland's C++

Re: I want a Python Puppy !

2005-12-14 Thread Magnus Lycka
Claudio Grondi wrote: > I have some trouble to understand how Python works > on it because it is not organized as on Windows (e.g. there is no [Lib] > directory under the [Python2.4] one) I guess it's at /usr/lib/python2.4 It's Windows which is odd by the way... Linux is organized in a way whic

Re: Python C/API - *arg,**kwds variable argumnents

2005-12-14 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I am writing a C extension with python 2.3.5 and need constructs > similar to python >func(*args, **kwds) > What's a neat way to do that? static PyObject* myfunc(PyObject* self, PyObject* args, PyObject* kw) { ... args is a tuple, kw is a dictionary ... } stati

Re: Python C/API - *arg,**kwds variable argumnents

2005-12-14 Thread Carsten Haese
On Wed, 2005-12-14 at 12:00, [EMAIL PROTECTED] wrote: > essentially I already use PyArg_ParseTupleAndKeywords, but that seems > to emulate fixed arg list definitions like - >func (x,y,t=0,u=1) It's unclear what you are actually trying to accomplish. My guess is that you want to implement a fu

Re: Optimize function similiar to dict.update() but adds common values

2005-12-14 Thread Gregory Piñero
Yes, that makes sense. I can't wait to run it tonight. Sorry I can't give you the running time of my original function as it never finished :-( I'll report back the running time of the new function though, assuming it finishes ;-) Thanks again, -Greg On 12/14/05, Peter Otten <[EMAIL PROTECTE

Re: Threading in python

2005-12-14 Thread Aahz
[BTW, please follow standard Usenet convention and attribute the quotes; I've added them back in for you] In article <[EMAIL PROTECTED]>, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote: >Aahz: >>Carl Van Arsdall: >>> >>> 1. Who schedules which threads run and when? Is this something left up >>>

Re: OO in Python? ^^

2005-12-14 Thread Mike Meyer
Magnus Lycka <[EMAIL PROTECTED]> writes: > Huh? I must have expressed my thoughts badly. This is trivial to > use in Python. You could for instance write a module like this: > > ### my_module.py ### > import copy > > def sum(*args): > result = copy.copy(args[0]) > for arg in args[1:]: >

Python newbie needs help

2005-12-14 Thread Ron Hudson
First let me apologize if this post offends, I am a real newbie to Python having only used it for about 2 days. If this is the wrong place to post newbie questions, please be polite. I have the O'Reily Learning Python book and I am reading it. Here's what I am working on.. I am trying to cre

Re: Still Loving Python

2005-12-14 Thread Brian van den Broek
Peter Decker said unto the world upon 2005-12-14 07:03: > On 12/13/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > > >>>Why this need to have everyone do things the way you do? >> >>Whatever makes you think I have this need? I said I hated them. I'm >>pretty sure I didn't say everyone should have to

Re: const objects (was Re: Death to tuples!)

2005-12-14 Thread Tom Anderson
On Wed, 14 Dec 2005, Steven D'Aprano wrote: > On Wed, 14 Dec 2005 10:57:05 +0100, Gabriel Zachmann wrote: > >> I was wondering why python doesn't contain a way to make things "const"? >> >> If it were possible to "declare" variables at the time they are bound >> to objects that they should not al

to write set of values to a file from python

2005-12-14 Thread muttu2244
hi everybody i want to write a set of values to a file from python. For ex:: the fields name will "comp name", "ip addr", "mac addr" etc. And below all these fields i ll have the values for these fields. it should look some what like this. comp name ipaddr

Re: IsString

2005-12-14 Thread Tom Anderson
On Tue, 13 Dec 2005, Fredrik Lundh wrote: > Steve Holden wrote: > >> In Python a name (*not* a "variable", though people do talk loosely >> about "instance variables" and "class variables" just to be able to use >> terms familiar to users of other to languages) is simply *bound* to a >> value.

Re: IsString

2005-12-14 Thread Tom Anderson
On Tue, 13 Dec 2005, Xavier Morel wrote: > Tom Anderson wrote: > >> In what sense are the names-bound-to-references-to-objects not >> variables? > > In the sense that a variable has various meta-informations (at least a > type) No. In a statically typed language (or possibly only a manifestly t

Re: Worthwhile to reverse a dictionary

2005-12-14 Thread rudysanford
Thanks so much. That seems to have it. This is the sort of thing I had before: #!/usr/local/bin/python # make a short dictionary d1 = {'A' : '1', 'B' : '2', 'C' : '3'} for letter in d1.keys(): print letter, '\t', d1[letter] # make a space between the output of the 2 dictionaries print '\n'

Re: IsString

2005-12-14 Thread Tom Anderson
On Tue, 13 Dec 2005, Mike Meyer wrote: > You can show the same difference in behavior between Python and C (for > example) without using a function call. Really? You certainly don't do that with the code below. > Here's C: > > #include > > main() { > int i, *ref ; > i = 1 ; > ref = &i ; /

Re: Worthwhile to reverse a dictionary

2005-12-14 Thread rudysanford
What is the difference between " d1 = {'A' : '1', 'B' : '2', 'C' : '3'} " and " d1 = dict(A = 1, B = 2, C = 3) " ? All of the dictionary examples I saw (python.org, aspn.activestate.com, Learning Python by Lutz, among others) use d={'x' : 'y'}. -- http://mail.python.org/mailman/listinfo/pyt

Re: Still Loving Python

2005-12-14 Thread Magnus Lycka
Peter Maas wrote: > If you design a moderately complex UI a designer will be faster. It's > not the speed of typing vs. dragging that matters. You see the result > instantly and don't have to start your program, look, type code, start > again and so on. A GUI builder is more pleasant to work with,

Re: Visual Python, really "Visual"?

2005-12-14 Thread Magnus Lycka
Tolga wrote: > After a very rapid entrance into the Python, I have immediately looked > for a good IDE. Komodo and Wing IDE look very good and I think they are > enough. But now, I am searching for a Pyhton environment which should > look like Delphi / Kylix, Borland's C++ builder or Allegro Common

Dr. Dobb's Python-URL! - weekly Python news and links (Dec 14)

2005-12-14 Thread Cameron Laird
QOTW: "If I feel the need for languages that enforce my design decisions, I know where to find them." - Mike Meyer "There's ... unavoidable complexity involved in managing a software distribution composed of third party software packages. At the very least, you've got the original sources and t

Re: Still Loving Python

2005-12-14 Thread Jérôme Laheurte
On Wed, 14 Dec 2005 08:21:30 -0800, Daniel Crespo wrote: >> So wxPython doesn't need a runtime? I don't think so. wxPython for me >> sucks under Linux (built on gtk2) and I don't like its API at all. It >> seems a bit awkward to me. Anyway... what do you mean with "much better" ? > > It's much b

Re: IsString

2005-12-14 Thread Tom Anderson
On Wed, 14 Dec 2005, Steven D'Aprano wrote: > On Tue, 13 Dec 2005 15:28:32 +, Tom Anderson wrote: > >> On Tue, 13 Dec 2005, Steven D'Aprano wrote: >> >>> On Mon, 12 Dec 2005 18:51:36 -0600, Larry Bates wrote: >>> >>> [snippidy-doo-dah] >>> I had the same thought, but reread the post. He

Re: ElementTree - Why not part of the core?

2005-12-14 Thread Gregory Petrosyan
[EMAIL PROTECTED]:~$ python Python 2.5a0 (#4, Dec 14 2005, 22:08:59) [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from xml.etree import ElementTree as ET >>> ET >>> Thanks for fix. -- http://mail.python.org/mailman/l

Re: Still Loving Python

2005-12-14 Thread Jérôme Laheurte
On Wed, 14 Dec 2005 08:35:56 -0800, Paul Boddie wrote: > I imagine that Jérôme was referring to code generated by pyuic. Of > course, there are various extensions for PyQt which let you build the > user interface directly from the XML-based descriptions. Indeed, that's what I meant. I should have

Recommend an E-book Meeting the Following Criteria (Newbie, Long)

2005-12-14 Thread Veli-Pekka T�til
Hi, I know several programming languages namely Java, Perl and C in this order and would now like to pick up the Python basics fairly quickly. I've found that the best way to learn for me is to get a good book (for Christmas in this case), spend some time with it and do my own coding. Now I'm w

Re: openings on java with japanese language

2005-12-14 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > send your profile to [EMAIL PROTECTED] Please don't post job offers here (comp.lang.python) (even for Python jobs), there are more appropriate places for Python jobs, but there is no excuse for asking for Java programmers here. --Scott David Daniels [EMAIL PROTECTED] --

Re: Still Loving Python

2005-12-14 Thread Jérôme Laheurte
On Wed, 14 Dec 2005 12:35:56 -0600, Brian van den Broek wrote: > It seems to me that long tradition has it that "evil" in a context > such as this really is not that strong a term. See > . Thanks. Next time I'll spell it 'vil', in the hope that i

Re: Still Loving Python

2005-12-14 Thread Jérôme Laheurte
On Wed, 14 Dec 2005 08:53:26 +, Steve Holden wrote: > It isn't often done, but I quite like the idea of giving users the GUI > builder so that they can specify their preferred task interface, at > least to a first approximation. That would be a valid use for these things, prototyping the UI

Re: Newbie needs help with regex strings

2005-12-14 Thread Gerard Flanagan
Fredrik Lundh wrote: > Scott wrote: > > > I have a file with lines in the following format. > > > > pie=apple,quantity=1,cooked=yes,ingredients='sugar and cinnamon' > > Pie=peach,quantity=2,ingredients='peaches,powdered sugar' > > Pie=cherry,quantity=3,cooked=no,price=5,ingredients='cherries and s

Re: Worthwhile to reverse a dictionary

2005-12-14 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > What is the difference between > > " d1 = {'A' : '1', 'B' : '2', 'C' : '3'} " > > and > > " d1 = dict(A = 1, B = 2, C = 3) " ? > > All of the dictionary examples I saw (python.org, aspn.activestate.com, > Learning Python by Lutz, among others) use d={'x' : 'y'}. I

Re: Post-modernism, Academia, and the Tech Geeking fuckheads

2005-12-14 Thread Tin Gherdanarra
Xah Lee wrote: > Post-modernism, Academia, and the Tech Geeking fuckheads > > • the Sokal Affair > http://en.wikipedia.org/wiki/Sokal_Affair > > • SCIGen and World Multi-Conference on Systemics, Cybernetics and > Informatics > http://pdos.csail.mit.edu/scigen/ > > • What are OOP's Jargons and

Re: to write set of values to a file from python

2005-12-14 Thread Dennis Benzinger
[EMAIL PROTECTED] schrieb: > hi everybody > > i want to write a set of values to a file from python. > For ex:: the fields name will "comp name", "ip addr", "mac addr" etc. > And below all these fields i ll have the values for these fields. > > it should look some what like this. > > comp name

Re: writing IM bots

2005-12-14 Thread Jarek Zgoda
Amit Khemka napisał(a): > thank you all for ur suggestions .. I got msnp and curfoo(for yahoo) > customized and working :-) .. though they are pretty slow in > responding to messages ... will try jabber based > protocols, PyXMPP has very friendly mailing list, don't hesitate to ask if you get i

Re: Newbie needs help with regex strings

2005-12-14 Thread Michael Spencer
Dennis Benzinger wrote: > Christopher Subich schrieb: >> Paul McGuire wrote: >> >> [...] >> For the example listed, pyparsing is even overkill; the OP should >> probably use the csv module. > > But the OP wants to parse lines with key=value pairs, not simply lines > with comma separated values. U

Re: python24.dll and encodings ?

2005-12-14 Thread Martin v. Löwis
Bugs wrote: > Thanks Martin! As the python24.dll now contains modules and codecs that > weren't linked into the DLL before 2.4 and as we now need a PEP to have > them split out again, I assume there was a PEP to have them included for > 2.4? Can you point me to that PEP so I can evaluate writing

Re: PHP = Perl Improved

2005-12-14 Thread Tin Gherdanarra
Xah Lee wrote: > recently i got a project that involves the use of php. In 2 days, i > read almost the entirety of the php doc. Finding it a breeze because it > is roughly based on Perl, of which i have mastery. I suspect that you are a computer program posing as a human usenet correspondent. Ple

Re: Threading in python

2005-12-14 Thread Jean-Paul Calderone
On 14 Dec 2005 10:15:08 -0800, Aahz <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, >Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote: > >>Because of this global interpreter lock does this mean its impossible to >>get speed up with threading on multiple processor systems? I would >>think

Re: Python newbie needs help

2005-12-14 Thread Dennis Benzinger
Ron Hudson schrieb: > [...] > I have a .py file with some def scripts(?) in it. def is the begining of a function definition. > [...] > I am using "Import" to read it after I start an interactive python. > What I need > right now is I seem to have some sort of scoping problems with the > wor

Re: Still Loving Python

2005-12-14 Thread Peter Decker
On 12/14/05, Magnus Lycka <[EMAIL PROTECTED]> wrote: > It's my impression that code generation leads to more duplication > and less code reuse. It's easy to whip up a new class or window > that duplicates a lot of already existing code, with those graphical > tools. Of course, Visual designer !=

Re: Still Loving Python

2005-12-14 Thread Bengt Richter
On Wed, 14 Dec 2005 10:07:04 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] (Bengt Richter) writes: >> A single click compiles, links and runs the resulting independent windows >> .exe in a fraction of a second >> for the above, and I can see the hint, kill the .exe, and go on wh

Re: Question about tuple lengths

2005-12-14 Thread MM Zeeman
Carl J. Van Arsdall wrote: > > From my interpreter prompt: > > >>> tuple = ("blah") > >>> len(tuple) > 4 > >>> tuple2 = ("blah",) > >>> len (tuple2) > 1 > > So why is a tuple containing the string "blah" without the comma of > length four? Is there a good reason for this or is this a bug?

Interprocess communication and memory mapping

2005-12-14 Thread James Aguilar
Oh wise readers of comp.lang.python, Lend a newbie your ears. I have read several old articles from this group about memory mapping and interprocess communication and have Googled the sh** out of the internet, but have not found sufficient to answer my questions. Suppose that I am writing a ray

Re: Worthwhile to reverse a dictionary

2005-12-14 Thread rudysanford
Thanks. That is exactly what I meant. In d2, A is not 'A' because it is being set to 1, whereas in d1, using A instead of 'A' means A is an undeclared variable instead of a string? -- http://mail.python.org/mailman/listinfo/python-list

Re: Threading in python

2005-12-14 Thread Peter Hansen
Jean-Paul Calderone wrote: > On 14 Dec 2005 10:15:08 -0800, Aahz <[EMAIL PROTECTED]> wrote: >>You either need to run multiple processes or run code that mostly calls >>into C libraries that release the GIL. For example, a threaded spider >>scales nicely on SMP. > > Yes. Nearly as well as a singl

Re: OO in Python? ^^

2005-12-14 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Magnus Lycka wrote: > > Assume that you didn't use Python, but rather something with > > static typing. How could you make a module such as my_module.py, > > which is capable of working with any type that supports some > > standard copy fu

?: in Python

2005-12-14 Thread Andy Leszczynski
How can do elegantly in Python: if condition: a=1 else: a=2 like in C: a=condition?1:2 -- http://mail.python.org/mailman/listinfo/python-list

how to get select label?

2005-12-14 Thread lli
Hi Guys, I built a select in a form. My select is: print '' print 'ALL' print 'AAA' print 'BBB' print '' I can get which item value users select. For example users select item 2, I can get its value "001". But now I want to get item labe

Re: IsString

2005-12-14 Thread Tom Anderson
On Tue, 13 Dec 2005, Steve Holden wrote: > Tom Anderson wrote: >> On Tue, 13 Dec 2005, Steven D'Aprano wrote: >> >>> On Mon, 12 Dec 2005 18:51:36 -0600, Larry Bates wrote: >>> >>> [snippidy-doo-dah] >>> I had the same thought, but reread the post. He asks "if a given variable is a c

Re: How to get the local mac address?

2005-12-14 Thread Scott David Daniels
Daniel Crespo wrote: > Hi, I tried: ... > # Convert binary data into a string. > macaddr = '' > for intval in struct.unpack('BB', buffer): > if intval > 15: > replacestr = '0x' > else: > replacestr = 'x' > macaddr = ''.join([macaddr,

Re: Question about tuple lengths

2005-12-14 Thread Dave Hansen
On Wed, 14 Dec 2005 12:58:16 -0500 in comp.lang.python, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: [...] > >It's the comma that makes it a tuple. The parenthesis are only required in >cases where the expression might mean something else without them. That's almost true. Consider: >>> t2 =

Re: python24.dll and encodings ?

2005-12-14 Thread Thomas Heller
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > Bugs wrote: >> Thanks Martin! As the python24.dll now contains modules and codecs that >> weren't linked into the DLL before 2.4 and as we now need a PEP to have >> them split out again, I assume there was a PEP to have them included for >> 2.4? Ca

set & random.choice question

2005-12-14 Thread stevecanfield
I want to do something like this: from random import choice x = set(("jenny", "jacqui", "claire", "chris", "tracy")) somebody = random.choice(x) but I bet a "TypeError: unindexable object" error. Any suggestions for an elegant workaround? I'm using set because I want to know that I have a

Re: ?: in Python

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, Andy Leszczynski <[EMAIL PROTECTED]> ha scritto: > How can do elegantly in Python: > > if condition: > a=1 > else: > a=2 > > like in C: > > a=condition?1:2 > There are tons of threads on this newsgroup and in the python-dev mailing list about a ternary operator. There's also

Re: how to get select label?

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > Hi Guys, > > I built a select in a form. My select is: > print '' > print 'ALL' > print 'AAA' > print 'BBB' > print '' Which web technology/framework are you using that re

Re: Newbie needs help with regex strings

2005-12-14 Thread Michael Spencer
Catalina Scott A Contr AFCA/EVEO wrote: > I have a file with lines in the following format. > > pie=apple,quantity=1,cooked=yes,ingredients='sugar and cinnamon' > Pie=peach,quantity=2,ingredients='peaches,powdered sugar' > Pie=cherry,quantity=3,cooked=no,price=5,ingredients='cherries and sugar' >

Re: set & random.choice question

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > I want to do something like this: > > from random import choice > x = set(("jenny", "jacqui", "claire", "chris", "tracy")) > somebody = random.choice(x) import random x = set(("jenny", "jacqui", "claire", "chris", "tracy")) s

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Steve Christensen
On 2005-12-14, S.Chang <[EMAIL PROTECTED]> wrote: > Hi, > Anyone knows the difference(s) between the Python binaries from > ActiveState and Python.org? If you want to re-distribute the ActivePython packages outside of your organization, you have to get permission from ActiveState.

Re: set & random.choice question

2005-12-14 Thread Christophe Delord
Hello, On 14 Dec 2005 12:16:22 -0800, [EMAIL PROTECTED] wrote: > I want to do something like this: > > from random import choice > x = set(("jenny", "jacqui", "claire", "chris", "tracy")) > somebody = random.choice(x) > > but I bet a "TypeError: unindexable object" error. Any suggestions

Re: how to get select label?

2005-12-14 Thread lli
Sorry , I forget to say that. I use CGI, HTML and python. LLI -- http://mail.python.org/mailman/listinfo/python-list

Re: ?: in Python

2005-12-14 Thread Andy Leszczynski
Lawrence Oluyede wrote: > Il 2005-12-14, Andy Leszczynski <[EMAIL PROTECTED]> ha scritto: > >>How can do elegantly in Python: >> >>if condition: >>a=1 >>else: >>a=2 >> >>like in C: >> >>a=condition?1:2 >> > > > There are tons of threads on this newsgroup and in the python-dev mailing > l

Simple (?) question about print statement

2005-12-14 Thread TY
Hi all, I have this little simple script: for i in range(10): for j in range(500): pass # Timing-delay loop print i When you run it, it behaves as you would expect -- it prints 0 on the next line prints 1 on the next line prints 2 etc. But if you add a comma at the end of pri

Re: Visual Python, really "Visual"?

2005-12-14 Thread [EMAIL PROTECTED]
Short comment. Just want to point out a tool that I have developed. http://farpy.holev.com Give it a try. It's purpose is to serve as a GUI editor for Python and to other languages in the near future. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple (?) question about print statement

2005-12-14 Thread Pelmen
>From doc: range( [start,] stop[, step]) This is a versatile function to create lists containing arithmetic progressions. It is most often used in for loops. The arguments must be plain integers. If the step argument is omitted, it defaults to 1. If the start argument is omitted, it defaults to 0

<    1   2   3   4   >