Re: Loop in list.

2005-02-08 Thread Fredrik Lundh
Stephen Thorne wrote: >> '>>> a = [i*2*b for i in range(3) for b in range(4)] >> '>>> a >> [0, 0, 0, 0, 0, 2, 4, 6, 0, 4, 8, 12] >> >> Might take you a while to correlate the answer with the loop, but you >> should be able to see after a while that this nesting is the same as >> >> '>>> a = [] >>

A ListComp that maintains its own state (Was: Re: turing machine in an LC)

2005-02-08 Thread Michael Spencer
Jeremy Bowers <[EMAIL PROTECTED]> writes: On Tue, 08 Feb 2005 17:36:19 +0100, Bernhard Herzog wrote: Nick Vargish <[EMAIL PROTECTED]> writes: "Xah Lee" <[EMAIL PROTECTED]> writes: is it possible to write python code without any indentation? Not if Turing-completeness is something you desire. Ber

Re: Confused with methods

2005-02-08 Thread Diez B. Roggisch
> No python is not consistent and your continuous repetion doesn't > make it so. To illustrate, here the following code: > > class A: > l = [] > def f(): pass > > a = A() > print a.l is A.l > print a.f is A.f > > which produces: > > True > False Thats only inconsistent from your POV becaus

Re: trolltech comitment

2005-02-08 Thread Leif K-Brooks
Gabriel B. wrote: What it they revoke this license [on Qt]? They can't. It's the GPL. what it windows longhorn has a non-backwardcompatible GDI API and a newer version of Qt must be used, and that newer version does not have a gpl version? What if Wx does that? What if Tk does? What if GTK does? If

Re: Python versus Perl ?

2005-02-08 Thread Adam DePrince
On Tue, 2005-02-08 at 22:44, Caleb Hattingh wrote: > Hi m > > Speed is a contentious issue here. Point is, if you really need raw > speed, why stop only at Perl and Python? There are plenty of statically > compiled languages that will produce native binaries. > > The relative difference in

Downloadable python-dev archive February 2005 contains only one mail?

2005-02-08 Thread Dennis Benzinger
Hi! I just downloaded the archive of the python-dev mailing list for February 2005 from http://mail.python.org/pipermail/python-dev/2005-February.txt.gz and there is only one mail in it. Did anyone have this problem, too? Bye, Dennis -- http://mail.python.org/mailman/listinfo/python-list

What's wrong with `is not None`?

2005-02-08 Thread Frans Englich
That's what PyChecker tells me, at least. A line of: if testReport is not None: results in: runner.py:587: Using is not None, may not always work In what circumstances can `is not None` fail? How and why does it fail? What is the equivalent expression which is more secure; `!= None`? Chee

Re: Big development in the GUI realm

2005-02-08 Thread Gabriel B.
> However, imagine simple situation: > 1. I write proprietary program with open plugin api. I even make the api > itself public domain. Program works by itself, does not contain any > GPL-ed code. No need to continue. You write something that uses a plugin, Eolas sues you. Don't have to mind about

Re: Big development in the GUI realm

2005-02-08 Thread John Lenton
On Tue, Feb 08, 2005 at 09:19:58PM -0200, Gabriel B. wrote: > > However, imagine simple situation: > > 1. I write proprietary program with open plugin api. I even make the api > > itself public domain. Program works by itself, does not contain any > > GPL-ed code. > > No need to continue. You writ

Re: Loop in list.

2005-02-08 Thread Roy Smith
Jim <[EMAIL PROTECTED]> wrote: > Thanks for the help. Python is somewhat mysterious to an old fortan > programer. You might appreciate http://www.python.org/doc/Humor.html#habits -- http://mail.python.org/mailman/listinfo/python-list

Re: What's wrong with `is not None`?

2005-02-08 Thread Leif K-Brooks
Frans Englich wrote: runner.py:587: Using is not None, may not always work It's a PyChecker bug relating to None being a constant in 2.4: . -- http://mail.python.org/mailman/listinfo/python-list

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread John Machin
Jean de Largentaye wrote: > Hi, > > I need to parse a subset of C (a header file), and generate some unit > tests for the functions listed in it. I thus need to parse the code, > then rewrite function calls with wrong parameters. What I call "shaking > the broken tree" :) I was thinking "cdecl",

Re: Big development in the GUI realm

2005-02-08 Thread Robert Kern
Kent Johnson wrote: Fredrik Lundh wrote: Robert Kern wrote: Fair enough. The only time I've seen it in dead-tree print was in Heinlein's _Time Enough For Love_, unattributed to anyone else. Amazon.com "search inside the book" finds no hits for "malice" in this book. http://www.amazon.com/gp/rea

Re: PHP Embedded In Python

2005-02-08 Thread Do Re Mi chel La Si Do
And : http://lesuisse.net/pyphp-0.1.tgz ? @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Java Integer.ParseInt translation to python

2005-02-08 Thread jose isaias cabrera
Ok, so this, buffer[0] = (byte)Integer.parseInt(string,16); in java is, partly, this buffer[0] = int(string, 16) in python. But here is my problem. When I call this java subroutine, byte[] decodeKey(String inString) { if (inString == null) return null; System.out.println("Strin

win32 service and sockets

2005-02-08 Thread Tom Brown
Hi, I created a win32 service for XPPro called N4010ATestService.py (see below). The service runs as a particular user with administrative rights. It starts a thread that creates a simple socket server (N4010ASocketServer.py -- also below) that just waits for 20 character string. When I run the

Re: tk global bindings

2005-02-08 Thread Gabriel B.
> Oh and you of course __must__ look at the (recently updated!) New Mexico > Tech tkinter document at: > http://infohost.nmt.edu/tcc/help/pubs/tkinter.pdf > > See page 75 and follwing for more info on keyboard bindings... Thanks, i was looking down that doc because the first thing i looked into i

tcl/tk naming scheme vs python's

2005-02-08 Thread Gabriel B.
I got my self writting nested objects to hold Tk references, then i realizes that i was working in python and not tcl, so i switched to flat vars... and in no time i was using more then 7 words separated by captalization in the names... i was able to rethink my scheme to use 5... no less. i'm i ex

Re: Dumb glob question

2005-02-08 Thread Python Dunce
Michael Hoffman <[EMAIL PROTECTED]> wrote in comp.lang.python: > Python Dunce wrote: > >> So if I happen >> to be processing 'foo [bar].par2' >> >> glob.glob(filename[:-5]+'.*par2') >> >> doesn't return anything. Using >> win32api.FindFiles(filename[:-5]+'.*par2') works perfectly, but I don't

Re: Big development in the GUI realm

2005-02-08 Thread Mike Meyer
"Gabriel B." <[EMAIL PROTECTED]> writes: >> >>Considering the fact that the Qt DLL exist by themselves, that the >> >>version used is the one provided by Qt, and that the EXE uses a >> >>standard, open way to communicate with it, the above does seem to say >> >>this use would be valid. >> >> >> >>

interactive execution

2005-02-08 Thread Jive Dadson
How does one execute arbitrary text as code within a module's context? I've got some code that compiles some text and then executes it. When the string is "print 'Hello'", it prints "Hello". I get no exception when I compile and execute "foo = 555". If I then compile and exec "print foo", I get

Lambda

2005-02-08 Thread e
here's what is probably an unusual question: -- http://mail.python.org/mailman/listinfo/python-list

Lambda

2005-02-08 Thread e
Question: WHAT IS LAMBDA? I can't figure out what it does from any documentation i've found anywhere. i doubt i need it but i still want to know what the heck it is/does/fixes/whatever! -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda

2005-02-08 Thread Tim Leslie
Short answer: lambda is a python keyword which allows you to create anonymous functions which may be considered a useful thing to have in certain cases*. Long answer: To be provided by someone else who isn't meant to be working right now. Tim * There is much debate as to just how useful lambda

Re: What's wrong with `is not None`?

2005-02-08 Thread Jive Dadson
Frans Englich wrote: > > That's what PyChecker tells me, at least. > > A line of: > > if testReport is not None: > > results in: > > runner.py:587: Using is not None, may not always work > > In what circumstances can `is not None` fail? How and why does it fail? > > What is the equivalent

Re: Lambda

2005-02-08 Thread Alan McIntyre
e wrote: Question: WHAT IS LAMBDA? I can't figure out what it does from any documentation i've found anywhere. i doubt i need it but i still want to know what the heck it is/does/fixes/whatever! Here's something: http://docs.python.org/tut/node6.html#SECTION00675 Hope this helps,

Re: An Ode To My Two Loves

2005-02-08 Thread Mike Meyer
Peter Maas <[EMAIL PROTECTED]> writes: > Jorgen Grahn schrieb: >> It's something that worries me frequently -- I feel guilty when I introduce >> Python into ("force Python upon") an organization. Because I hate having >> /other/ people's favorite toy languages forced down /my/ throat ... > > The s

Re: negative integer division

2005-02-08 Thread Jive Dadson
Python does it right. C is allowed to do it anyway it likes, which was a stupifyingly horrible decision, IMHO. Way back when, there was a language named Pascal. I lobbied the Pascal standards committee to define the modulus operator correctly, which they eventually did. To my astonishment, they

Re: variable declaration

2005-02-08 Thread Arthur
On Sat, 5 Feb 2005 17:00:15 +0100, [EMAIL PROTECTED] (Alex Martelli) wrote: >Alexander Zatvornitskiy ><[EMAIL PROTECTED]> wrote: > ... >> AM> The fact that in Python there are ONLY statements, NO declarations, >> === >> def qq(): >> global z >> z=5 >> === >> What is "global"? Statement? Ok, I

Re: interactive execution

2005-02-08 Thread Jeff Shannon
Jive Dadson wrote: How does one execute arbitrary text as code within a module's context? I've got some code that compiles some text and then executes it. When the string is "print 'Hello'", it prints "Hello". I get no exception when I compile and execute "foo = 555". If I then compile and exec

Re: A ListComp that maintains its own state (Was: Re: turing machine in an LC)

2005-02-08 Thread Carl Banks
Michael Spencer wrote: > > Jeremy Bowers <[EMAIL PROTECTED]> writes: > > > > > >>On Tue, 08 Feb 2005 17:36:19 +0100, Bernhard Herzog wrote: > >> > >>>Nick Vargish <[EMAIL PROTECTED]> writes: > >>> > "Xah Lee" <[EMAIL PROTECTED]> writes: > > >is it possible to write python code without

Re: Pypy - Which C modules still need converting to py?

2005-02-08 Thread Luis M. Gonzalez
Also you can browse the Pypy-Dev archives here: http://codespeak.net/pipermail/pypy-dev/ and post messages here: pypy-dev@codespeak.net regards, Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: interactive execution

2005-02-08 Thread George Yoshida
Jive Dadson wrote: I've got some code that compiles some text and then executes it. When the string is "print 'Hello'", it prints "Hello". I get no exception when I compile and execute "foo = 555". If I then compile and exec "print foo", I get a name error. The variable foo is undefined. My assu

Re: An Ode To My Two Loves

2005-02-08 Thread Aahz
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: > >COM is dominant on Windows because MS pushes it. CORBA isn't dominant >on Unix because there are a slew of extensible/embeddable languages to >pick from instead - assuming the apps in question came up with a >solution better

Re: WYSIWYG wxPython "IDE"....?

2005-02-08 Thread Jim Smith
Simon John wrote: I'm writing my 2nd large wxPython program, and after the problems I found doing the first's layout in code, I'd like to look at using a 'WYSIWYG' IDE, like VisualStudio does for MFC. I've tried a few that I found, wxGlade is probably the best, although it seems to be not 100% WYSI

Re: Learning Python - resources and ideas

2005-02-08 Thread Luis M. Gonzalez
Regarding rec.photo.equipment.35mm... this is not his fault. Yesterday I tried posting to comp.lang.python and, for some strange reason, it was posted momentarily to this group. Regarding Cody's question: If you are an absolute newby, try Josh Cogliati's python tutorial for non-programmers (google

Re: interactive execution

2005-02-08 Thread Jive Dadson
Jeff Shannon wrote: > > Jive Dadson wrote: > > > How does one execute arbitrary text as code within a module's context? > > > > I've got some code that compiles some text and then executes it. When > > the string is "print 'Hello'", it prints "Hello". I get no exception > > when I compile and

Re: Which IDE supports python and wxpython?

2005-02-08 Thread Jim Smith
Selfimprover wrote: Hello all, Is there a good IDE on the market which supports python and wxpython. Goal is to use it in a big distributed project. Greetings Try wxDesigner! http://www.roebling.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: An Ode To My Two Loves

2005-02-08 Thread Mike Meyer
[EMAIL PROTECTED] (Aahz) writes: > In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: >> >>COM is dominant on Windows because MS pushes it. CORBA isn't dominant >>on Unix because there are a slew of extensible/embeddable languages to >>pick from instead - assuming the apps in q

Re: interactive execution

2005-02-08 Thread Jive Dadson
Yeah. I got it. exec "foo = 555" in globals(), locals() does the trick. -- http://mail.python.org/mailman/listinfo/python-list

Re: negative integer division

2005-02-08 Thread Dan Bishop
Mark Jackson wrote: > Imbaud Pierre <[EMAIL PROTECTED]> writes: > > integer division and modulo gives different results in c and python, > > when negative numbers > > are involved. take gdb as a widely available c interpreter > > print -2 /3 > > 0 for c, -1 for python. > > more amazing, modulos o

Re: negative integer division

2005-02-08 Thread Mike Meyer
Jive Dadson <[EMAIL PROTECTED]> writes: > Python does it right. C is allowed to do it anyway it likes, which was > a stupifyingly horrible decision, IMHO. C only does it wrong if you think that C is a high level language. It isn't - it's a portable assembler. As such, low level things (like this

Re: A ListComp that maintains its own state (Was: Re: turing machine in an LC)

2005-02-08 Thread Michael Spencer
Carl Banks wrote: Pay attention, chief. I suggested this days ago to remove duplicates from a list. from itertools import * [ x for (x,s) in izip(iterable,repeat(set())) if (x not in s,s.add(x))[0] ] ;) Sorry, I gave up on that thread after the first 10 Million* posts. Who knows what other pe

Re: variable declaration

2005-02-08 Thread Elspeth Thorne
Alexander Zatvornitskiy wrote: > You may say: give better names for your variables! Ha, I'am often don't > understand that they mean! They are written for me by an engineer! Hang on, though - if you don't understand what you are programming, then how can you check if it's correct? Regardless of va

Re: Definitive documentation on newstyle classes? (WAS: Pickling and inheritance are making me hurt)

2005-02-08 Thread Michele Simionato
> It would be good to have a clear exposition of the pros and cons of > __new__ usage. It is there mostly because __init__ would not work on immutable types. OTOH, you probably do not want to use __new__ on mutable types (once I was caught by this trap, google for "overriding list.__new__" if you

ANN: Constrict 0.1.0 DNS message parsing library

2005-02-08 Thread Jason Smith
This message is to announce a new Python module, Constrict, which is useful for examining DNS messages that you receive either from a network capture or from a socket. While other DNS-related Python projects exist, none provide flexible message parsing and inspection. http://www.oes.co.th/proje

Name of type of object

2005-02-08 Thread Jive Dadson
The traceback routine prints out stuff like, NameError: global name 'foo' is not defined NameError is a standard exception type. What if I want to print out something like that? I've determined that "global name 'foo' is not defined" comes from the __str__ member of the exception object

Re: variable declaration

2005-02-08 Thread Eric Pederson
Arthur artfully argued: > What if: > > There was a well conducted market survey conclusive to the effect that > adding optional strict variable declaration would, in the longer run, > increase Python's market share dramatically. It's always good to examine one's objectives and motives. I am an

Re: Python versus Perl ?

2005-02-08 Thread Harlin
If you give it a good go, you will be amazed at how the text processing is so much better than Perl's. The same with the object orientation (what oop in Perl?? none... at least none worth mentioning :-) It's been said before by many Python users... Python allows newbies to program and wizards to be

Re: python code with indention

2005-02-08 Thread EP
> Original Message > From: "Xah Lee" <[EMAIL PROTECTED]> > is it possible to write python code without any indentation? Perhaps our zen-like response to this question should have been: >>>pass -- http://mail.python.org/mailman/listinfo/python-list

Re: Python versus Perl ?

2005-02-08 Thread Caleb Hattingh
Hi Adam Thanks for your comments. > I think the expression you seek is "comparing virtue among whores." Sure, that's what I was saying, but not quite in as colourfil a manner :) > > > > The problem domains in which I do most of my work (chemical process > > modelling and simulation) really do

Re: Loop in list.

2005-02-08 Thread Caleb Hattingh
Hi Fredrik *sigh* I think I will stop writing mini-tutorials :) You are, of course, correct. And I really like your method of explaining how to mentally juggle the LC into explicit loops. I shudder to think how mnay people I confused with my incorrect examples - I really should have tested the

Re: Name of type of object

2005-02-08 Thread Randall Smith
Jive Dadson wrote: The traceback routine prints out stuff like, NameError: global name 'foo' is not defined NameError is a standard exception type. What if I want to print out something like that? I've determined that "global name 'foo' is not defined" comes from the __str__ member of the

Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Max M
Jeff Epler wrote: No. Unlike Perl, Python implements only a *finite turning machine* model of computation. An easy way to see this limitation is in the following code: >>> 1.0 / 10.0 0.10001 In an infinite Turning machine, there would be an unbounded number of zeros before the

Re: python connect to server using SSH protocol

2005-02-08 Thread Martin Franklin
Simon Anders wrote: Hi Laszlo Zsolt Nagy wrote: [EMAIL PROTECTED] wrote: How can python connect to server which use SSH protocol? There should be a better way. Simon There is : pexpect! http://pexpect.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

RELEASED Python 2.3.5, final

2005-02-08 Thread Anthony Baxter
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.3.5 (final). Python 2.3.5 is a bug-fix release. See the release notes at the website (also available as Misc/NEWS in the source distribution) for details of the bugs squished in this r

Re: Python mail filter

2005-02-08 Thread Tim Roberts
"Mailer" <[EMAIL PROTECTED]> wrote: > >(P.S. I am very much aware of the existence of procmail, TMDA etc. My >requirements are very specific and requires integration with another >program, so I am only interested in getting a custom solution). But are you aware that a procmail recipe can feed a me

<    1   2   3