ANNOUNCE: PyGTK 2.8.2

2005-10-10 Thread Johan Dahlin
I am pleased to announce version 2.8.2 of the Python bindings for GTK. The new release is available from ftp.gnome.org as and its mirrors as soon as its synced correctly: http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.8/pygtk-2.8.2.tar.gz What's new since 2.8.1: - GIOChannel

Re: Merging sorted lists/iterators/generators into one stream of values...

2005-10-10 Thread Alex Martelli
George Sakkis [EMAIL PROTECTED] wrote: ... manipulation of a heap to place an item in the right spot, but with 4-5 or a few more sources might not make an impact at all. Unless you're talking about hundreds or thousands sources, it probably won't. I would still go for the heap solution

Python Programmer Urgently Required

2005-10-10 Thread Kedar Dash
Job Description: The position holder will supplement the existing pool of application development and programming pool of OWSA technical team. In particular S/he will be responsible for developing Python based overlay application – to be mounted on existing software tools and solutions. The

Re: searching a project to contribute to

2005-10-10 Thread Robert Kern
Clint Norton wrote: Hi all, I'm a student currently in the beginning of my master's degree and I'm searching for an interesting open source project written in Python to contribute to. I have worked as a programmer for the past few years (mostly in academia but also as a typical full

Pythot doc problem: lambda keyword...

2005-10-10 Thread Xah Lee
i'm trying to lookup on the detail of language Python's “lambda” function feature. I've seen it before, but today i need to read about it again since i'm writing. I quickly went to the index page: http://python.org/doc/2.4.1/lib/genindex.html but all i got is a LambdaType. i'm thinking, maybe

Re: non descriptive error

2005-10-10 Thread Fredrik Lundh
Timothy Smith wrote: i have reproduced the error in this code block #save values in edit self.FinaliseTill.SaveEditControlValue() if Decimal(self.parent.TillDetails[self.TillSelection.GetStringSelection()]['ChangeTinBalance'])) == Decimal('0'): #box must be checked before continuing if

Re: non descriptive error

2005-10-10 Thread Fredrik Lundh
Timothy Smith wrote: it is definately a bug in 2.3 when using the decimal module. i can reproduce it. from decimal import Decimal a = Decimal('0' and when you attempt to run it you will get error $ python script.py File script.py, line 3 ^ SyntaxError: invalid syntax

Re: __Classes and type tests

2005-10-10 Thread Peter Otten
Brian van den Broek wrote: The code below exhibits an attempt to refer to the type of a __Class from within a method of that class. I've been unable to figure out how to make it work as I want, and would appreciate any insight. The problem emerged out of a bad design that the good folks on

Re: line

2005-10-10 Thread Fredrik Lundh
Shi Mu wrote_ There are four points with coordinates: 2,3;4,9;1,6;3,10. How to use Python to draw one perpendicular bisector between (2,3) and (4,9); the same was as you'd do it in any other computer language ? once you know the algorithm, implementing it in Python should be trivial. maybe

Re: line

2005-10-10 Thread gsteff
Why do you want to know? This list isn't a tool to get others to do your homework. Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: line

2005-10-10 Thread Shi Mu
it is not a homework, just interested. On 10 Oct 2005 00:04:23 -0700, gsteff [EMAIL PROTECTED] wrote: Why do you want to know? This list isn't a tool to get others to do your homework. Greg -- http://mail.python.org/mailman/listinfo/python-list --

Re: Python on the Power PC

2005-10-10 Thread Fredrik Lundh
Peter Milliken wrote: There were Tkinter binaries with it so I installed those as well. When I attempt to run the most simplistic of python programs using Tkinter, I get an error message stating that Python can't find any tkinter module. Any ideas what I have done wrong anybody? what does

Re: Python on the Power PC

2005-10-10 Thread Steve Holden
Peter Milliken wrote: Hi, I (think I have :-)) installed Python on my Pocket PC (obtained from http://fore.validus.com/~kashtan/). There were Tkinter binaries with it so I installed those as well. When I attempt to run the most simplistic of python programs using Tkinter, I get an error

changing filename of file-type object

2005-10-10 Thread rspoonz
I have a cgi script from which I wish to return a zipped file with an extension other than .zip (ie .zzz) I am creating a file-type object (cStringIO) and adding some zipped information to it using zipfile. I then return this with Content-Type: application/zip The problem is that the file the

Re: Pythot doc problem: lambda keyword...

2005-10-10 Thread Robert Kern
Xah Lee wrote: i'm trying to lookup on the detail of language Python's “lambda” function feature. google(site:docs.python.org lambda) -- Robert Kern [EMAIL PROTECTED] In the fields of hell where the grass grows high Are the graves of dreams allowed to die. -- Richard Harter --

Re: how do you pronounce wxpython

2005-10-10 Thread Peter
I always pronounced it double-you-ex-python. I am almost positive this is the way it is pronounced. Although the wxPyWiki seems to be pronounced wix-pee-wi-kee (as it says on the front page) so maybe it is pronounced wix-Python... you never know... HTH, Peter Alex wrote: My native language

Comparing lists

2005-10-10 Thread Odd-R.
I have to lists, A and B, that may, or may not be equal. If they are not identical, I want the output to be three new lists, X,Y and Z where X has all the elements that are in A, but not in B, and Y contains all the elements that are B but not in A. Z will then have the elements that are in

Re: Pythot doc problem: lambda keyword...

2005-10-10 Thread Pisin Bootvong
Xah Lee เขียน: i'm trying to lookup on the detail of language Python's “lambda” function feature. I've seen it before, but today i need to read about it again since i'm writing. I quickly went to the index page: http://python.org/doc/2.4.1/lib/genindex.html but all i got is a LambdaType.

Re: Comparing lists

2005-10-10 Thread Laszlo Zsolt Nagy
Odd-R. wrote: I have to lists, A and B, that may, or may not be equal. If they are not identical, I want the output to be three new lists, X,Y and Z where X has all the elements that are in A, but not in B, and Y contains all the elements that are B but not in A. Z will then have the elements

Re: users of pycurl here?

2005-10-10 Thread Michele Simionato
The Effbot wrote: here's a robust parser for various LIST output formats: http://cr.yp.to/ftpparse.html (google for ftpparse to find python bindings for that module) Well, I have downloaded the one from your site (ftpparse-1.1-20021124) and I have given a python setup.py install. Now I

Question about parsing a string

2005-10-10 Thread Nico Grubert
Hi there, I would like to parse a string in Python. If the string is e.g. '[url=http://www.whatever.org][/url]' I would like to generate this string: 'a href=http://www.whatever.org;http://www.whatever.org/a' If the string is e.g. '[url=http://www.whatever.org]My link[/url]' I would like to

Re: Comparing lists

2005-10-10 Thread [EMAIL PROTECTED]
try to use set. L1 = [1,1,2,3,4] L2 = [1,3, 99] A = set(L1) B = set(L2) X = A-B print X Y = B-A print Y Z = A | B print Z Cheers, pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: no variable or argument declarations are necessary.

2005-10-10 Thread Antoon Pardon
Op 2005-10-07, Diez B. Roggisch schreef [EMAIL PROTECTED]: Well, that exactly is the point where we make the transition from this is how things work to pure speculation. Everything starts with pure speculation. I had no intention of introducing the big type system here. I just think people who

2D graphics

2005-10-10 Thread Peres
Hello, As a Python beginner, I feel a bit lost among all possible libraries... so I wondered whether soemone could help me find my way... I just need to generate animated sequences of 2D primitives (dots and lines), as fast as possible, checking the computer clock for the time elapsed for

Re: Question about parsing a string

2005-10-10 Thread Fredrik Lundh
Nico Grubert wrote: I would like to parse a string in Python. If the string is e.g. '[url=http://www.whatever.org][/url]' I would like to generate this string: 'a href=http://www.whatever.org;http://www.whatever.org/a' If the string is e.g. '[url=http://www.whatever.org]My link[/url]' I

Re: 2D graphics

2005-10-10 Thread Fredrik Lundh
Peres wrote: As a Python beginner, I feel a bit lost among all possible libraries... so I wondered whether soemone could help me find my way... I just need to generate animated sequences of 2D primitives (dots and lines), as fast as possible, checking the computer clock for the time elapsed

Re: Question about parsing a string

2005-10-10 Thread Alex Martelli
Nico Grubert [EMAIL PROTECTED] wrote: Hi there, I would like to parse a string in Python. If the string is e.g. '[url=http://www.whatever.org][/url]' I would like to generate this string: 'a href=http://www.whatever.org;http://www.whatever.org/a' If the string is e.g.

Re: Jargons of Info Tech industry

2005-10-10 Thread Giorgos Keramidas
Roedy Green [EMAIL PROTECTED] writes: On Sat, 08 Oct 2005 23:33:13 GMT, Rich Teer [EMAIL PROTECTED] wrote or quoted : What the hell has that got to do with HTML email? Sending photos is an example of what attachments are for. Normally you send photos to grandma with captions under each

2D graphics

2005-10-10 Thread Peres
Dear Fredrik, Thanks for your answer. yes it means animated on the screen. I downloaded Python2.4, pygame and vision, but the animation is slow, and i cannot set a graphic priority to my program. Someone suggested PyopenGL.sourceforge, but it seems complicated. Thanks again Valerie --

Re: users of pycurl here?

2005-10-10 Thread Fredrik Lundh
Michele Simionato wrote: the README says for a usage example, see the sanity.py test script but there is not such a script in the distribution :-( looks like a distutils glitch... try this one: # $Id$ # minimal sanity check import string TESTS = [ # examples taken from ftpparse.c,

Re: Python reliability

2005-10-10 Thread Ville Voipio
In article [EMAIL PROTECTED], Paul Rubin wrote: I would say give the app the heaviest stress testing that you can before deploying it, checking carefully for leaks and crashes. I'd say that regardless of the implementation language. Goes without saying. But I would like to be confident (or

Re: assigning in nested functions

2005-10-10 Thread Antoon Pardon
Op 2005-10-09, jena schreef [EMAIL PROTECTED]: Hi I have code # BEGIN CODE def test(): def x(): print a a=2 # *** a=1 x() print a test() # END CODE This code fails (on statement print a in def x), if I omit line marked ***, it works (it prints 1\n1\n). It look

Re: Python reliability

2005-10-10 Thread Ville Voipio
In article [EMAIL PROTECTED], Steven D'Aprano wrote: If performance is really not such an issue, would it really matter if you periodically restarted Python? Starting Python takes a tiny amount of time: Uhhh. Sounds like playing with Microsoft :) I know of a mission- critical system which was

Python and windows

2005-10-10 Thread maxxx_77
I've designed a virtual keyboard (on screen)with Python. I've used Pithonwin and Tkinter. Well, I'd like to use this keyboard with some Windows's Application. This keyboard should find which application is running (with an Active window) and then write on it. The keybord should remain always on

Re: What about letting x.( ... ? ... ) be equivalent to ( ... x ... )

2005-10-10 Thread Alex Martelli
al [EMAIL PROTECTED] wrote: And it solve a problem that in all object oriented langages, a method that process 2 or more different classes of objets belongs just to one of those classes. Your use of the word all in the phrase all object oriented languages is erroneous. There ARE several

Re: New Python book

2005-10-10 Thread Alex Martelli
hrh1818 [EMAIL PROTECTED] wrote: This book is not a new book. It is an updated version of Magnus's 2002 Practical Python book. Then it's probably a good book, because Practical Python sure was! Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Python reliability

2005-10-10 Thread Paul Rubin
Ville Voipio [EMAIL PROTECTED] writes: Goes without saying. But I would like to be confident (or as confident as possible) that all bugs are mine. If I use plain C, I think this is the case. Of course, bad memory management in the underlying platform will wreak havoc. I am planning to use

Re: users of pycurl here?

2005-10-10 Thread Michele Simionato
Yes, it works fine, thanks (still I am a bit surprised there is not ftpparse.py but only an _ftpparse.so). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Python reliability

2005-10-10 Thread Steven D'Aprano
Ville Voipio wrote: There are a gazillion things which may go wrong. A stray cosmic ray may change the state of one bit in the wrong place of memory, and that's it, etc. So, the system has to be able to recover from pretty much everything. I will in any case build an independent process

propagating distutil user options between commands

2005-10-10 Thread gatti
When building a C extension, Distutils standard command 'install' calls the 'build' command before performing the installation (see Lib/distutils/command/install.py and build.py). Reusing the build command is the correct way to ensure the installation payload is ready, but the two commands support

Perl-Python-a-Day: Sorting

2005-10-10 Thread Xah Lee
Sort a List Xah Lee, 200510 In this page, we show how to sort a list in Python Perl and also discuss some math of sort. To sort a list in Python, use the “sort” method. For example: li=[1,9,2,3]; li.sort(); print li; Note that sort is a method, and the list is changed in place. Suppose you

Re: searching a project to contribute to

2005-10-10 Thread Ido Yehieli
Thank you all for your advice, I currently have several offers that I'm really tempted about - I will take a closer look at both of them (as well as continue searching) and will make an educated decision within the next few days. I've also decided to get rid of the sily pseudonym... --

Writing an xmgr/grace file as text (not interactive)

2005-10-10 Thread Niels L Ellegaard
Can someone suggest a package that allows me to write a data file for xmgr. So far I have found some packages that allow me to start an interactive xmgrace session from python, but I would rather have a package that write a text file. I realize that xmgr can read text-files, and that the format

Re: Question about StringIO

2005-10-10 Thread Frank Millman
Diez B. Roggisch wrote: Frank Millman wrote: Hi all I understand that StringIO creates a file-like object in memory. Is it possible to invoke another program, using os.system() or os.popen(), and use the redirect operator, so that the other program reads my StringIO object as its

Re: Perl-Python-a-Day: Sorting

2005-10-10 Thread Marcin 'Qrczak' Kowalczyk
Followup-To: comp.lang.scheme Xah Lee [EMAIL PROTECTED] writes: Since this is frequently used, Python provides a somewhat shorter syntax for it, by specifying the column used as the ordering “key”. [...] Because Python's implementation is not very refined , this specialized syntax is

Re: Continuous system simulation in Python

2005-10-10 Thread Sébastien Boisgérault
Nicolas, I am aware of some shortcomings and design flaws of Simulink, especially in the code generation area. I am interested by your paper nonetheless, please send me copy. However, Simulink is used by many people on a day-to-day basis in the context of big, industrial projects. The claim that

Changing an AST

2005-10-10 Thread beza1e1
Is it possible compiler.parse a statement, then change and then execute/resolve it? Background: I'm probably to lazy to write my own parser. I have such a statement as string: distance = x**2 + y**2 x and y are undefined, so it is no executable Python code, but it is parseable. Now i'd like

Re: dcop module under Python 2.4

2005-10-10 Thread qwweeeit
Hi Diez, thank you for your replay, but I didn't succeed (I am almost a newbye). So I solved the problem in another manner: I changed distribution from kubuntu to SUSE 9.3 (base installation). Now I can import dcop and also pcop. Bye. -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing an AST

2005-10-10 Thread Fredrik Lundh
beza1e1 [EMAIL PROTECTED] wrote: I have such a statement as string: distance = x**2 + y**2 x and y are undefined, so it is no executable Python code, but it is parseable. Now i'd like traverse through the AST and change Name('x') for the value i have elsewhere. And finally let Python resolve

Re: Python reliability

2005-10-10 Thread Ville Voipio
In article [EMAIL PROTECTED], Steven D'Aprano wrote: If you have enough hardware grunt, you could think about having three independent processes working in parallel. They vote on their output, and best out of three gets reported back to the user. In other words, only if all three results

Re: Changing an AST

2005-10-10 Thread Leif K-Brooks
beza1e1 wrote: Is it possible compiler.parse a statement, then change and then execute/resolve it? This should work: from compiler.pycodegen import ModuleCodeGenerator from compiler.misc import set_filename from compiler import parse tree = parse('foo = 42') set_filename('foo',

Re: Python reliability

2005-10-10 Thread Ville Voipio
In article [EMAIL PROTECTED], Paul Rubin wrote: You might be better off with a 2.6 series kernel. If you use Python conservatively (be careful with the most advanced features, and don't stress anything too hard) you should be ok. Python works pretty well if you use it the way the

Re: Changing an AST

2005-10-10 Thread beza1e1
Thank you! this compile/exec in context is the thing i wanted. It is not that performant i think. But it should ease the prototyping. -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl-Python-a-Day: Sorting

2005-10-10 Thread Ulrich Hobelmann
Xah Lee wrote: To sort a list in Python, use the “sort” method. For example: li=[1,9,2,3]; li.sort(); print li; Likewise in Common Lisp. In Scheme there are probably packages for that as well. My apologies for not being very fluent anymore. CL-USER (setf list (sort '(1 9 2 3) #'))

Re: Python reliability

2005-10-10 Thread Paul Rubin
Ville Voipio [EMAIL PROTECTED] writes: Just one thing: how reliable is the garbage collecting system? Should I try to either not produce any garbage or try to clean up manually? The GC is a simple, manually-updated reference counting system augmented with some extra contraption to resolve

Re: Python reliability

2005-10-10 Thread Max M
Ville Voipio wrote: In article [EMAIL PROTECTED], Paul Rubin wrote: I would say give the app the heaviest stress testing that you can before deploying it, checking carefully for leaks and crashes. I'd say that regardless of the implementation language. Goes without saying. But I would like

Windows installer, different versions of Python on Windows

2005-10-10 Thread Max M
I would like to install several copies of Python 2.4.2 on my machine, but it doesn't seem to be possible. If I allready has a version installed, the installer only gives the options to: - change python 2.4.2 - repair python 2.4.2 - remove python 2.4.2 I would like to install different

Re: Question about StringIO

2005-10-10 Thread Benjamin Niemann
Frank Millman wrote: I will try to explain my experience with popen() briefly. I have some sql scripts to create tables, indexes, procedures, etc. At present there are about 50 scripts, but this number will grow. I have been running them manually so far. Now I want to automate the process.

Re: Comparing lists

2005-10-10 Thread Christian Stapfer
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] try to use set. L1 = [1,1,2,3,4] L2 = [1,3, 99] A = set(L1) B = set(L2) X = A-B print X Y = B-A print Y Z = A | B print Z But how efficient is this? Could you be a bit more explicit on that

Re: socketServer questions

2005-10-10 Thread rbt
On Sat, 2005-10-08 at 14:09 -0700, Paul Rubinhttp: wrote: rbt [EMAIL PROTECTED] writes: Off-topic here, but you've caused me to have a thought... Can hmac be used on untrusted clients? Clients that may fall into the wrong hands? How would one handle message verification when one cannot

Re: socketServer questions

2005-10-10 Thread Paul Rubin
rbt [EMAIL PROTECTED] writes: I don't understand the question. HMAC requires that both ends share a secret key; does that help? That's what I don't get. If both sides have the key... how can it be 'secret'? All one would have to do is look at the code on any of the clients and they'd

One last thing about SocketServer

2005-10-10 Thread rbt
I've read more about sockets and now, I have a better understanding of them. However, I still have a few SocketServer module questions: When used with SocketServer how exactly does socket.setdefaulttimeout() work? Does it timeout the initial connect request to the socket server or does it timeout

Re: Perl-Python-a-Day: Sorting

2005-10-10 Thread Pascal Costanza
Ulrich Hobelmann wrote: Xah Lee wrote: To sort a list in Python, use the “sort” method. For example: li=[1,9,2,3]; li.sort(); print li; Likewise in Common Lisp. In Scheme there are probably packages for that as well. My apologies for not being very fluent anymore. CL-USER (setf

Re: Merging sorted lists/iterators/generators into one stream of values...

2005-10-10 Thread George Sakkis
Alex Martelli [EMAIL PROTECTED] wrote: George Sakkis [EMAIL PROTECTED] wrote: ... manipulation of a heap to place an item in the right spot, but with 4-5 or a few more sources might not make an impact at all. Unless you're talking about hundreds or thousands sources, it probably

Re: Merging sorted lists/iterators/generators into one stream of values...

2005-10-10 Thread Mike C. Fletcher
Alex Martelli wrote: George Sakkis [EMAIL PROTECTED] wrote: ... manipulation of a heap to place an item in the right spot, but with 4-5 or a few more sources might not make an impact at all. Unless you're talking about hundreds or thousands sources, it probably won't. I would still

Unlimited Free Music Downloads !

2005-10-10 Thread david
Download Unlimited Free Music Click Here! -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows installer, different versions of Python on Windows

2005-10-10 Thread Brandon K
When you install Python it plug entries into the registry, so that when you go to install add-ons that are pre-compiled binaries, they look into the registry for the python directory. If you can find out how to manipulate the registry so that the binaries would recognize different

Re: best Pythonic way to do this sort: Python newb

2005-10-10 Thread George Sakkis
Satchidanand Haridas [EMAIL PROTECTED] wrote: So, I want to sort myList by the return of myFunction( value3 ) I tried doing the following... with no luck so far myList.sort(lambda x, y: cmp(myFunction(x[2]), myFunction(y[2])) I think the above statement should be as follows:

Re: What about letting x.( ... ? ... ) be equivalent to ( ... x ... )

2005-10-10 Thread Diez B. Roggisch
Daniel Delay wrote: I agree the comparison to the mathematical o-operator is misleading, it was just to say sometimes, it can be usefull introduce new syntax to avoid too many nested parenthesis To replace them by the same amount of parentheses with a dot in front? Not very convincing. This

Re: One last thing about SocketServer

2005-10-10 Thread Steve Holden
rbt wrote: I've read more about sockets and now, I have a better understanding of them. However, I still have a few SocketServer module questions: When used with SocketServer how exactly does socket.setdefaulttimeout() work? Does it timeout the initial connect request to the socket server

Re: Jargons of Info Tech industry

2005-10-10 Thread axel
In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: Roedy Green [EMAIL PROTECTED] wrote: On 8 Oct 2005 23:39:27 GMT, John Bokma [EMAIL PROTECTED] wrote or quoted : Yeah, yeah, and 640K is enough for everybody. Same song, different tune. For how long. Surely attachments are a stop

Re: Jargons of Info Tech industry

2005-10-10 Thread axel
In comp.lang.perl.misc Tim Tyler [EMAIL PROTECTED] wrote: In comp.lang.java.programmer Steven D'Aprano [EMAIL PROTECTED] wrote or quoted: Only if your photos are so obscure and confusing that they need captions. Here's Johnny with the dog. Here is Johnny with the dog again. This one is

Re: Comparing lists

2005-10-10 Thread George Sakkis
Christian Stapfer [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: try to use set. Sorting the two lists and then extracting A-B, B-A, A|B, A B and A ^ B in one single pass seems to me very likely to be much faster for large lists. Why don't you implement it, test it and time it to

Re: Perl's documentation come of age

2005-10-10 Thread Christos Georgiou
On Wed, 05 Oct 2005 21:36:47 -0600, rumours say that Mahesh Padmanabhan [EMAIL PROTECTED] might have written: In article [EMAIL PROTECTED], Xah Lee [EMAIL PROTECTED] wrote: snip lot of drivel While I don't like to feed the trolls, I do find his posts amusing. He is like a spoilt child seeking

Re: socketServer questions

2005-10-10 Thread rbt
On Mon, 2005-10-10 at 05:54 -0700, Paul Rubinhttp: wrote: rbt [EMAIL PROTECTED] writes: I don't understand the question. HMAC requires that both ends share a secret key; does that help? That's what I don't get. If both sides have the key... how can it be 'secret'? All one would

TurboGears slashdotted

2005-10-10 Thread Grig Gheorghiu
TurboGears: Python on Rails? post: http://developers.slashdot.org/developers/05/10/10/0650207.shtml?tid=156 -- http://mail.python.org/mailman/listinfo/python-list

Re: Merging sorted lists/iterators/generators into one stream of values...

2005-10-10 Thread Alex Martelli
George Sakkis [EMAIL PROTECTED] wrote: ... i.e., a heap solution may be over 4 times faster than a sort-based one (in the following implementations). Interesting; I thought timsort on small almost ordered lists would be practically as fast as the heap. Still, how is 0.10344 over 4 times

Re: Merging sorted lists/iterators/generators into one stream of values...

2005-10-10 Thread Alex Martelli
Mike C. Fletcher [EMAIL PROTECTED] wrote: ... One thing to keep in mind (if you care about performance) is that you one could use bisect, instead of sort, as the sorted list of streams is already in order save for the one element you are processing. Btw, nice trick with reverse to reduce

Re: Comparing lists

2005-10-10 Thread Steven D'Aprano
On Mon, 10 Oct 2005 14:34:35 +0200, Christian Stapfer wrote: Sorting the two lists and then extracting A-B, B-A, A|B, A B and A ^ B in one single pass seems to me very likely to be much faster for large lists. Unless you are running a Python compiler in your head, chances are your intuition

Re: socketServer questions

2005-10-10 Thread Paul Rubin
rbt [EMAIL PROTECTED] writes: Instead, for client #i, let that client's key be something like hmac(your_big_secret, str(i)).digest() and the client would send #i as part of the string. How is this different from sending a pre-defined string from the client that the server knows the md5

Default argument to __init__

2005-10-10 Thread netvaibhav
Hi All: Here's a piece of Python code and it's output. The output that Python shows is not as per my expectation. Hope someone can explain to me this behaviour: [code] class MyClass: def __init__(self, myarr=[]): self.myarr = myarr myobj1 = MyClass() myobj2 = MyClass()

Re: socketServer questions

2005-10-10 Thread rbt
On Mon, 2005-10-10 at 07:46 -0700, Paul Rubinhttp: wrote: rbt [EMAIL PROTECTED] writes: Instead, for client #i, let that client's key be something like hmac(your_big_secret, str(i)).digest() and the client would send #i as part of the string. How is this different from sending a

Re: Perl's documentation come of age

2005-10-10 Thread gene tani
request for Google groups enhancement: Report Abuse button should have 4 choices: - Spam - Illegal Content - Xah - other ;-} Christos Georgiou wrote: On Wed, 05 Oct 2005 21:36:47 -0600, rumours say that Mahesh Padmanabhan [EMAIL PROTECTED] might have written: In article [EMAIL PROTECTED],

subprocess and non-blocking IO (again)

2005-10-10 Thread Marc Carter
I am trying to rewrite a PERL automation which started a monitoring application on many machines, via RSH, and then multiplexed their collective outputs to stdout. In production there are lots of these subprocesses but here is a simplified example what I have so far (python n00b alert!) - SNIP

read serial data from a barcode reader/scanner using python

2005-10-10 Thread Edgar
Hi. is therea way to program python to read serial data from a barcode reader/scanner and then using the parallel port of the PC to activatean electromagnetic door lock. edgar -- http://mail.python.org/mailman/listinfo/python-list

Send password over TCP connection

2005-10-10 Thread dcrespo
Hi all, I have a program that serves client programs. The server has a login password, which has to be used by each client for logging in. So, when the client connects, it sends a string with a password, which is then validated on the server side. The problem is obvious: anyone can get the

Re: Send password over TCP connection

2005-10-10 Thread Paul Rubin
dcrespo [EMAIL PROTECTED] writes: I have a program that serves client programs. The server has a login password, which has to be used by each client for logging in. So, when the client connects, it sends a string with a password, which is then validated on the server side. The problem is

Confused on Kid

2005-10-10 Thread Brandon K
Hey, so I heard about the TurboGears posting and decided to investigate. I watched some of their video on building a wiki in 20 minutes and was totally blown away because I'm used to python...straight python, not melding together 4 different APIs into one to blah blah. ANYWAY. I was

Re: Comparing lists

2005-10-10 Thread Christian Stapfer
George Sakkis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Christian Stapfer [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: try to use set. Sorting the two lists and then extracting A-B, B-A, A|B, A B and A ^ B in one single pass seems to me very likely to be much

Re: When someone from Britain speaks, Americans hear a Britishaccent...

2005-10-10 Thread Rocco Moretti
Duncan Smith wrote: Steve Holden wrote: There are special rules for the monarchs, who are expected to refer to themselves in the first person plural. Yes, although I'm not actually sure where the 'royal we' comes from; I was under the (probably misinformed) impression that since the

Re: Send password over TCP connection

2005-10-10 Thread Peter Tillotson
simplest approach is to 1 way hash the password ... perhaps using md5 normally with passwords the server only has to check if it is the same word, assuming the same hash algorithms the same hash value can be created at client. Its not hugely secure ... anyone sniffing can grab your hash value

Re: Default argument to __init__

2005-10-10 Thread skip
vaibhav Here's a piece of Python code and it's output. The output that vaibhav Python shows is not as per my expectation. Hope someone can vaibhav explain to me this behaviour: ... Yes, your default arg is evaluated once, at method definition time and shared betwee all instances

Re: Default argument to __init__

2005-10-10 Thread Steve Holden
[EMAIL PROTECTED] wrote: Hi All: Here's a piece of Python code and it's output. The output that Python shows is not as per my expectation. Hope someone can explain to me this behaviour: [code] class MyClass: def __init__(self, myarr=[]): self.myarr = myarr

Re: Default argument to __init__

2005-10-10 Thread Larry Bates
This comes up on the list about once a week on this list. See: http://www.nexedi.org/sections/education/python/tips_and_tricks/python_and_mutable_n/view -Larry Bates [EMAIL PROTECTED] wrote: Hi All: Here's a piece of Python code and it's output. The output that Python shows is not as per

Re: Confused on Kid

2005-10-10 Thread Robert Kern
Brandon K wrote: Hey, so I heard about the TurboGears posting and decided to investigate. I watched some of their video on building a wiki in 20 minutes and was totally blown away because I'm used to python...straight python, not melding together 4 different APIs into one to blah blah.

Re: Comparing lists

2005-10-10 Thread Steve Holden
Christian Stapfer wrote: George Sakkis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Christian Stapfer [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: try to use set. Sorting the two lists and then extracting A-B, B-A, A|B, A B and A ^ B in one single pass seems to me

Re: Send password over TCP connection

2005-10-10 Thread Steve Holden
Peter Tillotson wrote: simplest approach is to 1 way hash the password ... perhaps using md5 No, it isn't - see below. normally with passwords the server only has to check if it is the same word, assuming the same hash algorithms the same hash value can be created at client.

Re: Send password over TCP connection

2005-10-10 Thread Josef Meile
Anyone know of a simple ssl api in python :-) Perhaps pow may help: http://sourceforge.net/projects/pow or pyopenssl: http://pyopenssl.sourceforge.net/ Regards, Josef -- http://mail.python.org/mailman/listinfo/python-list

unable to import os

2005-10-10 Thread Kim Nguyen
Fredrik Lundh,I replaced mtime = os.stat(Path + file_name)[os.path.stat.ST_MTIME] with mtime = nt.stat("q.py") per your suggested, then ran it from IDLE 2.4.2. Here is the message I got, Traceback (most recent call last): File "C:\Documents and Settings\nguyeki\Desktop\Oct7", line 37, in

Re: Python reliability

2005-10-10 Thread Scott David Daniels
You might try a take over mode -- starting another copy gets to the point it looks to listen for UDP, the (if the listening fails), tells the other process to die over UDP, taking over then. This scheme would would reduce your time-to-switch to a much shorter window. Whenever given the shutdown

  1   2   3   >