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

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

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

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

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

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

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

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

Lambda

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

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

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

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

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

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

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

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

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

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

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

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: 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 = [] >>

Re: variable declaration

2005-02-08 Thread Caleb Hattingh
Jeff I fully agree. As I stated in a message to alexander, it is quick and easy even to write a simple project-specific tool for checking that only allowed variable names exist in all the project files. Compared to having to work with tons of effectively useless variable declarations foreve

Re: PHP Embedded In Python

2005-02-08 Thread jdonnell
Well it depends on how php is installed. Is it a linux system? Do you know how to run a php script from the command line? Once you have the php script running from the command line then you need to use the os module in python. There are a couple different ways to do it. Read the following for more

Re: Basic file operation questions

2005-02-08 Thread Grant Edwards
On 2005-02-08, Marc Huffnagle <[EMAIL PROTECTED]> wrote: >>>for line in file(...): >>> # do stuff > When you read a file with that method, is there an implied close() call > on the file? I assume there is, but how is that handled? The file will be closed when the the file object is deleted b

Re: Loop in list.

2005-02-08 Thread Caleb Hattingh
Stephen You're gonna have to help me here.what is the effective difference? Thanks Caleb '>>> a = [] '>>> for b in range(4): '>>> for i in range(3): '>>> a.append(i*2*b) There is a subtle error in this explanation. The equivilence actually looks like: '> a = [] '> l1 = range(4) '> l

Re: python code with indention

2005-02-08 Thread Steve Holden
Timo Virkkala wrote: Xah Lee wrote: is it possible to write python code without any indentation? 1) Why in the name of Xah Lee would you even want to? 2) If you need to ask questions this simple, are you sure you are the right person to write tutorials? 3) Do you even read the replies you get? S

Re: variable declaration

2005-02-08 Thread Caleb Hattingh
Alexander PowerOfGenerator=TakeFromSensor() if PowerOfGenerator>xxx: RecalcPower(PowerOfGenerator) PutToTheDatabase(PowerOfGenerator) Here, python will not help you. The worst thing is that in such calculations you often receive plausible results. (I think PyChecker has co

Re: overwriting method in baseclass

2005-02-08 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Harald Massa wrote: > Thanks for that recommendation, I really do use subversion for some time. > But how can I use it to solve this problem? I do changes to the common > baseclass which is OUTSIDE my development. I quite correctly assume that > the developers of the cla

Re: Big development in the GUI realm

2005-02-08 Thread Jeff Shannon
Maciej Mróz 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. 2. Later someone writes plugin using the api (which is public domain so is GPL compatibl

Re: Loop in list.

2005-02-08 Thread Bruno Desthuilliers
Jim a écrit : Where did this type of structure come from: mat = ['a' for i in range(3)]? This will produce a list of three elements but I don't see reference for it in any of the books. Now everyone told you *what* is it, I'll (very very dumbly) answer the question : this syntax comes from Has

Re: Basic file operation questions

2005-02-08 Thread Caleb Hattingh
Marc I don't know how it is handled, but I expect also that there is an implied close(). thanks Caleb When you read a file with that method, is there an implied close() call on the file? I assume there is, but how is that handled? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python versus Perl ?

2005-02-08 Thread m
You really will have to convince people here that execution speed is a real issue for your programming task (in order to continue this discussion). Otherwise the debate will go south real quick. Keep well Caleb On Tue, 08 Feb 2005 12:17:05 -0600, m <[EMAIL PROTECTED]> wrote: Courageous wrote:

Re: Python versus Perl ?

2005-02-08 Thread m
Irmen de Jong wrote: m wrote: Why do you care? Have you read http://www.python.org/moin/PythonSpeed ? --Irmen i had not read it. thanks for pointing it out! -- http://mail.python.org/mailman/listinfo/python-list

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Caleb Hattingh
Jean, Paddy I use "pym" to extract bits of pascal out of delphi code for documentation purposes. You have to add some stuff to the delphi code (in your case, C header), but these are added within comment blocks, and the interesting thing is that you add python code(!) as a kind of dynamic ma

Re: Loop in list.

2005-02-08 Thread Stephen Thorne
On Tue, 08 Feb 2005 23:07:09 -0500, Caleb Hattingh <[EMAIL PROTECTED]> 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

Re: python-2.4.msi installation issue

2005-02-08 Thread "Martin v. Löwis"
[EMAIL PROTECTED] wrote: My question is this: how do I determine what the error was that caused the installation process to end prematurely? Please run msiexec /i python-2.4.msi /l*v python.log and post the resulting python.log as a bug report on sf.net/projects/python. In most such cases, upgradin

Re: Loop in list.

2005-02-08 Thread Caleb Hattingh
Jim Someone on this list (SteveB) helped me quite a bit with a list comprehension on a recent thread. Roy said it can be hard to read, and I agree in part because I always thought they were hard to read, when in actual fact I had just never bothered to learn properly. Here is a mini-tutor

Re: Printing Filenames with non-Ascii-Characters

2005-02-08 Thread "Martin v. Löwis"
Marian Aldenhövel wrote: > If you're printing to the console, modern Pythons will try to guess the > console's encoding (e.g. cp850). But it seems to have quessed wrong. I don't blame it, I would not know of any way to reliably figure out this setting. It's actually very easy. Python invokes GetC

Re: graph visualisation

2005-02-08 Thread cwmoad
Alexander Zatvornitskiy wrote: > Hello, All! > > I need routines for visualization of graphs, like this for Matlab: > === > You can visualize an arbitrary graph (such as one learned using the structure > learning routines) with Matlab code contributed by Ali Taylan Cemgil from the > University of

Re: Printing Filenames with non-Ascii-Characters

2005-02-08 Thread "Martin v. Löwis"
Marian Aldenhövel wrote: dir = os.listdir(somepath) for d in dir: print d The program fails for filenames that contain non-ascii characters. 'ascii' codec can't encode characters in position 33-34: I cannot reproduce this. On my system, all such file names print just fine,

Re: Basic file operation questions

2005-02-08 Thread Jeff Shannon
Marc Huffnagle wrote: When you read a file with that method, is there an implied close() call on the file? I assume there is, but how is that handled? [...] for line in file(...): # do stuff As I understand it, the disk file will be closed when the file object is garbage collected. In CPytho

Re: User Identification

2005-02-08 Thread Michael Ströder
Gerhard Haering wrote: os.getuid() will give you the user id, but I don't know if Python has methods to look up more information from that from /etc/passwd or whereever from. >>> import pwd,os >>> pwd.getpwuid(os.getuid()) ('michael', 'x', 1234, 100, 'Michael Str\xf6der', '/home/michael', '/bin/ba

Re: python code with indention

2005-02-08 Thread Caleb Hattingh
is it possible to write python code without any indentation? Xah You can, of course, write a silly little inline script without any control structures that will all line up at the left margain. So what? John Roth I agree, John, I don't get it. The vast majority of programmers (albiet from my l

Re: msvcp71.dll and Python 2.4 C++ extensions

2005-02-08 Thread "Martin v. Löwis"
Matthias Baas wrote: I'm creating the installer via the distutils by calling "setup.py bdist_wininst". How can I configure distutils to have it create an installer that does the above things? Ah, I see. Unfortunately, bdist_wininst is not capable of doing a Windows logo compliant installation (with

Re: variable declaration

2005-02-08 Thread Jeff Shannon
Alexander Zatvornitskiy wrote: Another example. Let say you have variable PowerOfGenerator in your program. But, it is only active power, so you have to (1)rename PowerOfGenerator to ActivePowerOfGenerator, (2)calculate ReactivePowerOfGenerator, and (3)calculate new PowerOfGenerator by formula Po

Re: variable declaration

2005-02-08 Thread Thomas Bartkus
"Alexander Zatvornitskiy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The worst thing is that in such calculations you often receive plausible results. Exactly so! An ordinary spelling error gets promoted to a logic error that is damn difficult to detect, let alone trace! Bef

Re: Python versus Perl ?

2005-02-08 Thread Caleb Hattingh
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 speed between Perl and Python, whatever it is, is completely was

Reportlab and Barcodes

2005-02-08 Thread Josh
Hi All, I need someone to explain to me how to output a Code39 barcode to a Reportlab PDF. As far as I can tell, there is no means to do this with the Canvas object, and the demo that is included with the libraries is using the platypus Frame to place the barcode on the form. I do not wish to use

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

2005-02-08 Thread Jan Dries
Caleb Hattingh wrote: Anyone have that page ref handy listing the C modules that the pypy team need translated into python? http://codespeak.net/pypy/index.cgi?doc/cmodules.html Regards, Jan -- http://mail.python.org/mailman/listinfo/python-list

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

2005-02-08 Thread Peter Maas
Jeff Epler schrieb: 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 se

Pypy - Which C modules still need converting to py?

2005-02-08 Thread Caleb Hattingh
Hi all I saw it on a webpage a few days ago, can't seem to find it again. Tried a google search for "pypy needed translate C modules" but that didn't turn up what I was looking for. Anyone have that page ref handy listing the C modules that the pypy team need translated into python? than

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

2005-02-08 Thread Peter Maas
Jeff Epler schrieb: There's another little-known fact about Python: No string is permitted to end with a backslash! Sure you meant string literals. But that is wrong, too: >>> a = '\\' >>> print a \ A Python string mustn't end with an *odd* number of backslashes. Other- wise a literal using backs

Re: turing machine in an LC

2005-02-08 Thread Jeremy Bowers
On Tue, 08 Feb 2005 20:47:06 +0100, Bernhard Herzog wrote: > [x for L in [[[initial_state, 0]]] >for state, pos in L >if state is not None > and (L.append([M[state][T.get(pos, 0)][2], > pos + M[state][T.get(pos, 0)][1]]) >or T._

Re: Python versus Perl ?

2005-02-08 Thread Reinhold Birkenfeld
Fredrik Lundh wrote: > m" <[EMAIL PROTECTED]> wrote: > If Python is better than Perl, I'm curious how really significant those advantages are ? >> >> speedwise, i think perl is faster than python and python performed the >> slowest as shown in >> http://www.flat222.org/mac/bench/ > > if

Re: string issue

2005-02-08 Thread Reinhold Birkenfeld
Alex Martelli wrote: > Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: > >> Alex Martelli wrote: >> >> > So, *WHAT ON EARTH* could possibly >> > make this weird 'x[:]' form preferable to 'x*1'?! It's MUCH more >> > obvious that the second one returns an independent, separate object >> > initially

Re: python code with indention

2005-02-08 Thread Timo Virkkala
Xah Lee wrote: is it possible to write python code without any indentation? 1) Why in the name of Xah Lee would you even want to? 2) If you need to ask questions this simple, are you sure you are the right person to write tutorials? 3) Do you even read the replies you get? -- Timo Virkkala -- htt

Re: newbie wants to compile python list of filenames in selected directories

2005-02-08 Thread anthonyberet
M.E.Farmer wrote: anthonyberet wrote: Hi, I am new at Python, and very rusty at the one language I was good at, which was BASIC. I want to write a script to compare filenames in chosen directories, on windows machines. Ideally it would compose a list of strings of all the filenames in the director

Re: Python versus Perl ?

2005-02-08 Thread Irmen de Jong
m wrote: Fredrik Lundh wrote: if you use Python mostly to write empty loops, your programming license should be revoked. the benchmark author seems to have realized that, as can be seen from the "it's dead" paragraph at the top of the page, which makes me wonder why you posted this link... i wa

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

2005-02-08 Thread Paddy McCarthy
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 <> Jeff Nice, Made my evening :-) - Pad. -- http://mail.python.org/mailman/listinfo/pyt

Re: Big development in the GUI realm

2005-02-08 Thread Tim Churches
Fredrik Lundh wrote: Tim Churches wrote: except that if *you* set things up so the code is combined when run, *you* are copying, distributing, and/or modifying the program in order to mix, include and/or combine your work with the GPL:ed work. if you leave all that to the user, you're clear.

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Paddy McCarthy
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 chose to make my UT-generator in Pyt

Re: graph visualisation

2005-02-08 Thread bearophileHUGS
This isn't a visualisation routine, but it contains some of them, and with few mod you can adapt them for your needs: http://gato.sourceforge.net/ Gato - the Graph Animation Toolbox - is a software which visualizes algorithms on graphs. Bearophile -- http://mail.python.org/mailman/listinfo/pyt

Re: turing machine in an LC

2005-02-08 Thread Bernhard Herzog
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

Re: turing machine in an LC

2005-02-08 Thread Michael Spencer
Jeremy Bowers wrote: OK then, I still don't quite see how you can build a Turing Machine in one LC, but an LC and one preceding list assignment should be possible, although the resulting list from the LC is garbage; Not necessarily garbage - could be anything, say a copy of the results: >>> resul

  1   2   3   >