Re: Building Python with Tcl/Tk on Cygwin_NT-5.1

2005-02-08 Thread Dean N. Williams
Dear Jason, I installed Cygwin on another Windows XP platform, this time I selected "ALL" for the setup installation. Everything appears to have been install just fine, except for when I do the "rebaseall" command. I am receiving the following error messages when I do the "rebaseall" comman

Re: python connect to server using SSH protocol

2005-02-08 Thread Kartic
[EMAIL PROTECTED] wrote: > How can python connect to server which use SSH protocol? > Is it easy since my python has to run third party vendor, write data, > read data inside the server (supercomputer). > > Any suggestion? > > Sincerely Yours, > Pujo Aji Pujo, There are two Python oriented SSH s

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

2005-02-08 Thread Nick Vargish
"John M. Gabriele" <[EMAIL PROTECTED]> writes: > At some point during some dingy job in the back boiler room > of Unix, would you find yourself saying, "geez, I'd wish I > started this with Perl -- Python just isn't cutting it." ? Sometimes I have to write a quick script in Perl because Python is

Returned mail: Data format error

2005-02-08 Thread 40adeff9 . 6fec5ad3
This message was undeliverable due to the following reason(s): Your message could not be delivered because the destination computer was not reachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most lik

Re: python code with indention

2005-02-08 Thread Nick Vargish
"Xah Lee" <[EMAIL PROTECTED]> writes: > is it possible to write python code without any indentation? Not if Turing-completeness is something you desire. Nick -- # sigmask || 0.2 || 20030107 || public domain || feed this to a python print reduce(lambda x,y:x+chr(ord(y)-1),' Ojdl!Wbshjt

Re: Efficient checksum calculating on lagre files

2005-02-08 Thread Robin Becker
Ola Natvig wrote: Hi all Does anyone know of a fast way to calculate checksums for a large file. I need a way to generate ETag keys for a webserver, the ETag of large files are not realy nececary, but it would be nice if I could do it. I'm using the python hash function on the dynamic generated

Re: Learning Python - resources and ideas

2005-02-08 Thread Brian van den Broek
[EMAIL PROTECTED] (Cody Houston) said unto the world upon 2005-02-08 05:06: Hi. What is the best way to learn Python? None of the local schools near me teach any courses on the topic. Thanks. -- Cody Houston [EMAIL PROTECTED] Hi Cody, rec.photo.equipment.35mm? -- kind of an odd follow-up for a post

Re: python code with indention

2005-02-08 Thread John Roth
"Xah Lee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] is it possible to write python code without any indentation? Xah Depends on what you mean by "python code." If you mean using the full facilities of the language, then the answer is clearly no - indentation is not optional. You

Re: Efficient checksum calculating on lagre files

2005-02-08 Thread Michael Hoffman
Ola Natvig wrote: Does anyone know of a fast way to calculate checksums for a large file. I need a way to generate ETag keys for a webserver, the ETag of large files are not realy nececary, but it would be nice if I could do it. I'm using the python hash function on the dynamic generated strings

Re: Efficient checksum calculating on lagre files

2005-02-08 Thread Michael Hoffman
Michael Hoffman wrote: Is there a reason you can't use the sha module? BTW, I'm using SHA-1 instead of MD5 because of the reported vulnerabilities in MD5, which may not be important for your application, but I consider it best to just avoid MD5 entirely in the future. -- Michael Hoffman -- http://m

Re: iterators instead of callbacks.

2005-02-08 Thread Michael Hoffman
Antoon Pardon wrote: I'm thinking about the FTP-lib now where iterator equivallents of > retrbinary and retrlines methods may be more easily usable then the > current versions with a callback. So I was wondering, are such transformations in the pipeline somewhere? Maybe that should be a Python 3.0

Effbot's SimpleXMLWriter fails when py2exe'd

2005-02-08 Thread Erik Bethke
Hello All, So I have been using Effbot's XML stuff a lot! And I have been using py2exe, pygame and wxPython all mixed together... I am getting this strange error log when writing XML files with his XML writer. It appears to be fouling up on the encoding, ONLY in the exe version. Runs fine and

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

2005-02-08 Thread John M. Gabriele
Aahz wrote: [snip] Anyway. Have you ever noticed how shell scripts keep getting longer? Yup. Ever notice how it gets harder to figure out what the heck any given script's doing? Yup. Well, that's where Python helps you out compared to Perl. Python can be a bit clumsier than Perl for dirt-simple

Re: Efficient checksum calculating on lagre files

2005-02-08 Thread TZOTZIOY
On Tue, 08 Feb 2005 16:13:43 +, rumours say that Robin Becker <[EMAIL PROTECTED]> might have written: >Ola Natvig wrote: >> Hi all >> >> Does anyone know of a fast way to calculate checksums for a large file. >> I need a way to generate ETag keys for a webserver, the ETag of large >> files

Re: python code with indention

2005-02-08 Thread Bernhard Herzog
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. It's possible to implement a turing machine with a single list comprehension. No indentation

Re: Effbot's SimpleXMLWriter fails when py2exe'd

2005-02-08 Thread Simon Brunning
On Tue, 08 Feb 2005 08:35:51 -0800 (PST), Erik Bethke <[EMAIL PROTECTED]> wrote: > I am getting this strange error log when writing XML files with his XML > writer. It appears to be fouling up on the encoding, ONLY in the exe > version. Runs fine and great as a python script.

graph visualisation

2005-02-08 Thread Alexander Zatvornitskiy
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 Nijmegen. For static BNs, call it as follows:

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

2005-02-08 Thread John M. Gabriele
Nick Vargish wrote: "John M. Gabriele" <[EMAIL PROTECTED]> writes: At some point during some dingy job in the back boiler room of Unix, would you find yourself saying, "geez, I'd wish I started this with Perl -- Python just isn't cutting it." ? Sometimes I have to write a quick script in Perl bec

Re: Effbot's SimpleXMLWriter fails when py2exe'd

2005-02-08 Thread Fredrik Lundh
Erik Bethke wrote: > So I have been using Effbot's XML stuff a lot! And I have been using > py2exe, pygame and wxPython all mixed together... > > I am getting this strange error log when writing XML files with his XML > writer. It appears to be fouling up on the encoding, ONLY in the exe > versi

Re: Efficient checksum calculating on lagre files

2005-02-08 Thread Fredrik Lundh
Robin Becker wrote: >> Does anyone know of a fast way to calculate checksums for a large file. I >> need a way to generate >> ETag keys for a webserver, the ETag of large files are not realy nececary, >> but it would be nice >> if I could do it. I'm using the python hash function on the dynami

broke tkinter

2005-02-08 Thread Philippe C. Martin
Hi, I decided to clean my system and rebuild python from scratch. I downloaded tk8.4.9, tcl8.4.9 and Python2-4.tar.bz2. I installed tcl then tk using './configure --prefix=/usr' tkcvs is now working OK trying to compile python (configure = './configure --prefix=/usr', I get this: In file in

pass named parameters to python

2005-02-08 Thread John Leslie
I am converting a korn shell script to python and want to be able to pass named arguments into python e.g -firstparam -secondparam Can this be done? -- http://mail.python.org/mailman/listinfo/python-list

Re: graph visualisation

2005-02-08 Thread P
Alexander Zatvornitskiy wrote: Hello, All! I need routines for visualization of graphs, like this for Matlab: You could output the dot language, parsed by graphviz See: http://dkbza.org/pydot.html PÃdraig. -- http://mail.python.org/mailman/listinfo/python-list

Re: pass named parameters to python

2005-02-08 Thread Duncan Booth
John Leslie wrote: > I am converting a korn shell script to python and want to be able to > pass named arguments into python e.g -firstparam -secondparam > > Can this be done? > See the module 'optparse'. http://www.python.org/doc/current/lib/module-optparse.html -- http://mail.python.org/mail

Re: variable declaration

2005-02-08 Thread Brian van den Broek
Brian van den Broek said unto the world upon 2005-02-07 20:36: Steve Holden said unto the world upon 2005-02-07 17:51: The reason global is a wart can clearly be seen in the following example: >>> x = 3 >>> def f(tf, v): ... if tf: ... global x ... x = v ... >>> f(0, 5) >>> x 5 >>

Python mail filter

2005-02-08 Thread Mailer
Hello, all, Well, I need to write a mail filter in Python. The filter will be used in shared web hosting environment, so the control over MTA configuration etc is limited. The basic premise, as I understand is this: Read mail from stdin Parse headers etc using rfc822 or email module Process # N

Re: variable declaration

2005-02-08 Thread top
Alex Martelli wrote: [snip] > I disagree: compile time is when the compiler is running (for example, > the compiler is the component which diagnoses syntax errors, while other > errors are diagnosed ``at runtime''). [snip] That thing about syntax errors is news to me. I thought they were caught at

Re: variable declaration

2005-02-08 Thread Fredrik Lundh
"top" <[EMAIL PROTECTED]> wrote: > That thing about syntax errors is news to me. I thought they were > caught at runtime, since you can catch them as exceptions, as in: > > try: prijnt projnt > except SyntaxError: print "See, it gets caught" > > If this happens at compile-time, I'd like to know ho

Re: Efficient checksum calculating on lagre files

2005-02-08 Thread Nick Craig-Wood
Ola Natvig <[EMAIL PROTECTED]> wrote: > Hi all > > Does anyone know of a fast way to calculate checksums for a large file. > I need a way to generate ETag keys for a webserver, the ETag of large > files are not realy nececary, but it would be nice if I could do it. I'm > using the python h

Re: variable declaration

2005-02-08 Thread Alex Martelli
top <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > [snip] > > I disagree: compile time is when the compiler is running (for > example, > > the compiler is the component which diagnoses syntax errors, while > other > > errors are diagnosed ``at runtime''). > [snip] > > That thing about syntax

turing machine in an LC (was: Xah Lee's stupid question #853,172)

2005-02-08 Thread Jeremy Bowers
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. > > It's possible to impl

Re: Building Python with Tcl/Tk on Cygwin_NT-5.1

2005-02-08 Thread Jason Tishler
Dean, On Tue, Feb 08, 2005 at 08:01:11AM -0800, Dean N. Williams wrote: > $ rebaseall > /usr/bin/rebaseall: line 70: [: too many arguments > /usr/bin/rebaseall: line 75: [: too many arguments > /usr/bin/rebaseall: line 94: $TmpFile: ambiguous redirect > cannot read /cygdrive/c/Documents > > On my

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

2005-02-08 Thread Jeff Epler
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 second 1, giving

Re: broke tkinter

2005-02-08 Thread wes weston
Philippe C. Martin wrote: Hi, I decided to clean my system and rebuild python from scratch. I downloaded tk8.4.9, tcl8.4.9 and Python2-4.tar.bz2. I installed tcl then tk using './configure --prefix=/usr' tkcvs is now working OK trying to compile python (configure = './configure --prefix=/usr', I ge

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

2005-02-08 Thread Colin J. Williams
Brian van den Broek wrote: Daniel Bickett said unto the world upon 2005-02-05 19:46: I was reading the "Pickling and inheritance are making me hurt" thread, and the latest suggestion (as of this posting) was to do with the __setstate__ and __getstate__ methods. They caught my attention because I ha

Re: Efficient checksum calculating on lagre files

2005-02-08 Thread Thomas Heller
Nick Craig-Wood <[EMAIL PROTECTED]> writes: > Ola Natvig <[EMAIL PROTECTED]> wrote: >> Hi all >> >> Does anyone know of a fast way to calculate checksums for a large file. >> I need a way to generate ETag keys for a webserver, the ETag of large >> files are not realy nececary, but it would

Re: broke tkinter

2005-02-08 Thread Philippe C. Martin
I'll check, thanks. Philippe On Tue, 08 Feb 2005 18:03:11 +, wes weston wrote: > Philippe C. Martin wrote: >> Hi, >> >> I decided to clean my system and rebuild python from scratch. >> >> I downloaded tk8.4.9, tcl8.4.9 and Python2-4.tar.bz2. >> >> I installed tcl then tk using './config

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

2005-02-08 Thread Marc Huffnagle
Jeff Epler wrote: There's another little-known fact about Python: No string is permitted to end with a backslash! You might think that variations like r'\' or ""\"" would allow you to create this elusive value, but you'd mistaken! Now, this may not bother Unix sysadmins, but t

Re: ANN: Zeus Programmers Editor V3.94

2005-02-08 Thread John Machin
Gabriel Cooper wrote: > Jussi Jumppanen wrote: > > >The latest release of the Zeus for Windows programmer's > >editor is now available. > > > So is this mentioned here on the Python mailing list because Zeus was > written in Python, or is this just targeted spam for a commerical product? Targete

Re: turing machine in an LC

2005-02-08 Thread Michael Spencer
Jeremy Bowers wrote: I can't figure out how to write a TM in a Python List Comprehension without one of either "variable binding" (so we can store the last symbol list and manipulate it in the next iteration) or "recursive function" (to express the whole tape as a recursive function), both of whic

Re: Python versus Perl ?

2005-02-08 Thread m
Courageous 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/ -- http://mail.python.org/mailman/listinfo/python-list

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

2005-02-08 Thread Jeremy Bowers
On Tue, 08 Feb 2005 18:18:13 +, Marc Huffnagle wrote: > Jeff Epler wrote: >> >> There's another little-known fact about Python: No string is permitted >> to end with a backslash! You might think that variations like >> r'\' >> or >> ""\"" >> would allow you to create thi

Re: Effbot's SimpleXMLWriter fails when py2exe'd

2005-02-08 Thread Erik Bethke
Awesome! Great thank you both, fixed! -Erik -- http://mail.python.org/mailman/listinfo/python-list

Re: Big development in the GUI realm

2005-02-08 Thread Maciej Mróz
Grant Edwards wrote: My understanding is that what you propose is not valid. An EXE that uses a GPL'd DLL must be distributed according to the terms of the GPL. Were that not the case, the LGPL would not have been needed. I believe this is the case only in simple situation where gpl-ed dll is _r

Re: Efficient checksum calculating on lagre files

2005-02-08 Thread TZOTZIOY
On Tue, 8 Feb 2005 17:26:07 +0100, rumours say that "Fredrik Lundh" <[EMAIL PROTECTED]> might have written: >on my machine, Python's md5+mmap is a little bit faster than >subprocess+md5sum: > >import os, md5, mmap > >file = open(fn, "r+") [snip] My first reaction was that "r+" should be "

Re: turing machine in an LC

2005-02-08 Thread Michael Spencer
Jeremy Bowers wrote: On Tue, 08 Feb 2005 17:36:19 +0100, Bernhard Herzog wrote: Now you *can* get at the previous state and write a state-transition expression in perfectly legal Python. What do you know, generator comprehensions are Turing Complete and list comprehensions aren't. I wouldn't have

Re: turing machine in an LC

2005-02-08 Thread Jeremy Bowers
On Tue, 08 Feb 2005 10:24:28 -0800, Michael Spencer wrote: > How about: > > >>> def fact_ge(n): > ... f = [1] > ... f.extend(i*j for i,j in it.izip(xrange(1,1+n), f)) > ... return f > ... > >>> fact_ge(10) > [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800] > >>> > > as a "

Re: Python versus Perl ?

2005-02-08 Thread Fredrik Lundh
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 you use Python mostly to write emp

Re: Python mail filter

2005-02-08 Thread Kartic
Mika, Somebody else had a similar situation of having a script receive the email and process it. http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/1f26452835e51c71/e4d6c1efc9a71e39?q=&_done=%2Fgroups%3Fq%3D%26start%3D10%26enc_author%3DVUzGiykAAAD-rgSwZjnUEp_UDWM1Zk6AXwyJTP

Re: turing machine in an LC

2005-02-08 Thread Jeremy Bowers
On Tue, 08 Feb 2005 10:50:24 -0800, Michael Spencer wrote: > I see no difference between LCs and GEs in this respect: > > >>> import itertools as it > >>> > >>> def fact_ge(n): > ... f = [1] > ... f.extend(i*j for i,j in it.izip(xrange(1,1+n), f)) > ... return f > ... >

Re: Big development in the GUI realm

2005-02-08 Thread Jeremy Bowers
On Tue, 08 Feb 2005 19:55:01 +0100, Maciej MrÃz wrote: > Unfortunately, GPL faq is extremely vague on such border cases, instead > of simple "yes/no" answers faq is filled with some advocacy talks ... To re-iterate a point I made on a thread last week, nobody really knows what the GPL says and me

Re: turing machine in an LC

2005-02-08 Thread Michael Spencer
Jeremy Bowers wrote: That's not a generator expression, that's a generator function. Nobody contests they can reference earlier states, that's most of their point :-) Are you sure? I just wrote my examples in functions to label them Here's your example with this method: >>> import itertools as it

Re: Python mail filter

2005-02-08 Thread Kartic
I just read your requirement of a pass through... Writing the email back into sys.stdout from your script might do the trick of passing it through to the original intended recipient. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python versus Perl ?

2005-02-08 Thread m
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 was trying t

Re: Loop in list.

2005-02-08 Thread Jim
Thanks for the help. Python is somewhat ïmysterious to an old fortan programer. Jim -- http://mail.python.org/mailman/listinfo/python-list

Re: Big development in the GUI realm

2005-02-08 Thread Damjan
> 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 compatible), plugin

Re: Loop in list.

2005-02-08 Thread Jim
Particularly one who can't spell. Fortran. Jim -- http://mail.python.org/mailman/listinfo/python-list

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

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

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

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

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

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

<    1   2   3   >