Weekly Python Patch/Bug Summary

2007-02-21 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 408 open ( -9) / 3585 closed (+20) / 3993 total (+11) Bugs: 968 open ( +8) / 6505 closed ( +7) / 7473 total (+15) RFE : 267 open ( +1) / 251 closed ( +0) / 518 total ( +1) New / Reopened Patches __ Handle re

Re: Convert to binary and convert back to strings

2007-02-21 Thread Hendrik van Rooyen
"Harlin Seritt" <[EMAIL PROTECTED]> wrote: > Hi... > > I would like to take a string like 'supercalifragilisticexpialidocius' > and write it to a file in binary forms -- this way a user cannot read > the string in case they were try to open in something like ascii text > editor. I'd also like t

Re: Question about classes and possible closure.

2007-02-21 Thread James Stroud
James Stroud wrote: > Steven W. Orr wrote: > >> This is all an intro learning experience for me, so please feel free >> to explain why what I'm trying to do is not a good idea. >> >> In the Cookbook, they have a recipe for how to create global constants. >> >> - >> class _const: >

Re: Pep 3105: the end of print?

2007-02-21 Thread Peter Mayne
Steven D'Aprano wrote: > On Tue, 20 Feb 2007 00:44:24 +, Peter mayne wrote: > >> Steven D'Aprano wrote: >>> If Python 3 dropped the print >>> statement and replaced it with official_print_function(), how would that >>> help you in your goal to have a single code base that will run on both >>>

Re: Question about classes and possible closure.

2007-02-21 Thread James Stroud
Steven W. Orr wrote: > This is all an intro learning experience for me, so please feel free to > explain why what I'm trying to do is not a good idea. > > In the Cookbook, they have a recipe for how to create global constants. > > - > class _const: > class ConstError(TypeErro

Re: Looking for contract developer(s) - where can I find them?

2007-02-21 Thread rscottco
On Feb 21, 9:51 pm, Scott SA <[EMAIL PROTECTED]> wrote: > > I've just sent a job listing to python.org and posted this message on > comp.lang.python, Interesting, so Python-list@python.org and comp.lang.python are _related_. I guess that means I'm the new guy on the block. Well I guess this joke i

Looking for contract developer(s) - where can I find them?

2007-02-21 Thread Scott SA
Hi, I've just sent a job listing to python.org and posted this message on comp.lang.python, but am also trying to proactively find python developers through other means. python.org and guru.com notwithstanding, most job-sites to seem only support people/organizations looking for full/part-time e

Looking for contract developer(s) - where can I find them?

2007-02-21 Thread rscottco
Hi, I've just sent a job listing to python.org, but am also trying to proactively find python developers through other means. python.org and guru.com notwithstanding, most job-sites to seem only support people/organizations looking for full/part-time employment or with full-time/part-time positio

Re: Convert to binary and convert back to strings

2007-02-21 Thread Ganesan Rajagopal
> Grant Edwards <[EMAIL PROTECTED]> writes: >> print base64.decodestring(open('sambleb.conf', 'r').read()) > It'll only remain obfuscated for about 30 seconds after even a > mildly curious user looks at the file. It depends on the requirement. If the intention is to just to discourage someon

Re: Convert to binary and convert back to strings

2007-02-21 Thread Grant Edwards
On 2007-02-22, Ganesan Rajagopal <[EMAIL PROTECTED]> wrote: >> I am hoping to have it show up some weird un-readable text. >> And then of course be able to convert it right back to a >> string. Is this even possible? > > Looks like you just want to obfuscate the string. How about > this? > > impor

Re: Convert to binary and convert back to strings

2007-02-21 Thread Ganesan Rajagopal
> "Harlin" == Harlin Seritt <[EMAIL PROTECTED]> writes: > I tried doing this: > text = 'supercalifragilisticexpialidocius' > open('sambleb.conf', 'wb').write(text) > Afterwards, I was able to successfully open the file with a text > editor and it showed: > 'supercalifragilisticexpialidocius

Re: getting a thread out of sleep

2007-02-21 Thread Steve Holden
placid wrote: > On Feb 22, 12:08 pm, mark <[EMAIL PROTECTED]> wrote: >> On 21 Feb 2007 16:10:51 -0800, placid <[EMAIL PROTECTED]> wrote: >> >>> On Feb 22, 10:20 am, mark <[EMAIL PROTECTED]> wrote: On 21 Feb 2007 14:47:50 -0800, placid <[EMAIL PROTECTED]> wrote: > On Feb 22, 3:23 am, mark <

Re: getting a thread out of sleep

2007-02-21 Thread placid
On Feb 22, 12:08 pm, mark <[EMAIL PROTECTED]> wrote: > On 21 Feb 2007 16:10:51 -0800, placid <[EMAIL PROTECTED]> wrote: > > > On Feb 22, 10:20 am, mark <[EMAIL PROTECTED]> wrote: > > > On 21 Feb 2007 14:47:50 -0800, placid <[EMAIL PROTECTED]> wrote: > > > > > On Feb 22, 3:23 am, mark <[EMAIL PROTEC

Re: Bug in time module - %z works in perl, not in python?

2007-02-21 Thread attn . steven . kuo
On Feb 21, 6:17 pm, [EMAIL PROTECTED] wrote: > Following python code prints out incorrect UTC Offset - the python > docs say that %z is not fully supported on all platforms - but on > Linux Fedora FC5, perl code works and python does not - is this a bug > or is this expected behavior? For a EST tim

Re: guess file type in python

2007-02-21 Thread GiBo
mark wrote: > Is there any way to guess the file type using python? > thanks > mark > > For example in unix: > > file code.py > code.py: a python script text executable > > file Eccentric.gif > Eccentric.gif: GIF image data, version 89a, 237 x 277 "file" tool uses libmagic.so library which in t

Re: Convert to binary and convert back to strings

2007-02-21 Thread Grant Edwards
On 2007-02-22, Harlin Seritt <[EMAIL PROTECTED]> wrote: >> Try opening your file in the 'wb' mode. > I tried doing this: > > text = 'supercalifragilisticexpialidocius' > > open('sambleb.conf', 'wb').write(text) > > Afterwards, I was able to successfully open the file with a text > editor and it s

Bug in time module - %z works in perl, not in python?

2007-02-21 Thread bwooster47
Following python code prints out incorrect UTC Offset - the python docs say that %z is not fully supported on all platforms - but on Linux Fedora FC5, perl code works and python does not - is this a bug or is this expected behavior? For a EST timezone setup, Perl prints correct -0500, while Python

Re: Which Crypto Library?

2007-02-21 Thread James Stroud
GiBo wrote: > Hi > > I need some encryption done in my Python 2.5 application. I wonder > what's the most recommended library? I've found M2crypto and some > OpenSSL wrappers and Python Cryptography Toolkit and some others. No > surprise I'm confused :-) > > What's the most often used library for

guess file type in python

2007-02-21 Thread mark
Is there any way to guess the file type using python? thanks mark For example in unix: file code.py code.py: a python script text executable file Eccentric.gif Eccentric.gif: GIF image data, version 89a, 237 x 277 -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert to binary and convert back to strings

2007-02-21 Thread [EMAIL PROTECTED]
On Feb 21, 5:50 pm, "Harlin Seritt" <[EMAIL PROTECTED]> wrote: > Hi... > > I would like to take a string like 'supercalifragilisticexpialidocius' > and write it to a file in binary forms -- this way a user cannot read > the string in case they were try to open in something like ascii text > editor.

Re: getting a thread out of sleep

2007-02-21 Thread mark
On 21 Feb 2007 16:10:51 -0800, placid <[EMAIL PROTECTED]> wrote: > On Feb 22, 10:20 am, mark <[EMAIL PROTECTED]> wrote: > > On 21 Feb 2007 14:47:50 -0800, placid <[EMAIL PROTECTED]> wrote: > > > > > > > > > On Feb 22, 3:23 am, mark <[EMAIL PROTECTED]> wrote: > > > > On 20 Feb 2007 21:26:18 -0800, p

Re: jython import search path

2007-02-21 Thread Russ
On Feb 21, 4:15 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > Russ wrote: > > I have a Python program that I want to run in Jython so I can get Java > > bytecode output. The program runs fine in Python, but when I change > > the first line of the main program to make it run in Jython, it fails > > t

Re: Convert to binary and convert back to strings

2007-02-21 Thread Harlin Seritt
On Feb 21, 7:12 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > Harlin Seritt wrote: > > Hi... > > > I would like to take a string like 'supercalifragilisticexpialidocius' > > and write it to a file in binary forms -- this way a user cannot read > > the string in case they were try to open in somethin

Which Crypto Library?

2007-02-21 Thread GiBo
Hi I need some encryption done in my Python 2.5 application. I wonder what's the most recommended library? I've found M2crypto and some OpenSSL wrappers and Python Cryptography Toolkit and some others. No surprise I'm confused :-) What's the most often used library for crypto? For now I need a s

Re: Convert to binary and convert back to strings

2007-02-21 Thread Harlin Seritt
On Feb 21, 7:02 pm, "Colin J. Williams" <[EMAIL PROTECTED]> wrote: > Harlin Seritt wrote: > > Hi... > > > I would like to take a string like 'supercalifragilisticexpialidocius' > > and write it to a file in binary forms -- this way a user cannot read > > the string in case they were try to open in

Re: jython import search path

2007-02-21 Thread Larry Bates
Russ wrote: > I have a Python program that I want to run in Jython so I can get Java > bytecode output. The program runs fine in Python, but when I change > the first line of the main program to make it run in Jython, it fails > to find some of the imported modules. These are just plain Python > im

Re: Convert to binary and convert back to strings

2007-02-21 Thread Larry Bates
Harlin Seritt wrote: > Hi... > > I would like to take a string like 'supercalifragilisticexpialidocius' > and write it to a file in binary forms -- this way a user cannot read > the string in case they were try to open in something like ascii text > editor. I'd also like to be able to read the bin

Re: Convert to binary and convert back to strings

2007-02-21 Thread Grant Edwards
On 2007-02-21, Harlin Seritt <[EMAIL PROTECTED]> wrote: > I would like to take a string like > 'supercalifragilisticexpialidocius' and write it to a file in > binary forms -- this way a user cannot read the string in case > they were try to open in something like ascii text editor. Why wouldn't t

Re: getting a thread out of sleep

2007-02-21 Thread placid
On Feb 22, 10:20 am, mark <[EMAIL PROTECTED]> wrote: > On 21 Feb 2007 14:47:50 -0800, placid <[EMAIL PROTECTED]> wrote: > > > > > On Feb 22, 3:23 am, mark <[EMAIL PROTECTED]> wrote: > > > On 20 Feb 2007 21:26:18 -0800, placid <[EMAIL PROTECTED]> wrote: > > > > > On Feb 21, 4:21 pm, "placid" <[EMAIL

jython import search path

2007-02-21 Thread Russ
I have a Python program that I want to run in Jython so I can get Java bytecode output. The program runs fine in Python, but when I change the first line of the main program to make it run in Jython, it fails to find some of the imported modules. These are just plain Python imports of code I wrote

Re: Convert to binary and convert back to strings

2007-02-21 Thread Colin J. Williams
Harlin Seritt wrote: > Hi... > > I would like to take a string like 'supercalifragilisticexpialidocius' > and write it to a file in binary forms -- this way a user cannot read > the string in case they were try to open in something like ascii text > editor. I'd also like to be able to read the bin

Convert to binary and convert back to strings

2007-02-21 Thread Harlin Seritt
Hi... I would like to take a string like 'supercalifragilisticexpialidocius' and write it to a file in binary forms -- this way a user cannot read the string in case they were try to open in something like ascii text editor. I'd also like to be able to read the binary formed data back into string

Re: network simulator in Python ?

2007-02-21 Thread [EMAIL PROTECTED]
On Feb 21, 12:26 pm, "DanielJohnson" <[EMAIL PROTECTED]> wrote: > I was wondering if anyblody can suggest me a network simulator written > in python in which I can add on my own code and extend its > functionality. > > I am looking for a simulator which will simualte TCP, UDP, RTP and > most networ

Re: Question about classes and possible closure.

2007-02-21 Thread Dustan
On Feb 21, 4:30 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > This is all an intro learning experience for me, so please feel free to > explain why what I'm trying to do is not a good idea. > > In the Cookbook, they have a recipe for how to create global constants. > > - > class

RE: f---ing typechecking

2007-02-21 Thread Delaney, Timothy (Tim)
Nick Craig-Wood wrote: > Which appears to support my point, x (and a for that matter) are the > same for both methods wheter you do x = x + a or x += a. > > The mechanism is different certainly, but the result should be the > same otherwise you are breaking the basic rules of arithmetic the > prog

Re: getting a thread out of sleep

2007-02-21 Thread mark
On 21 Feb 2007 14:47:50 -0800, placid <[EMAIL PROTECTED]> wrote: > On Feb 22, 3:23 am, mark <[EMAIL PROTECTED]> wrote: > > On 20 Feb 2007 21:26:18 -0800, placid <[EMAIL PROTECTED]> wrote: > > > > > > > > > On Feb 21, 4:21 pm, "placid" <[EMAIL PROTECTED]> wrote: > > > > On Feb 21, 4:12 pm, mark <[EM

Re: pexpect regex help

2007-02-21 Thread jonathan . sabo
On Feb 21, 6:13 pm, [EMAIL PROTECTED] wrote: > I have a pexpect script to walk through a cisco terminal server and I > was hoping to get some help with this regex because I really suck at > it. > > This is the code: > > index = s.expect(['login: ', pexpect.EOF, pexpect.TIMEOUT]) > i

pexpect regex help

2007-02-21 Thread jonathan . sabo
I have a pexpect script to walk through a cisco terminal server and I was hoping to get some help with this regex because I really suck at it. This is the code: index = s.expect(['login: ', pexpect.EOF, pexpect.TIMEOUT]) if index == 0: m = re.search('((#.+\r\n){20,25})

ANN: IbPy 0.7.0-9.00 - Interactive Brokers Python API

2007-02-21 Thread Troy Melhase
IbPy - Interactive Brokers Python API = IbPy 0.7.0-9.00 Released 21 Feb 2007 What is IbPy? -- IbPy is a third-party implementation of the API used for accessing the Interactive Brokers

Re: Creating a daemon process in Python

2007-02-21 Thread garrickp
On Feb 21, 3:34 pm, Benjamin Niemann <[EMAIL PROTECTED]> wrote: > That's not a daemon process (which are used to execute 'background services' > in UNIX environments). I had not tested this by running the script directly, and in writing a response, I found out that the entire interpreter closed wh

Re: CherryPy/Turbogears on server not controlled by me

2007-02-21 Thread Jorge Vargas
On 2/20/07, Brian Blais <[EMAIL PROTECTED]> wrote: > Hello, > > I was wondering if there is a way to run CherryPy/Turbogears on a server that > I don't > have root access to. I have never run ANY webapp as root. you should follow that advice. in fact don't run any server as root. > If I just cho

Re: getting a thread out of sleep

2007-02-21 Thread placid
On Feb 22, 3:23 am, mark <[EMAIL PROTECTED]> wrote: > On 20 Feb 2007 21:26:18 -0800, placid <[EMAIL PROTECTED]> wrote: > > > > > On Feb 21, 4:21 pm, "placid" <[EMAIL PROTECTED]> wrote: > > > On Feb 21, 4:12 pm, mark <[EMAIL PROTECTED]> wrote: > > > > On 20 Feb 2007 20:47:57 -0800, placid <[EMAIL PR

Re: BDFL in wikipedia

2007-02-21 Thread Jorge Vargas
On 2/21/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Wed, 21 Feb 2007 05:28:30 -0300, Andrew McNamara > <[EMAIL PROTECTED]> escribió: > > >> Hi I just hit this page in wikipedia BDFL[1] > >> and it redirected me to Guido's wikipedia[2] entry > >> [1] http://en.wikipedia.org/wiki/BDFL > > >

Re: BDFL in wikipedia

2007-02-21 Thread Jorge Vargas
On 2/21/07, Toby A Inkster <[EMAIL PROTECTED]> wrote: > Jorge Vargas wrote: > > > shouldn't it mention Linus, Larry Wall, others?[3] > > Despite the link you posted, I don't think Linus, Larry Wall, Rasmus > Lerdorf, etc describe themselves as BDFLs, even if they fulfil similar > roles within their

Re: BDFL in wikipedia

2007-02-21 Thread Jorge Vargas
On 2/21/07, Andrew McNamara <[EMAIL PROTECTED]> wrote: > >Hi I just hit this page in wikipedia BDFL[1] > > > >and it redirected me to Guido's wikipedia[2] entry > >now without causing any troubles (read flamewar) shouldn't > > > >a) that page have an explanation of what BDFL is > >b) shouldn't it m

Re: Creating a daemon process in Python

2007-02-21 Thread Benjamin Niemann
[EMAIL PROTECTED] wrote: > On Feb 21, 9:33 am, Eirikur Hallgrimsson <[EMAIL PROTECTED]> > wrote: >> Sakagami Hiroki wrote: >> > What is the easiest way to create a daemon process in Python? > > I've found it even easier to use the built in threading modules: > > import time > > t1 = time.time()

Question about classes and possible closure.

2007-02-21 Thread Steven W. Orr
This is all an intro learning experience for me, so please feel free to explain why what I'm trying to do is not a good idea. In the Cookbook, they have a recipe for how to create global constants. - class _const: class ConstError(TypeError): pass def __setattr__(self,n

Re: Python 3.0 unfit for serious work?

2007-02-21 Thread [EMAIL PROTECTED]
On Feb 21, 1:44 pm, [EMAIL PROTECTED] (Aahz) wrote: > > Note that I believe it will be many years, perhaps even a decade, before > "python" on a Unix system starts up Python 3.0. That's a pretty safe bet considering that the factory-installed "python" on my Linux system is still 1.x and you run "p

Re: Creating a daemon process in Python

2007-02-21 Thread garrickp
On Feb 21, 9:33 am, Eirikur Hallgrimsson <[EMAIL PROTECTED]> wrote: > Sakagami Hiroki wrote: > > What is the easiest way to create a daemon process in Python? I've found it even easier to use the built in threading modules: import time t1 = time.time() print "t_poc.py called at", t1 import thre

[Ann] PyGooCanvas 0.6.0

2007-02-21 Thread Gian Mario Tagliaretti
I am pleased to announce version 0.6.0 of the Python bindings for Goocanvas. It is available at: https://developer.berlios.de/projects/pygoocanvas/ The bindings are updated with the new Goocanvas API PyGooCanvas 0.6.0 (Feb 19 2007) = o Rename and implement latest API cha

FloatCanvas in a wxpython application.... layout problems

2007-02-21 Thread nelson -
Hi all, i'm developing an application that uses Floatcanvas to diplay a cartesian plane. how can i embed it into a "complex" layout? I have this controls MENUS TOOLBAR NOTEBOOK FLOATCANVAS PYSHELL The problem is that i can show all the components but i can't insert the floatcanvas in the right

Re: wxPython: non-GUI thread launching new frame? Delegates?

2007-02-21 Thread cyberco
Oh boyI must have hit an all time programmers-low with this That was plain stupid. 2B > You don't need the lambda - you can use: > > wx.CallAfter(parent.OnRequest, param) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0 unfit for serious work?

2007-02-21 Thread Jay Tee
On Feb 21, 8:06 pm, [EMAIL PROTECTED] wrote: > I don't know the specifics of your app, but why does everyone insist > that they need to use the 'system' python? Hey Grant, don't worry it's not a rant. A completely valid question. Again it's a problem of dependency management ... one of the thing

Debug Build of Python

2007-02-21 Thread Mark E. Fenner
Hi all, Just curious how to get an "all bells and whistles" debug build of python. In the source for 2.4.3, I see the following debug related options: >From README: (1) e.g. "make OPT=-g" will build a debugging version of Python on most platforms (2) Additional debugging code to help debug memo

Re: PLY for standard library

2007-02-21 Thread Paul McGuire
On Feb 21, 7:02 am, "Jakub Stolarski" <[EMAIL PROTECTED]> wrote: > On 20 Lut, 19:29, "Alan Isaac" <[EMAIL PROTECTED]> wrote:> If not, what > module providing substantially similar functionality is? > > AFAIK there's no parser generator module in standard library. > > I would like to see PLY in sta

Re: eval('000052') = 42?

2007-02-21 Thread Roger Miller
On Feb 20, 7:37 pm, "John Machin" <[EMAIL PROTECTED]> wrote: > On Feb 21, 3:09 pm, Astan Chee <[EMAIL PROTECTED]> wrote: > > > Hi, > > I just tried to do > > eval('00052') and it returned 42. > > Is this a known bug in the eval function? Or have I missed the way eval > > function works? > > Thanks

Re: Regex Speed

2007-02-21 Thread Kirk Sluder
In article <[EMAIL PROTECTED]>, "John Machin" <[EMAIL PROTECTED]> wrote: > Getting back to the "It would be nice ..." bit: yes, it would be nice > to have even more smarts in re, but who's going to do it? It's not a > "rainy Sunday afternoon" job :-) Well, just as an idea, there is a portable C

Re: builtin set literal

2007-02-21 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Steven Bethard: >> take a look at the current state of tuples: >>1, 2 >>1, >>() > > That's not a good situation. I presume the situation/syntax of tuples > in Python 2.x can't be improved. But can it be improved for Py 3.0? I'm not really losing any sleep ov

Re: builtin set literal

2007-02-21 Thread bearophileHUGS
Steven Bethard: > take a look at the current state of tuples: >1, 2 >1, >() That's not a good situation. I presume the situation/syntax of tuples in Python 2.x can't be improved. But can it be improved for Py 3.0? Notes: - I think in Matlab a single element is seen as the same thing as

Re: Python 3.0 unfit for serious work?

2007-02-21 Thread olsongt
On Feb 20, 9:04 pm, "Jeff Templon" <[EMAIL PROTECTED]> wrote: > yo, > > Bjorn, I am not sure I see why my post is bull crap. I think all you > are doing is agreeing with me. My post was entitled "Python 3.0 unfit > for serious work", you just indicated that the Linux distros will > agree with me,

Re: Python 3.0 unfit for serious work?

2007-02-21 Thread Aahz
In article <[EMAIL PROTECTED]>, Jay Tee <[EMAIL PROTECTED]> wrote: > >If backwards compatibility is not a consideration, then it would be a >miracle if there were no problems. Backwards compatibility is a consideration AND there will be problems. That is, the goal of 3.0 is to lower the priority o

Re: Performance project for the SigEx Foundry

2007-02-21 Thread bearophileHUGS
Pablo: > I am looking for articles/studies/benchmarks on the subject. It's not easy to test that, you need to be equally expert on all the languages to test them. This may be a starting point for you: http://shootout.alioth.debian.org/ Bye, bearophile -- http://mail.python.org/mailman/listinfo/

datetime - easy way to make it use local timezone?

2007-02-21 Thread bwooster47
Is there an easy way to have an automatically constructed local time zone tzinfo object be used with datetime? Following code shows the problem - the time module works fine mostly (%Z works, but %z does not, but that may be the way it is), uses # The following python code outputs: note the time()

Converting a text data file from positional to tab delimited.

2007-02-21 Thread Zeljko Sikic
Hi, You should try www.TextMaster.ca and download SW which can convert text file from fix positioned to TAB delimited or any other text format. Regards, Jake -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading compressed files

2007-02-21 Thread Jordan
On Feb 21, 5:21 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Shadab Sayani wrote: > > Hi, > > I have compressed files compressed using different techniques > > (especially unix compress). So I want to have a module that reads any of > > these (.Z,.bz,.tgz files) files and manipulates the data. > >

Re: Weird result returned from adding floats depending on order I add them

2007-02-21 Thread Miki
Hello Joanne, > ... [float problem] ... > I get True returned. Can anyone tell me whats going on and how I can > avoid the problem. Thanks If you want to be truly accurate, you can use gmpy.mpq (http:// gmpy.sourceforge.net/). >>> a = [0.2, 0.2, 0.2, 0.1, 0.2, 0.1] >>> b = [0.2, 0.2, 0.2, 0.2, 0.

Re: Regex Speed

2007-02-21 Thread garrickp
On Feb 20, 6:14 pm, Pop User <[EMAIL PROTECTED]> wrote: > Its very hard to beat grep depending on the nature of the regex you are > searching using. The regex engines in python/perl/php/ruby have traded > the speed of grep/awk for the ability to do more complex searches. > > http://swtch.com/~rsc/

Re: f---ing typechecking

2007-02-21 Thread Nick Craig-Wood
Delaney, Timothy (Tim) <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood wrote: > > > x += a > > > > does not equal > > > > x = x + a > > > > which it really should for all types of x and a > > Actually, this will *never* be the case for classes that do in-place > augmented assignment. >

network simulator in Python ?

2007-02-21 Thread DanielJohnson
I was wondering if anyblody can suggest me a network simulator written in python in which I can add on my own code and extend its functionality. I am looking for a simulator which will simualte TCP, UDP, RTP and most networking protocol. The learning curve for ns2 and other simulator is too high f

Re: Regex Speed

2007-02-21 Thread Pop User
John Machin wrote: > Or a Glushkov NFA simulated by bit parallelism re module ... see > http://citeseer.ist.psu.edu/551772.html > (which Russ Cox (author of the paper you cited) seems not to have > read). > NR-grep looks interesting, I'll read that. Thanks. > Cox uses a "pathological regex" (reg

Re: BDFL in wikipedia

2007-02-21 Thread Toby A Inkster
Jorge Vargas wrote: > shouldn't it mention Linus, Larry Wall, others?[3] Despite the link you posted, I don't think Linus, Larry Wall, Rasmus Lerdorf, etc describe themselves as BDFLs, even if they fulfil similar roles within their respective development communities. -- Toby A Inkster BSc (Hons

Re: BDFL in wikipedia

2007-02-21 Thread Toby A Inkster
Steven D'Aprano wrote: > Carl Banks wrote: >> >> Since when is Larry Wall benevolent? He should be called the SDFL. > > I can't think what the S stands for... if it was M, I'd say Malevolent, > but S? Scented, Sexy, Spanish... no, probably not those. I assume "Sadistic". -- Toby A Inkster BS

Re: Creating a daemon process in Python

2007-02-21 Thread Eirikur Hallgrimsson
Sakagami Hiroki wrote: > Hi, > > What is the easiest way to create a daemon process in Python? I find that this works great. I just pasted my copy, I think you can find it via Google. Eirikur # Daemon Module - basic facilities for becoming a daemon process # By Coy Krill # Combines ideas fr

Re: Creating a daemon process in Python

2007-02-21 Thread Benjamin Niemann
Hello, Sakagami Hiroki wrote: > What is the easiest way to create a daemon process in Python? Google > says I should call fork() and other system calls manually, but is > there no os.daemon() and the like? You could try HTH --

Re: getting a thread out of sleep

2007-02-21 Thread mark
On 20 Feb 2007 21:26:18 -0800, placid <[EMAIL PROTECTED]> wrote: > On Feb 21, 4:21 pm, "placid" <[EMAIL PROTECTED]> wrote: > > On Feb 21, 4:12 pm, mark <[EMAIL PROTECTED]> wrote: > > > On 20 Feb 2007 20:47:57 -0800, placid <[EMAIL PROTECTED]> wrote: > > > > On Feb 21, 3:08 pm, mark <[EMAIL PROTECTE

Creating a daemon process in Python

2007-02-21 Thread Sakagami Hiroki
Hi, What is the easiest way to create a daemon process in Python? Google says I should call fork() and other system calls manually, but is there no os.daemon() and the like? Regards, -- Sakagami Hiroki -- http://mail.python.org/mailman/listinfo/python-list

Question about updating in a GUI

2007-02-21 Thread Gheorghe Postelnicu
Hi, I have a GUI which does some visualization based on VTK and Tkinter. The problem I have is kinda complicated to describe, but here is a sketch of it: I have a basic Observer pattern in place for events (such as the change current 2D slice visualized) and it generally works well. However, I j

Re: starship.python.net is down

2007-02-21 Thread Matthew . Cahn
Hi, Any news on starship.python.net? It still seems to be down. Matthew On Feb 16, 8:57 am, Tom Bryan <[EMAIL PROTECTED]> wrote: > One of the system administrators had to reboot starship.python.net last > night, but it appears that the machine did not come back up properly. > starship.python.ne

Re: builtin set literal

2007-02-21 Thread Dave Opstad
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > [...] However, Python seems to use the -ed suffix for the > non-mutating versions of these functions, e.g. sorted(list) instead > of the mutating list.sort(). I've found this to be useful in my own Python librari

Re: metaclasses (beginner question)

2007-02-21 Thread Laszlo Nagy
> Without looking into the details -- the (subclass of) type is meant to be > the class of the class, or the other way round, your normal classes are > instances of (a subclass of) type. You determine the factory Python uses to > make a class by adding > > __metaclass__ = factory > > to the class

Re: Tkinter checkbuttons and variables

2007-02-21 Thread Eric Brunel
On Wed, 21 Feb 2007 15:50:57 +0100, Gigs_ <[EMAIL PROTECTED]> wrote: > from Tkinter import * > > states = [] > > def onpress(i): > states[i] = not states[i] > > > root = Tk() > for i in range(10): > chk = Checkbutton(root, text= str(i), command=lambda i=i: > onpress(i)) > chk.pack(

Re: Tkinter checkbuttons and variables

2007-02-21 Thread Diez B. Roggisch
Gigs_ schrieb: > from Tkinter import * > > states = [] > > def onpress(i): > states[i] = not states[i] > > > root = Tk() > for i in range(10): > chk = Checkbutton(root, text= str(i), command=lambda i=i: onpress(i)) > chk.pack(side=LEFT) > states.append(0) > root.mainloop() > pri

Tkinter checkbuttons and variables

2007-02-21 Thread Gigs_
from Tkinter import * states = [] def onpress(i): states[i] = not states[i] root = Tk() for i in range(10): chk = Checkbutton(root, text= str(i), command=lambda i=i: onpress(i)) chk.pack(side=LEFT) states.append(0) root.mainloop() print states after exiting i get everythin

Replacement for GnomeDateEdit?

2007-02-21 Thread Thomas Bollmeier
Hi, I'm currently designing a dialog using pygtk/Glade. One of the attributes to be edited is a date. I tried to use the GnomeDateEdit widget that is available among the widgets in glade. Unfortunately the "time"-property only allows me to use timestamps for dates >= January 1st 1970. Since the da

Re: metaclasses (beginner question)

2007-02-21 Thread Peter Otten
Laszlo Nagy wrote: > I would like to create a hierarchy classes, where the leaves have a > special attribute called "producer_id". In addition, I would like to > have a function that can give me back the class assigned to any > producer_id value. I tried to implement this with a metaclass, but I >

metaclasses (beginner question)

2007-02-21 Thread Laszlo Nagy
Hello, I would like to create a hierarchy classes, where the leaves have a special attribute called "producer_id". In addition, I would like to have a function that can give me back the class assigned to any producer_id value. I tried to implement this with a metaclass, but I failed. Pleas

Re: PLY for standard library

2007-02-21 Thread Jakub Stolarski
On 20 Lut, 19:29, "Alan Isaac" <[EMAIL PROTECTED]> wrote: > If not, what module providing substantially similar functionality is? > AFAIK there's no parser generator module in standard library. I would like to see PLY in standard library too. -- Jakub Stolarski -- http://mail.python.org/mailman

Re: f---ing typechecking

2007-02-21 Thread Neil Cerutti
On 2007-02-21, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > "Nick Craig-Wood" <[EMAIL PROTECTED]> wrote: >> Ie >> >> x += a >> >> does not equal >> >> x = x + a >> >> which it really should for all types of x and a > > One would hope so , yes. > > However, I think that the first for

Re: eval('000052') = 42?

2007-02-21 Thread Neil Cerutti
On 2007-02-21, André Malo <[EMAIL PROTECTED]> wrote: > Astan Chee wrote: > >> Hi, >> I just tried to do >> eval('00052') and it returned 42. >> Is this a known bug in the eval function? Or have I missed the way eval >> function works? > > You know, it's just the answer to the ultimate question of >

Re: Sorting directory contents

2007-02-21 Thread Jussi Salmela
Larry Bates kirjoitti: > Wolfgang Draxinger wrote: >> Jussi Salmela wrote: >> >>> I'm not claiming the following to be more elegant, but I would >>> do it like this (not tested!): >>> >>> src_file_paths = dict() >>> prefix = sourcedir + os.sep >>> for fname in os.listdir(sourcedir): >>> if mat

Performance project for the SigEx Foundry

2007-02-21 Thread pablo
have been testing performances of different scripting languages fordatabase access, text processing and client application data transfer. So far, I am getting better performance from PHP, but I don't have any hard data to back it up compared to others. This is a large project for the SigEx Foundry

Re: BDFL in wikipedia

2007-02-21 Thread Robin Becker
Carl Banks wrote: .. > > Since when is Larry Wall benevolent? He should be called the SDFL. > . even the great leader has been referred to as the MDFL :) most language designers get to do it once and then recognize the result as either beneficial or otherwise. The alternative is a con

Re: BDFL in wikipedia

2007-02-21 Thread Steven D'Aprano
On Wed, 21 Feb 2007 02:25:44 -0800, Carl Banks wrote: >> a) that page have an explanation of what BDFL is >> b) shouldn't it mention Linus, Larry Wall, others?[3] > > Since when is Larry Wall benevolent? He should be called the SDFL. > > :) I can't think what the S stands for... if it was M, I

Re: Sorting directory contents

2007-02-21 Thread Peter Otten
Wolfgang Draxinger wrote: > I got, hmm not really a problem, more a question of elegance: > > In a current project I have to read in some files in a given > directory in chronological order, so that I can concatenate the > contents in those files into a new one (it's XML and I have to > concatena

Re: eval('000052') = 42?

2007-02-21 Thread Bart Ogryczak
On Feb 21, 5:09 am, Astan Chee <[EMAIL PROTECTED]> wrote: > Hi, > I just tried to do > eval('00052') and it returned 42. > Is this a known bug in the eval function? Or have I missed the way eval > function works? It works just fine. Read up on integer literals. >>> 52 #decimal 52 >>> 052 #octa

Re: Weird result returned from adding floats depending on order I add them

2007-02-21 Thread Rhamphoryncus
On Feb 20, 6:08 am, "John Machin" <[EMAIL PROTECTED]> wrote: > >>> for x in b: > > ...tot += x > ...print repr(x), repr(tot) > ... > 0.20001 0.20001 > 0.20001 0.40002 > 0.20001 0.60009 > 0.20001 0.80

Re: eval('000052') = 42?

2007-02-21 Thread André Malo
Astan Chee wrote: > Hi, > I just tried to do > eval('00052') and it returned 42. > Is this a known bug in the eval function? Or have I missed the way eval > function works? You know, it's just the answer to the ultimate question of Life, the universe, and everything. SCNR, nd -- http://mail.py

Re: Sorting directory contents

2007-02-21 Thread Wolfgang Draxinger
Tim Williams wrote: > Are you running on windows? No. Of course I could use some installed tool, like ls, but I want a portable solution. > HTH :) Not really. Windows is only a niche for desktop systems. In my case the python script is running on a heterogenous grid monitoring system accessing

Re: BDFL in wikipedia

2007-02-21 Thread Carl Banks
On Feb 20, 9:27 pm, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > Hi I just hit this page in wikipedia BDFL[1] > > and it redirected me to Guido's wikipedia[2] entry > now without causing any troubles (read flamewar) shouldn't > > a) that page have an explanation of what BDFL is > b) shouldn't it men

Re: Reading compressed files

2007-02-21 Thread Steve Holden
Shadab Sayani wrote: > Hi, > I have compressed files compressed using different techniques > (especially unix compress). So I want to have a module that reads any of > these (.Z,.bz,.tgz files) files and manipulates the data. > The data has a syntax.It contains > HEADER (some information) > BODY

  1   2   >