[Python-Announce] cfgparse v01_01 released

2005-03-23 Thread Dan Gass
I'm pleased to announce the V01_01 release of cfgparse. Whats New - 1) Exception argument added to the Configuration parser initializer so that exceptions may be raised when user errors are encountered instead of the default call to

Re: Python limericks (was Re: Text-to-speech)

2005-03-23 Thread David Fraser
Michael Spencer wrote: How about a category for executable limericks? That was my thought too... for programmer in search_of(elegance): if programmer.needs(an experience): print whitespace counts much if Van_Rossum is Dutch: print Dictators are made by benevolence And an attempt at

Re: MinGW building with Python 2.4

2005-03-23 Thread David Fraser
mrstephengross wrote: Ok, I know there are already a million posts on this group about getting Python to build with MinGW. I've been through many of them, and have still not found a good comprehensive way to accomplish this. I've got Cygwin 5.1 with GCC 3.3.3 on it. I'm using Python 2.4. Note: You

Re: Regular Expressions: large amount of or's

2005-03-23 Thread Daniel Yoo
: Done. 'startpos' and other bug fixes are in Release 0.7: : http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/ahocorasick-0.7.tar.gz Ok, I stopped working on the Aho-Corasick module for a while, so I've just bumped the version number to 0.8 and posted it up on PyPI. I did add some

Re: Regular Expressions

2005-03-23 Thread MyHaz
escape chars are always a pain when making regex's. There is a section on it the Regex HOWTO http://www.amk.ca/python/howto/regex/regex.html#SECTION00042 -- http://mail.python.org/mailman/listinfo/python-list

Re: Anonymus functions revisited

2005-03-23 Thread Antoon Pardon
Op 2005-03-22, Diez B. Roggisch schreef [EMAIL PROTECTED]: Not exactly in fact - unless I messed something. There are 2 problems here: a more flexible tuple unpacking, *and* a lambda in disguise. Actually, I'd go + 1 for the first, -1 for the second The proposed syntax from Kay is lambda in

Re: Please help for Python programming

2005-03-23 Thread yy0127
Thanks for your advice.^^ I find out something special (because i don't know). I would like to retrieve data from source file into array. The data will be omited if the value is duplicated. For example, there is 3 values - 1,2,1. It will only display 1,2 after i ran the script. value = (1,2,1)

Re: I'm just an idiot when it comes logging

2005-03-23 Thread Vinay Sajip
olsongt at verizon.net writes: I'm trying to be a good boy and use the logging module but it's behaving rather counter-intuitively. I've posted a simplified test script below. To summarize, I've set the basic config to only log root level messages with = ERROR level. I've created

Re: Please help for Python programming

2005-03-23 Thread bruno modulix
[EMAIL PROTECTED] wrote: Thanks for your advice.^^ It would be more useful to follow them than to thank me. I find out something special (because i don't know). I would like to retrieve data from source file into array. The data will be omited if the value is duplicated. For example, there is 3

Re: Anonymus functions revisited

2005-03-23 Thread bruno modulix
Ron wrote: On Tue, 22 Mar 2005 21:56:57 GMT, Ron [EMAIL PROTECTED] wrote: Why should a function not create a local varable of an argument if the varable doesn't exist and a default value is given? ok... thought it out better. :) Getting a default into a function isn't the problem. Returning the

Re: Anonymus functions revisited

2005-03-23 Thread bruno modulix
George Sakkis wrote: Ron [EMAIL PROTECTED] wrote: On Tue, 22 Mar 2005 21:56:57 GMT, Ron [EMAIL PROTECTED] wrote: Why should a function not create a local varable of an argument if the varable doesn't exist and a default value is given? ok... thought it out better. :) Getting a default into a

Re: Anonymus functions revisited

2005-03-23 Thread bruno modulix
Ron wrote: On Tue, 22 Mar 2005 21:45:42 +0100, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Ron a écrit : On 21 Mar 2005 22:37:42 -0800, Kay Schluehr [EMAIL PROTECTED] wrote: Mappings like that: ((x,y),z) - x+y-z ((x,y=0),z) - None should be valid actions too. What is the audience thinking

Re: missing? dictionary methods

2005-03-23 Thread Antoon Pardon
Op 2005-03-22, Bengt Richter schreef [EMAIL PROTECTED]: On 22 Mar 2005 07:40:50 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: [...] I also was under the impression that a particular part of my program almost doubled in execution time once I replaced the naive dictionary assignment with these self

Re: Anonymus functions revisited : tuple actions

2005-03-23 Thread bruno modulix
Kay Schluehr wrote: Hi all, thanks for Your attention ! I think my proposal was more in mind of Rons modified exec than Pythons lambda. When George proposed his unpacking behavoir for list-comps as a pack of suggar: 1. [x*y-z for (x,y,z=0) in (1,2,3), (4,5), (6,7,8)] I interpreted it in a

Re: Anonymus functions revisited

2005-03-23 Thread Duncan Booth
George Sakkis wrote: So then the question is ... is there a way for a function to create a varable in it's parents namespace that persists after the function is done? Yeap.. a simple one-liner can do the trick: def makeVars(**nameVals): sys._getframe(1).f_locals.update(nameVals)

Python to c++ conversion problem

2005-03-23 Thread Akdes Serin
I have a code in python like if eval('player.moveRoom(SeLinuxMud.Direction.' + x + ')'): # moveRoom function takes Direction enum as a parameter When I am trying to write this code in c++ if (player-moveRoom(s[1])) //s[1] is a string so it outputs an error because of not taking enum as a

Re: cross platform use of set locale

2005-03-23 Thread Serge Orlov
Timothy Smith wrote: thats ok, but how do i get it to group thousands with a , ? and thats would mean i'd have to run everything through a formatter before i displayed it :/ it'd be nicer if i could just select a proper locale I think you're misusing locale. There is no guarantee that any

Re: Python to c++ conversion problem

2005-03-23 Thread Ahmed MOHAMED ALI
Hi, Convert the string to int then cast the int to enum with static_cast. Ahmed Akdes Serin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a code in python like if eval('player.moveRoom(SeLinuxMud.Direction.' + x + ')'): # moveRoom function takes Direction enum as a

setattr inside a module

2005-03-23 Thread kramb64
I'm trying to use setattr inside a module. From outside a module it's easy: import spam name=hello value=1 setattr(spam, name, value) But if I want to do this inside the module spam itself, what I've to pass to setattr as first argument? Thanks a lot for your time. Marco. --

Re: cross platform use of set locale

2005-03-23 Thread Timothy Smith
Serge Orlov wrote: Timothy Smith wrote: thats ok, but how do i get it to group thousands with a , ? and thats would mean i'd have to run everything through a formatter before i displayed it :/ it'd be nicer if i could just select a proper locale I think you're misusing locale. There is no

Re: Regular Expressions

2005-03-23 Thread Roel Schroeven
Ron wrote: This is probably a repeated question, but try as I might I was unable to find something similar in the archives. I'm trying to develop a regular expression for recognizing a simplified C-Style string syntax. I need it to be able to handle escape sequences of the form \x where x

Re: setattr inside a module

2005-03-23 Thread Denis S. Otkidach
On Wed, 23 Mar 2005 11:35:34 +0100 kramb64 wrote: K I'm trying to use setattr inside a module. K From outside a module it's easy: K K import spam K name=hello K value=1 K setattr(spam, name, value) K K But if I want to do this inside the module spam itself, what I've to K pass to setattr as

PyGTK Button Size Question

2005-03-23 Thread Harlin Seritt
How does one set the width of a gtk.Button explicitly? and height for that matter as well... thanks, Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 18, Issue 366

2005-03-23 Thread Vidyasagar
I have a doubt in python curses how to get the current screen size using python curses... glad if neone cud help thankz Sagar On Wed, 23 Mar 2005 12:00:17 +0100 (CET), [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Send Python-list mailing list submissions to

Re: Anonymus functions revisited

2005-03-23 Thread Diez B. Roggisch
Can someone who thinks this way, please explain why this is acceptable [ x * x for x in some_iterator ] But this is not map(lambda x: x * x, some_iteraror) and should be replaced with def sqr(x): return x * x map(sqr , some_iterator) It shouldn't, it should be replaced

Re: setattr inside a module

2005-03-23 Thread kramb64
On Wed, 23 Mar 2005 11:35:34 +0100, kramb64 [EMAIL PROTECTED] wrote: I'm trying to use setattr inside a module. From outside a module it's easy: import spam name=hello value=1 setattr(spam, name, value) But if I want to do this inside the module spam itself, what I've to pass to setattr as

Python to C++ conversion substituting vectors for lists in a recursive function

2005-03-23 Thread lugal
I'm new to C++, coming from a Python background. I wrote the following code in C++ based on the Python code found here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/302478 //beginning #include vector #include iostream.h using namespace std; void looper(vector vectorint nseq,

Re: scrollbar dependencies

2005-03-23 Thread Marion
Thanks a lot, Eric Brunel. Harlin, if it's still actual (don't think so, but whoever...) here is a simple code that works. --- from Tkinter import * ## Main window root = Tk() root.grid_rowconfigure(0, weight=1) root.grid_rowconfigure(1, weight=1)

Re: Python to c++ conversion problem

2005-03-23 Thread Ivan Vecerina
Akdes Serin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a code in python like if eval('player.moveRoom(SeLinuxMud.Direction.' + x + ')'): # moveRoom function takes Direction enum as a parameter When I am trying to write this code in c++ if (player-moveRoom(s[1])) //s[1]

Re: Python to C++ conversion substituting vectors for lists in a recursive function

2005-03-23 Thread MyHaz
I didn't look at the original code but i you should know that passing vectors directly (i.e by value) to functions is not a good idea (results in big copy), its better to use `const vector ` or `vector ` (i.e. by reference). In general you should try to reduce the number of vector coping to a

Re: Anonymus functions revisited

2005-03-23 Thread Kay Schluehr
Duncan Booth wrote: Do I really need to mention that the whole concept here is broken. This only works if you call it from global scope. If you call it from inside a function it [usually] won't work: def makeVars(**nameVals): sys._getframe(1).f_locals.update(nameVals) def

Re: How to use subprocess

2005-03-23 Thread Thomas Bellman
Nicolas Fleury [EMAIL PROTECTED] writes: Hi, I want to use the subprocess module (or any standard Python module) to run a process: - which stdout and stderr can each be redirected to any file-like object (no fileno function). - can be cancelled with a threading.Event. My problem

Re: setattr inside a module

2005-03-23 Thread Kay Schluehr
kramb64 wrote: I'm trying to use setattr inside a module. From outside a module it's easy: import spam name=hello value=1 setattr(spam, name, value) But if I want to do this inside the module spam itself, what I've to pass to setattr as first argument? Thanks a lot for your time.

Re: Python limericks (was Re: Text-to-speech)

2005-03-23 Thread Richie Hindle
[Michael] from itertools import repeat for feet in [3,3,2,2,3]: print .join(DA-DA-DUM for dummy in [None] for foot in repeat(metric, feet)) Spectacular! +1 QOTW -- Richie Hindle [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Anonymus functions revisited

2005-03-23 Thread Antoon Pardon
Op 2005-03-23, Diez B. Roggisch schreef [EMAIL PROTECTED]: Can someone who thinks this way, please explain why this is acceptable [ x * x for x in some_iterator ] But this is not map(lambda x: x * x, some_iteraror) and should be replaced with def sqr(x): return x * x

Re: Submission for Python Limmerick Contest

2005-03-23 Thread Tim Jarman
[EMAIL PROTECTED] wrote: My submission for P.L.C. A mathematican named van Rossum went hunting for opossum he could not find one all eaten by Python to her his language he named as a blossum wish me luck Harald At the prompt, when I type import this, it Invites me to be more

Re: setattr inside a module

2005-03-23 Thread Diez B. Roggisch
I found this: setattr(__import__(__name__), name, value) But too much underscores Nothing better? Marco. setattr(sys.modules[__name__], name, value) -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: cross platform use of set locale

2005-03-23 Thread Serge Orlov
Timothy Smith wrote: Serge Orlov wrote: Timothy Smith wrote: thats ok, but how do i get it to group thousands with a , ? and thats would mean i'd have to run everything through a formatter before i displayed it :/ it'd be nicer if i could just select a proper locale I think

How to pickling VT_DATE values?

2005-03-23 Thread jkn
Hi all this is my first go at pickling and I'm having trouble with variables of type VT_DATE returned from a COM application. I don't seem to be successfully pickling/depickling to the the same value. I think this may be due to a strange return value. The VT_DATE seems to be a floating point

Re: Getting the word to conventional programmers

2005-03-23 Thread Christopher Nelson
Hey, Jeff Hobbs got the last word. ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: typo in the library reference?

2005-03-23 Thread Scott David Daniels
nicke wrote: Peter Hansen [EMAIL PROTECTED] wrote: Scott David Daniels wrote: nicke wrote: If it really is like this it is uncoherent and quite stupid :P Name-calling won't make anyone more likely to help you out. This is a _collective_ effort. You spotted a problem; submit at least a bug report

Re: Read from the last line of a file?

2005-03-23 Thread Scott David Daniels
Mike Rovner wrote: Anthony Liu wrote: I am wondering if it is possible to start reading from the last line of file, and then the last but one up to the first line. If you can afford to keep the whole file in memory, than: lines = open(..).readlines() print lines[::-1] Or use the new

Re: I'm just an idiot when it comes logging

2005-03-23 Thread olsongt
Vinay Sajip wrote: olsongt at verizon.net writes: Handlers normally process all events passed to them, but you can set a level on a handler to get it to drop events below a certain threshold. Since you haven't done this, you will see an INFO message appear even though the root logger's

Re: Anonymus functions revisited

2005-03-23 Thread Ron
On 23 Mar 2005 10:13:16 GMT, Duncan Booth [EMAIL PROTECTED] wrote: Do I really need to mention that the whole concept here is broken. This only works if you call it from global scope. If you call it from inside a function it [usually] won't work: That's only becuase it was asked to go up 1

Re: cross platform use of set locale

2005-03-23 Thread Scott David Daniels
Timothy Smith wrote: Serge Orlov wrote: ... d = Dollars(100.01) print You have %s in your account % d and get You have $1,000,000.01 in your account. thats exactly what i'm trying to do, only having to do that for all my outputs is more work then i'd like :/ why is this a misuse of

Re: MinGW building with Python 2.4

2005-03-23 Thread mrstephengross
Since the only official way to do this is pymingw, you should at least give feedback of the steps you followed, and what didn't work (1) I have Cygwin 5.1 with GCC 3.3.1 on it. (2) I unzipped Python 2.4. (3) I unzipped pyMinGW-24-0064.zip into that directory, overwriting the appropriate files.

inter threading info

2005-03-23 Thread Tertius Cronje
Hi All, Q: Is it possible for a thread on SocketServer.ThreadingTCPServer to get the socket info of *other* open thread/s and use that info to send data to the accepting client? I wrote a socketserver using SocketServer.ThreadingTCPServer. A client is connected to the server and expects multiple

[Python-Announce] cfgparse v01_01 released

2005-03-23 Thread Dan Gass
I'm pleased to announce the V01_01 release of cfgparse. Whats New - 1) Exception argument added to the Configuration parser initializer so that exceptions may be raised when user errors are encountered instead of the default call to

Re: Anonymus functions revisited

2005-03-23 Thread Ron
On 23 Mar 2005 10:13:16 GMT, Duncan Booth [EMAIL PROTECTED] wrote: Do I really need to mention that the whole concept here is broken. This only works if you call it from global scope. If you call it from inside a function it [usually] won't work: Ok... you can get globals this way if you know

Re: Anonymus functions revisited

2005-03-23 Thread Kay Schluehr
Ron wrote: On 23 Mar 2005 10:13:16 GMT, Duncan Booth [EMAIL PROTECTED] wrote: Do I really need to mention that the whole concept here is broken. This only works if you call it from global scope. If you call it from inside a function it [usually] won't work: That's only becuase it was

Re: cross platform use of set locale

2005-03-23 Thread Damjan
SUS has added numeric grouping For some numeric conversions a radix character (`decimal point') or thousands' grouping character is used. The actual character used depends on the LC_NUMERIC part of the locale. The POSIX locale uses `.' as radix

Re: Anonymus functions revisited

2005-03-23 Thread Duncan Booth
Kay Schluehr wrote: A working makeVars seems not to be different from def makeVars(**nameVals): globals().update(nameVals) Not quite. If Ron can come up with a working makeVars it would update the caller's globals whereas what you just posted updates makeVar's globals so there is a

Re: inter threading info

2005-03-23 Thread Daniel Dittmar
Tertius Cronje wrote: Q: Is it possible for a thread on SocketServer.ThreadingTCPServer to get the socket info of *other* open thread/s and use that info to send data to the accepting client? A specific socket can be used from every thread of a process. Just make sure that you synchronize

Re: Lowest hassle Python web server?

2005-03-23 Thread Larry Bates
kanzen wrote: I keep telling my friends that Python rocks. Now it's time to put my money where my mouth is. I'm about to start writing a server for a phone based game. It needs to handle simlpe requests from some Java code running on the phone at a fairly low transaction rate. There will also

Re: Python to C++ conversion substituting vectors for lists in a recursive function

2005-03-23 Thread Peter Otten
lugal wrote: Your code has an undeclared int i in main(). gseq.erase(0); I think erase() takes a pointer, not the element index: gseq.erase(qseq.begin()); in the recursive function. Is my C++ translation accurate from the original Python? Coming from a Python background, you should have

Re: getting data with proper encoding to the finish

2005-03-23 Thread Bob Kline
On Wed Mar 16 22:21:42 CET 2005 John Machin wrote: Apparently pyXLWriter doesn't handle Unicode at all. Although Unicode came in with Excel 1997 (BIFF8 format file), pyXLWriter appears to support only Excel 5(?) (BIFF5 format file). As Serge suggested, appeal to the porter to appeal to the

Re: Getting the word to conventional programmers

2005-03-23 Thread beliavsky
Advocates of languages and programming methodologies sometimes compare the current version of their favorite language to an old version of their disfavored language, resulting in skewed comparisons. For example, Conway writes Interpreted languages do two things much better than compiled

os.stat access and modify time same on WinXP

2005-03-23 Thread rbt
I'm using the standard NTFS file system. The only time the access time is updated is when the file is modified or saved (with no changes). What's up with that? Shouldn't a read/view update the access time? -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Snakelets 1.38 (simple-to-use web app server with dynamic pages)

2005-03-23 Thread Roland Heiber
Irmen de Jong wrote: I'm happy to say that Snakelets 1.38 is available. Fine thing again! Maybe someone is interested in this: I just tried tlslite and did a dirty hack so you could use snakelets via SSL. See the patch below. Snip and save it, use it against snakeserver/server.py. You've to

Snakelets via SSL

2005-03-23 Thread Roland Heiber
Hi, after Irmen de Jong did another fine release with Snakelets-1.38 i just did a dirty hack for using snakelets with SSL-support. SSL-support is added through the use of tlslite from Trevor Perrin. You'll have to download and install it from http://trevp.net/tlslite/. Furthermore you need a

Re: PyGTK Button Size Question

2005-03-23 Thread Thomas Guettler
Am Wed, 23 Mar 2005 03:02:44 -0800 schrieb Harlin Seritt: How does one set the width of a gtk.Button explicitly? and height for that matter as well... I think it is gtk.Widget.set_size_request: http://www.pygtk.org/pygtk2reference/class-gtkwidget.html#method-gtkwidget--set-size-request

Re: wanted: visual report templating system

2005-03-23 Thread Thomas Guettler
Am Tue, 22 Mar 2005 20:58:12 + schrieb robin: I am looking for a client/server reporting tool to use with a web application built in Python. It would consist of three parts: 1. a data definition retrieval engine that interfaces to RDBMS or other data files 2. a visual designer in

Re: simultaneous copy to multiple media

2005-03-23 Thread TZOTZIOY
On Mon, 21 Mar 2005 00:17:05 +0100, rumours say that Heiko Wundram [EMAIL PROTECTED] might have written: Well, 430 MB/s is only for USB 2.0. It's 480 Mb/s (megabit or mebibit, I am not sure... :), so it maxes at about 60 MB/s (or MiB/s) for all devices on the same controller. -- TZOTZIOY, I

Re: xmlrpc with Python and large datases

2005-03-23 Thread writeson
Steve, Thanks for your reply, I'll look into things based on your comments. Also, I've read your book Python Web Programming and wanted you to know it has helped me a lot with various python projects, thanks! Doug -- http://mail.python.org/mailman/listinfo/python-list

Windows, Python and low level networking

2005-03-23 Thread ias0nas
Is it possible to have low level netwoking with python under Windows? Like raw sockets? Is it possible to send a single packet using python under windows? Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to c++ conversion problem

2005-03-23 Thread Jerry Coffin
Akdes Serin wrote: I have a code in python like if eval('player.moveRoom(SeLinuxMud.Direction.' + x + ')'): # moveRoom function takes Direction enum as a parameter When I am trying to write this code in c++ if (player-moveRoom(s[1])) //s[1] is a string so it outputs an error because of not

Pattern matching from a text document

2005-03-23 Thread Ben
I'm currently trying to develop a demonstrator in python for an ontology of a football team. At present all the fit players are exported to a text document. The program reads the document in and splits each line into a string (since each fit player and their attributes is entered line by line in

Re: Windows, Python and low level networking

2005-03-23 Thread Jaime Wyant
Maybe this will help. From the interpreter - import socket help(socket) Which gives you all sorts of neat information on the socket module. jw On 23 Mar 2005 08:08:04 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Is it possible to have low level netwoking with python under Windows?

Re: os.stat access and modify time same on WinXP

2005-03-23 Thread Peter Hansen
rbt wrote: I'm using the standard NTFS file system. The only time the access time is updated is when the file is modified or saved (with no changes). What's up with that? Shouldn't a read/view update the access time? See

Re: Windows, Python and low level networking

2005-03-23 Thread Peter Hansen
[EMAIL PROTECTED] wrote: Is it possible to have low level netwoking with python under Windows? Like raw sockets? Is it possible to send a single packet using python under windows? Google is your friend: Try searching with python sockets, for example... (You *have* heard of Google, haven't you?

Re: typo in the library reference?

2005-03-23 Thread Terry Reedy
nicke [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm going to submit a bug report, just don't have much experience with that... but hey, sometime must be the first! ;) If you can, you might also look at the ossaudio source to verify that the mixup is strictly in the doc and

Re: Windows, Python and low level networking

2005-03-23 Thread Martin Franklin
[EMAIL PROTECTED] wrote: Is it possible to have low level netwoking with python under Windows? Like raw sockets? Is it possible to send a single packet using python under windows? Thank you Yes http://www.python.org/doc/2.4/lib/module-socket.html --

Re: problems with  character

2005-03-23 Thread jdonnell
Thanks for all the replies. I just got in to work so I haven't tried any of them yet. I see that I wasn't as clear as I should have been so I'll clarify a little. I'm grabbing some data from msn's rss feed. Here's an example. http://search.msn.com/results.aspx?q=domain+nameformat=rssFORM=ZZRE The

Re: setattr inside a module

2005-03-23 Thread Jeremy Bowers
On Wed, 23 Mar 2005 11:35:34 +0100, kramb64 wrote: I'm trying to use setattr inside a module. From outside a module it's easy: import spam name=hello value=1 setattr(spam, name, value) But if I want to do this inside the module spam itself, what I've to pass to setattr as first

Re: Anonymus functions revisited

2005-03-23 Thread Julian Smith
On 23 Mar 2005 08:31:36 GMT Antoon Pardon [EMAIL PROTECTED] wrote: Can someone who thinks this way, please explain why this is acceptable [ x * x for x in some_iterator ] But this is not map(lambda x: x * x, some_iteraror) and should be replaced with def sqr(x): return x * x

Re: Snakelets via SSL

2005-03-23 Thread Irmen de Jong
Roland Heiber wrote: Hi, after Irmen de Jong did another fine release with Snakelets-1.38 i just did a dirty hack for using snakelets with SSL-support. SSL-support is added through the use of tlslite from Trevor Perrin. You'll have to download and install it from http://trevp.net/tlslite/.

IronPython 0.7 released!

2005-03-23 Thread James
http://www.gotdotnet.com/workspaces/workspace.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742 -- http://mail.python.org/mailman/listinfo/python-list

Re: Anonymus functions revisited

2005-03-23 Thread George Sakkis
bruno modulix [EMAIL PROTECTED] wrote: in message news:[EMAIL PROTECTED] Ron wrote: The problem here is that Kay's proposition mixes two points: flexible tuple unpacking and a new syntax for anonymous functions. Yes, two different problems. I don't think anything needs to be done to

xml marshal of general (but non Python standard) class

2005-03-23 Thread syd
Hello all, In my project, I have container classes holding lists of item classes. For example, a container class myLibrary might hold a list of item classes myNation and associated variables like myNation.name='USA' and myNation.continent='North America'. Bottom line, I was hoping to use this

Re: os.stat access and modify time same on WinXP

2005-03-23 Thread rbt
Peter Hansen wrote: rbt wrote: I'm using the standard NTFS file system. The only time the access time is updated is when the file is modified or saved (with no changes). What's up with that? Shouldn't a read/view update the access time? See

python equivalent to the perl IDENT module

2005-03-23 Thread malachi
Is there an python equivalent to perl IDENT module, specifically the client functionality ? TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern matching from a text document

2005-03-23 Thread George Sakkis
B Ben [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm currently trying to develop a demonstrator in python for an ontology of a football team. At present all the fit players are exported to a text document. The program reads the document in and splits each line into a string

Re: Submission for Python Limmerick Contest

2005-03-23 Thread Cappy2112
No pointers, no templates, no streams, These are things found only in bad dreams, Because Explicit is with it, and static typing dismiss-ed The Best language has been.joined() at the seams! -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern matching from a text document

2005-03-23 Thread infidel
First, if you're going to loop over each line, do it like this: for line in file('playerlist.txt'): #do stuff here Second, this statement is referencing the *second* item in the list, not the first: match = ph.match(list[1]) Third, a simple splitting of the lines by some delimiter

Re: Windows, Python and low level networking

2005-03-23 Thread Martin Franklin
Peter Hansen wrote: [EMAIL PROTECTED] wrote: Is it possible to have low level netwoking with python under Windows? Like raw sockets? Is it possible to send a single packet using python under windows? Google is your friend: Try searching with python sockets, for example... (You *have* heard of

Re: Lowest hassle Python web server?

2005-03-23 Thread Gerhard Häring
Larry Bates wrote: [...] You might want to take a look a Medusa. It is the basis for the web server that is bundled in Zope. Medusa is just an asyncore framework, and not something you can develop web apps with. -- Gerhard -- http://mail.python.org/mailman/listinfo/python-list

Help me to sort.

2005-03-23 Thread BMS
Hi, I'll apreciate if you can guide me how to sort in Python. I'm doing a list and I want to sort it in ascendingor descending order. Please send me some examples. Thank you in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows, Python and low level networking

2005-03-23 Thread fraca7
[EMAIL PROTECTED] wrote: Is it possible to have low level netwoking with python under Windows? Like raw sockets? Is it possible to send a single packet using python under windows? Yes. But be aware of restrictions on raw sockets in XP SP2:

RE: Help me to sort.

2005-03-23 Thread Delaney, Timothy C (Timothy)
BMS wrote: I'll apreciate if you can guide me how to sort in Python. I'm doing a list and I want to sort it in ascending or descending order. Please send me some examples. Everything you need is right here: http://www.catb.org/~esr/faqs/smart-questions.html http://www.python.org/doc/ Tim

Re: Getting the word to conventional programmers

2005-03-23 Thread sigzero
That was a great article. I really enjoyed it. We need more like it. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: typo in the library reference?

2005-03-23 Thread nicke
On Wed, 23 Mar 2005 05:13:45 -0800 Scott David Daniels [EMAIL PROTECTED] wrote: My apologies belong in this thread. No worries, apology accepted On Wed, 23 Mar 2005 11:44:27 -0500 Terry Reedy [EMAIL PROTECTED] wrote: nicke [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

Use of descriptor __get__: what defines an object as being a class?

2005-03-23 Thread John Perks and Sarah Mount
I'm talk from the point of view of descriptors. Consider a.x = lambda self:None # simple function When a.x is later got, what criterion is used to see if a class (and so the func would have __get__(None, a) called on it)? Pre-metaclasses, one might assume it was isinstance(a, (types.TypeType,

Changing the value of a for loop index on the fly

2005-03-23 Thread Gabriel F. Alcober
Hi! There goes a newbie trouble: for i in range(0, len(subject)): if subject[i] in preps: psubject.append(noun_syn_parser(subject[0:i])) subject[0:i] = [] Since the last line eliminates some elements of the list, I'm wondering if it's somehow possible to change the

Re: Getting the word to conventional programmers

2005-03-23 Thread sigzero
Cameron Laird wrote: *DevSource* profiles The State of the Scripting Universe in URL: http://www.devsource.com/article2/0,1759,1778141,00.asp . It would have been nice to put in a blurb for some of the cool stuff planned for 8.5. That way people could see that things are *happening* in the Tcl

Re: cross platform use of set locale

2005-03-23 Thread Timothy Smith
Serge Orlov wrote: Timothy Smith wrote: Serge Orlov wrote: Timothy Smith wrote: thats ok, but how do i get it to group thousands with a , ? and thats would mean i'd have to run everything through a formatter before i displayed it :/ it'd be nicer if i could just select a proper

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Lonnie Princehouse
i = 0 while i len(subject): if subject[i] in preps: psubject.append(noun_syn_parser(subject[0:i])) subject[0:i] = [] i = 0 else: i += 1 Gabriel F. Alcober wrote: Hi! There goes a newbie trouble: for i in range(0, len(subject)): if subject[i] in preps:

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Gabriel F. Alcober
Uh! I've not even thought in using a while... Thanks! Lonnie Princehouse wrote: i = 0 while i len(subject): if subject[i] in preps: psubject.append(noun_syn_parser(subject[0:i])) subject[0:i] = [] i = 0 else: i += 1 Gabriel F. Alcober wrote: Hi! There goes a newbie trouble: for i

newbie help

2005-03-23 Thread [EMAIL PROTECTED]
static void testme( unsigned char *buf, unsigned long size, CODE code) { unsigned long data switch (code) { // Generate some test patterns case TEST1 : value = 0x0; while (size--) {

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Mitja
On Wed, 23 Mar 2005 23:27:54 +0100, Gabriel F. Alcober [EMAIL PROTECTED] wrote: Hi! There goes a newbie trouble: for i in range(0, len(subject)): if subject[i] in preps: psubject.append(noun_syn_parser(subject[0:i])) subject[0:i] = [] Since the last line

Re: IronPython 0.7 released!

2005-03-23 Thread James
François Pinard emailed me that my posting of the link with no explanation appeared rude. So here is a some information. IronPython is a Python implementation targeting the .NET and Mono platforms from the same person who brought us

  1   2   >