ANN: uuid-0.3.2 released

2006-05-12 Thread Jürgen Urner
Happy to announce the release of uuid-0.3.2 (bugfix release) What is uuid? uuid is a python module to create RFC 4122 compatible UUIDs The module supports generation off RFC 4122 compatible time based, random, sha1 and md5 based UUIDs Whats new? x. some minor changes For

ANN: Leo 4.4 Final released

2006-05-12 Thread Edward K. Ream
Leo 4.4 release Final is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html The highlights of Leo 4.4: -- -

Re: Threads

2006-05-12 Thread Alex Martelli
Peter Otten [EMAIL PROTECTED] wrote: placid wrote: I have a thread that has a job Queue, it continuosly polls this queue to see if there are any jobs for it, what i really wont to be able to do is, when the queue is empty, i want the thread to pause (or more technical, i want the

Re: Multi-line lambda proposal.

2006-05-12 Thread Sybren Stuvel
Kaz Kylheku enlightened us with: Which proposed lambda syntax is closest in this sense? I was talking about different ways (your multi-line lambda vs. the currently implemented one) of doing function decorators. Is it unusual to have a tougher time explaining X than Y to people who are

Re: syntax for -c cmd

2006-05-12 Thread Edward Elliott
Dennis Lee Bieber wrote: On Thu, 11 May 2006 20:12:55 GMT, Edward Elliott [EMAIL PROTECTED] declaimed the following in comp.lang.python: If putting the else in a separate arg unbinds it from the if, I would expect a syntax error. If OTOH naked elses are allowed on the command line for

Re: Threads

2006-05-12 Thread Edward Elliott
Dennis Lee Bieber wrote: On 11 May 2006 17:02:51 -0700, placid [EMAIL PROTECTED] declaimed the following in comp.lang.python: do is, when the queue is empty, i want the thread to pause (or more technical, i want the thread to block) until the queue gets populated again. Is this possible ?

Re: syntax for -c cmd

2006-05-12 Thread Fredrik Lundh
Edward Elliott wrote: Now this is interesting. I broke the line up into separate arguments and it seemed to work fine: $ python -c 'if 1==1: print yes' 'else: print no' yes But then I tested the else branch and it produces no output: $ python -c 'if 1==0: print yes' 'else: print no' $

Decorator

2006-05-12 Thread Lad
I use Python 2.3. I have heard about decorators in Python 2.4. What is the decorator useful for? Thanks for reply L. -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory leak in Python

2006-05-12 Thread Stephen Kellett
In message [EMAIL PROTECTED], Serge Orlov [EMAIL PROTECTED] writes The next step is to find out what type of objects contributes to the growth most of all, Shame you aren't on Windows, as Python Memory Validator does all of this. after that print several object of that type that didn't exist

Re: Calling python functions from C

2006-05-12 Thread Nigel Rowe
[EMAIL PROTECTED] wrote: I am a newbie to Python. I want to call python functions from C. I looked for examples but I couldn't get any simple one. Lets say my python code is : def add(a,b) return (a+b) I want to call add from C. Could anybody please help me? Thanks in advance. R.

Re: Threads

2006-05-12 Thread placid
Dennis Lee Bieber wrote: On 11 May 2006 17:02:51 -0700, placid [EMAIL PROTECTED] declaimed the following in comp.lang.python: I have a thread that has a job Queue, it continuosly polls this queue to see if there are any jobs for it, what i really wont to be able to do is, when the queue

Re: Decorator

2006-05-12 Thread Sybren Stuvel
Lad enlightened us with: I use Python 2.3. I have heard about decorators in Python 2.4. What is the decorator useful for? A whole lot of stuff. I've used them for: - Logging all calls to a function, including its arguments. - Ensuring there is a database connection before the function

Re: Threads

2006-05-12 Thread Sybren Stuvel
placid enlightened us with: Did you read the documentation for Queue methods? there is no need to be patronizing about this dude, im just learning Python in my spare time, as im a Intern Software Engineer There is nothing patronizing about the question, it's merely an enquiry to a

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Michele Simionato
jayessay wrote: Michele Simionato [EMAIL PROTECTED] writes: I can't get this to work at all - syntax errors (presumably you must have 2.5?, I only have 2.4). You can download Python 2.5 from www.python.org, but the important bit, i.e. the use of threading.local to get thread-local variables is

Re: pythoncode in matlab

2006-05-12 Thread Daniel Klünder
Hi Sven, I don't have Matlab on my computer so the following is just a wild guess: As far as I know you can include C code into Matlab or at least into Simulink. Maybe you could try to execute your Python script in that C code? Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Threads

2006-05-12 Thread placid
Sybren Stuvel wrote: placid enlightened us with: Did you read the documentation for Queue methods? there is no need to be patronizing about this dude, im just learning Python in my spare time, as im a Intern Software Engineer There is nothing patronizing about the question, it's

Re: Decorator

2006-05-12 Thread Paul McGuire
Lad [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I use Python 2.3. I have heard about decorators in Python 2.4. What is the decorator useful for? Thanks for reply L. Check out these examples on the Python wiki: http://wiki.python.org/moin/PythonDecoratorLibrary I've gotten to

Re: python soap web services

2006-05-12 Thread Ravi Teja
Is there any reason why there isn't any python library that makes using soap as easy as how microsoft .net makes it. SOAP with Python is easy too in a different sort of way. I don't know about the equivalent for autogenerating WSDL bit as in .NET. #!/usr/bin/env python def hello(): return

deleting texts between patterns

2006-05-12 Thread micklee74
hi say i have a text file line1 line2 line3 line4 line5 line6 abc line8 ---to be delete line9 ---to be delete line10 ---to be delete line11 ---to be delete line12 ---to be delete line13 ---to be delete xyz line15 line16 line17 line18 I wish to delete lines that are in between 'abc' and 'xyz'

New blog

2006-05-12 Thread vinu
Hi all, http://pyadmin.blogspot.com/ THis is my blog and This is related to python utilities for system and network administration.plz comment on this regards Vineesh Kumar begin:vcard fn:Vineesh Kumar n:Kumar;Vineesh email;internet:[EMAIL PROTECTED] tel;work:0484 2337929 tel;home:0480

Re: deleting texts between patterns

2006-05-12 Thread Ravi Teja
[EMAIL PROTECTED] wrote: hi say i have a text file line1 line2 line3 line4 line5 line6 abc line8 ---to be delete line9 ---to be delete line10 ---to be delete line11 ---to be delete line12 ---to be delete line13 ---to be delete xyz line15 line16 line17 line18 I wish to

Re: Reg Ex help

2006-05-12 Thread bruno at modulix
Edward Elliott wrote: (snip) don a écrit : Also if there is a better way than using regex, please let me know. (snip) I wouldn't call these better (or worse) than regexes, but a slight variation on the above: marker = s.index('/CHECKEDOUT') branch = s [s.rindex('/', 0, marker) + 1 :

Re: deleting texts between patterns

2006-05-12 Thread Duncan Booth
wrote: hi say i have a text file line1 line2 line3 line4 line5 line6 abc line8 ---to be delete line9 ---to be delete line10 ---to be delete line11 ---to be delete line12 ---to be delete line13 ---to be delete xyz line15 line16 line17 line18 I wish to delete lines

Re: deleting texts between patterns

2006-05-12 Thread Fredrik Lundh
[EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] hi say i have a text file line1 line2 line3 line4 line5 line6 abc line8 ---to be delete line9 ---to be delete line10 ---to be delete line11 ---to be delete line12 ---to be delete line13 ---to be delete xyz line15

Re: Threads

2006-05-12 Thread Sybren Stuvel
placid enlightened us with: its always said that (in programming) that the easiest solution to a problem is hard to find Yeah, that's true allright! Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the

Re: Decorator

2006-05-12 Thread bruno at modulix
Lad wrote: I use Python 2.3. I have heard about decorators in Python 2.4. What Python 2.4 adds is only syntactic sugar for decorators. You can do the same - somewhat more explicitely - in 2.3. What is the decorator useful for? FWIW, I'm not sure the name 'decorator' is such a great idea. A

Re: reusing parts of a string in RE matches?

2006-05-12 Thread Fredrik Lundh
Mirco Wahab wrote: In Python, you have to deconstruct the 2D-lists (here: long list of short lists [a,2] ...) by 'slicing the slice': char,num = list[:][:] in a loop and using the apropriate element then: import re t = 'a1a2a3Aa4a35a6b7b8c9c'; r = r'(\w)(?=(.)\1)' l

Re: Python-list Digest, Vol 32, Issue 209

2006-05-12 Thread I.V. Aprameya Rao
which files? On Fri, 12 May 2006 [EMAIL PROTECTED] wrote: Send Python-list mailing list submissions to python-list@python.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/python-list or, via email, send a message with subject

Re: syntax for -c cmd

2006-05-12 Thread Edward Elliott
Fredrik Lundh wrote: hint: $ python -c 'import sys; print sys.argv' 'else: print no' /F Yeah the man page knows all. About the only time I use python on the command line is with the timeit module, which evals all arguments given. Hence the confusion. -- Edward Elliott UC Berkeley

Re: Threads

2006-05-12 Thread antred
Aww shoot, I never knew that!! LOL, I implemented my own worker thread class using a mutex protected job list and a pair of connected sockets for interprocess communication when I could just have used the darn Queue module instead. Gr hehe. --

Re: Reg Ex help

2006-05-12 Thread Edward Elliott
bruno at modulix wrote: parts = s.replace(' ', '/').strip('/').split('/') branch = parts[parts.index('CHECKEDOUT') - 1] Edward Elliott wrote: marker = s.index('/CHECKEDOUT') branch = s [s.rindex('/', 0, marker) + 1 : marker] Much cleaner than mine. I shouldn't try to code when it's

Python Translation of C# DES Encryption

2006-05-12 Thread Andreas Pauley
Hi all, I'm trying to implement a Python equivalent of a C# method that encrypts a string. My Python attempt is in the attached file, but does not return the same value as the C# method (see below). Any hints? Thanks, Andreas The C# method: public static string Encrypt(string decrypted) {

Re: Can Python installation be as clean as PHP?

2006-05-12 Thread Fredrik Lundh
Ravi Teja wrote: Python has zip imports (similar to Java's jar files). You can put all your *.py files in a zip file and access them from it if this means so much to you. Python also supports frozen modules, where the module bytecode is linked into a Python interpreter as data. by combining

Re: deleting texts between patterns

2006-05-12 Thread John Machin
On 12/05/2006 6:11 PM, Ravi Teja wrote: [EMAIL PROTECTED] wrote: hi say i have a text file line1 [snip] line6 abc line8 ---to be delete [snip] line13 ---to be delete xyz line15 [snip] line18 I wish to delete lines that are in between 'abc' and 'xyz' and print the rest of the lines.

Re: deleting texts between patterns

2006-05-12 Thread bruno at modulix
[EMAIL PROTECTED] wrote: hi say i have a text file line1 line2 line3 line4 line5 line6 abc line8 ---to be delete line9 ---to be delete line10 ---to be delete line11 ---to be delete line12 ---to be delete line13 ---to be delete xyz line15 line16 line17 line18 I wish to

compiling module from string and put into namespace

2006-05-12 Thread glomde
Hi, I want to create a function that preprocesses a file and then imports the parsed file. What I found out is that you can do something like this: def ImportFile(fileName): parsedCode = Parser(fileName).Parse() module = new.module(name) exec parsedCode in module.__dict__

index of an element in a numarray array

2006-05-12 Thread avharut
hello everyone! sorry to disturb you with this, but i really cant find anything suitable about the topic in the numarray documentation. how can i find in an efficient way the index of the last occurrence of a given element in a numarray array? many thanks in advance! --

Re: Possible constant assignment operators := and ::= for Python

2006-05-12 Thread Piet van Oostrum
[EMAIL PROTECTED] (T) wrote: T As you can see, the constant A can be modified this easily. But if T there were an intuitive mechanism to declare a symbol to be immutable, T then there won't be this problem. Mutability is not a property of symbols but of values. So it doesn't make sense to

Is there any pure python webserver that can use FCGI

2006-05-12 Thread llothar
Hello, as the subject says, for an embedded application i need a 100% pure python webserver that can talk to a FCGI process (which runs ruby on rails). Of couse it also must be able to use simple CGI. Please don't ask why i want a python webserver for a ruby application. I just need it. --

Re: Python memory deallocate

2006-05-12 Thread Fredrik Lundh
bruno at modulix wrote: *please* re-read carefully what I and Diez wrote earlier in this thread before jumping to possibly erroneous conclusion. I didn't say that the problem *actually* was with Python - just that it *may* have to do with a memory management issue fixed in 2.5. the only

Re: Python memory deallocate

2006-05-12 Thread Fredrik Lundh
Heiko Wundram wrote: PIL isn't known to have any memory leaks, by the way (AFAICT), just to confirm what I've written before, but the effbot should be of more help here... PIL is heavily used in 24/7 production systems, often by people who knows a lot about how to run mission critical systems,

State of the Vaults of Parnassus

2006-05-12 Thread Christoph Zwerschke
Does anybody know what happened to the Vaults of Parnassus site at http://www.vex.net/~x/parnassus/? Dr Dobb's weekly Python news still claims that it ambitiously collects references to all sorts of Python resources. But I have the impression that it does not do this any more since April 2005,

Re: python soap web services

2006-05-12 Thread Diez B. Roggisch
Butternut squash wrote: Is there any reason why there isn't any python library that makes using soap as easy as how microsoft .net makes it. I mean I write rudimentary asmx files call them from a webbrowser. The WSDL is generated and then there is documentation and a form to invoke a

Re: compiling module from string and put into namespace

2006-05-12 Thread bruno at modulix
glomde wrote: Hi, I want to create a function that preprocesses a file and then imports the parsed file. What I found out is that you can do something like this: def ImportFile(fileName): parsedCode = Parser(fileName).Parse() module = new.module(name) exec parsedCode in

Re: deleting texts between patterns

2006-05-12 Thread bruno at modulix
bruno at modulix wrote: [EMAIL PROTECTED] wrote: (snip) Don't know if it's better for your actual use case, but this avoids reading up the whole file: def skip(iterable, skipfrom, skipuntil): example usage : f = open(/path/to/my/file.txt) for line in skip_print(f, 'abc',

Re: deleting texts between patterns

2006-05-12 Thread bruno at modulix
Fredrik Lundh wrote: (snip) to print to a file instead of stdout, just replace the print line with a f.write call. Or redirect stdout to a file when calling the program !-) -- bruno desthuilliers python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL

Re: which windows python to use?

2006-05-12 Thread Don Taylor
Robert Kern wrote: In what way? Does the mingw gcc that we distribute interfere with Cygwin's gcc? Robert: Which C compiler will you be using for the Enthought 2.4 Windows release? Don. -- http://mail.python.org/mailman/listinfo/python-list

Re: NEWBIE: Tokenize command output

2006-05-12 Thread bruno at modulix
Tim Chase wrote: (snip) starLines = [line for line in p.readlines() if line.startswith(*)] files are iterators, so no need to use readlines() (unless it's an old Python version of course): starLines = [line for line in p if line.startswith(*)] or you may optionally want to prune of the \n

Re: Python memory deallocate

2006-05-12 Thread bruno at modulix
Fredrik Lundh wrote: bruno at modulix wrote: *please* re-read carefully what I and Diez wrote earlier in this thread before jumping to possibly erroneous conclusion. I didn't say that the problem *actually* was with Python - just that it *may* have to do with a memory management issue fixed

Re: design a Condition class

2006-05-12 Thread bruno at modulix
Carl J. Van Arsdall wrote: (snip) I just wanted to make the comment that there already exists a Condition() class in the threading module. If you plan on using your class with the threading module you might wish to use another name. As far as I remember, Python has namespaces, so I don't see

Re: New tail recursion decorator

2006-05-12 Thread Tim N. van der Leeuw
[...] I'm not convinced by this. You have to recognise that the function is using tail recursion, and then you have to modify the code to know that it is using tail recursion. This is not always trivial. For example, the given example is: @tail_recursion def factorial(n, acc=1):

Re: deleting texts between patterns

2006-05-12 Thread Tim Chase
I wish to delete lines that are in between 'abc' and 'xyz' and print the rest of the lines. Which is the best way to do it? While this *is* the python list, you don't specify whether this is the end goal, or whether it's part of a larger program. If it *is* the end goal (namely, you just want

Re: index of an element in a numarray array

2006-05-12 Thread rory . brandybuck
[EMAIL PROTECTED] wrote: how can i find in an efficient way the index of the last occurrence of a given element in a numarray array? Something like that: where(arange(100) == 10) (array([10]),) _[-1][-1] 10 Or: your_array = arange(10) value = 3 indices = where(your_array == value)

Creating an Active Desktop Window

2006-05-12 Thread rodmc
Hi, Does anyone know how I can create an Active Desktop window from within a Python script? It would also be good to know how to refresh that window and nothing else. At present I have an application which writes to a file which is read by the Active Desktop (embeded IE), then a refresh command

Re: New tail recursion decorator

2006-05-12 Thread Michele Simionato
Tim N. van der Leeuw wrote: I don't know why it wouldn't work this way, or why it isn't tail-recursion? From the google page do define: tail recursion I tried the tail_recursion decorator from the cookbook-recipe with both definitions of factorial, and I tried both definitions of the

Re: design a Condition class

2006-05-12 Thread bruno at modulix
[EMAIL PROTECTED] wrote: Hello, i posted for suggestions a little idea even if it still needs further thoughts but as i'm sure you could help :) if would like to implement some kind of Condition class which i coud use to build bricks of more complex condition, conditions are based on

Re: linking with math.so

2006-05-12 Thread Heiko Wundram
Am Donnerstag 11 Mai 2006 18:49 schrieb [EMAIL PROTECTED]: importing math as far as I can tell right now, invokes a shared library (math.so). Now I have a shared library dependency that I dont want. Is there a way to get the math functionality from a dot a or a dot o, so I dont have to

Re: NEWBIE: Tokenize command output

2006-05-12 Thread Tim Chase
starLines = [line for line in p.readlines() if line.startswith(*)] files are iterators, so no need to use readlines() (unless it's an old Python version of course): starLines = [line for line in p if line.startswith(*)] Having started with some old Python, it's one of those things I know,

Re: Python memory deallocate

2006-05-12 Thread Heiko Wundram
Am Donnerstag 11 Mai 2006 18:07 schrieb Michele Petrazzo: Heiko Wundram wrote: As was said before: as long as you keep a reference to an object, the object's storage _will not be_ reused by Python for any other objects (which is sensible, or would you like your object to be overwritten by

RE: multi-threaded c++ callback problem

2006-05-12 Thread Ames Andreas
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] g] On Behalf Of pydev Sent: Tuesday, April 11, 2006 9:23 PM Subject: multi-threaded c++ callback problem void pyCallEventCallback( CALL hCall, LINE hLine,

Re: NEWBIE: Tokenize command output

2006-05-12 Thread bruno at modulix
Tim Chase wrote: starLines = [line for line in p.readlines() if line.startswith(*)] files are iterators, so no need to use readlines() (unless it's an old Python version of course): starLines = [line for line in p if line.startswith(*)] Having started with some old Python, it's one of

Re: New tail recursion decorator

2006-05-12 Thread Tim N. van der Leeuw
Hi Michele, I'm sorry, but you misunderstood me. There are two definitions of the factorial() function, one given by the OP and the other given by Duncan. I tested both factorial() definitions with, and without the tail_recursion decorator (the version of the OP). So I had 4 factorial-functions

nix logon in Python

2006-05-12 Thread Philippe Martin
Hi, Are there any (even prototypes/proof of concept) gdm/kdm/xdm.../-style packages written in Python ? Regards, Philippe -- http://mail.python.org/mailman/listinfo/python-list

where do you run database scripts/where are DBs 'located'?

2006-05-12 Thread John Salerno
Ok, I've been browsing through the MySQLdb docs, and I *think* I know the kind of code I need to write (connect, cursor, manipulate data, commmit, etc. -- although I probably need to get more familiar with actual SQL commands too), but here's my problem: I don't know where these scripts are

Re: Decorator

2006-05-12 Thread Martin Blume
bruno at modulix schrieb What Python 2.4 adds is only syntactic sugar for decorators. You can do the same - somewhat more explicitely - in 2.3. What is the decorator useful for? The whole things looks like this: def deco(func): print decorating %s % func.__name__ def

Re: index of an element in a numarray array

2006-05-12 Thread avharut
thanks alot!! -- http://mail.python.org/mailman/listinfo/python-list

[OT] Unix Tools (was: deleting texts between patterns)

2006-05-12 Thread Dan Sommers
On Fri, 12 May 2006 07:29:54 -0500, Tim Chase [EMAIL PROTECTED] wrote: I wish to delete lines that are in between 'abc' and 'xyz' and print the rest of the lines. Which is the best way to do it? While this *is* the python list, you don't specify whether this is the end goal, or whether it's

Re: New tail recursion decorator

2006-05-12 Thread Duncan Booth
Tim N. van der Leeuw wrote: The other thing I do not understand, due to my limited understanding of what is tail-recursion: factorial2 (Duncan's definition) is not proper tail-recursion. Why not? How does it differ from 'real' tail recursion? Tail recursion is when a function calls itself and

Re: NEWBIE: Tokenize command output

2006-05-12 Thread Tim Chase
I reeducated my fingers after having troubles with huge files !-) I'll keep it in mind...the prospect of future trouble with large files is a good kick-in-the-pants to remember. Otherwise, just to be informed, what advantage does rstrip() have over [:-1] (if the two cases are considered

Re: New tail recursion decorator

2006-05-12 Thread Tim N. van der Leeuw
Duncan Booth wrote: Tim N. van der Leeuw wrote: [...] @tail_recursion def factorial2(n): # do the stuff pass your 'do the stuff' actually had an erroneous call to 'factorial'. If you are going to rename the function you have to rename the recursive calls as well. (At least,

Re: NEWBIE: Tokenize command output

2006-05-12 Thread Duncan Booth
bruno at modulix wrote: Otherwise, just to be informed, what advantage does rstrip() have over [:-1] (if the two cases are considered uneventfully the same)? 1/ if your line doesn't end with a newline, line[:-1] will still remove the last caracter. In particular, if the last line of the

Re: Threads

2006-05-12 Thread Grant Edwards
On 2006-05-12, antred [EMAIL PROTECTED] wrote: Nerver knew what? Please quote for context. Aww shoot, I never knew that!! http://docs.python.org/lib/QueueObjects.html get([block[, timeout]]) Remove and return an item from the queue. If optional args block is true and timeout is

Re: Threads

2006-05-12 Thread Grant Edwards
On 2006-05-12, Sybren Stuvel [EMAIL PROTECTED] wrote: placid enlightened us with: Did you read the documentation for Queue methods? there is no need to be patronizing about this dude, im just learning Python in my spare time, as im a Intern Software Engineer There is nothing patronizing

listener program in Python

2006-05-12 Thread diffuser78
I want to write a simple clinet/server program that does the following. On Windows, the program listens to the request from linux box On Linux Box, client program send server a shutdown request and the program at server i.e windows shuts windows sown, I basically want to remotely shut down

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread jayessay
Michele Simionato [EMAIL PROTECTED] writes: I was interested in a proof of concept, to show that Python can emulate Lisp special variables with no big effort. OK, but the sort of proof of concept given here is something you can hack up in pretty much anything. So, I wouldn't call it

Re: where do you run database scripts/where are DBs 'located'?

2006-05-12 Thread CatDude
On Fri, 12 May 2006 14:01:51 +, John Salerno wrote: Ok, I've been browsing through the MySQLdb docs, and I *think* I know the kind of code I need to write (connect, cursor, manipulate data, commmit, etc. -- although I probably need to get more familiar with actual SQL commands too),

Re: listener program in Python

2006-05-12 Thread simon . hibbs
[EMAIL PROTECTED] wrote: I basically want to remotely shut down windows from linux and write such a program in python. You probably don't need to write a service in windows for this. All you need is to write your Linux python program with an SNMP library and configure the Windows box to accept

Re: find all index positions

2006-05-12 Thread vbgunz
Hello John, Thank you very much for your pointers! I decided to redo it and try to implement your suggestion. I think I did a fair job and because of your suggestion have a better iterator. Thank you! def indexer(string, substring, overlap=1): '''indexer(string, substring, [overlap=1]) - int

Re: where do you run database scripts/where are DBs 'located'?

2006-05-12 Thread John Salerno
CatDude wrote: On Fri, 12 May 2006 14:01:51 +, John Salerno wrote: Ok, I've been browsing through the MySQLdb docs, and I *think* I know the kind of code I need to write (connect, cursor, manipulate data, commmit, etc. -- although I probably need to get more familiar with actual SQL

Re: find all index positions

2006-05-12 Thread vbgunz
I forgot to explain my reason for over shadowing the 'string' built-in within my iterator. To me, it doesn't matter because the string identifier is temporary within the function and dies when the function dies. Also, I personally don't use the string function and prefer ''.join('hi'), etc. Also,

Re: Decorator

2006-05-12 Thread Sybren Stuvel
Martin Blume enlightened us with: Another question: Isn't decorating / wrapping usually done at runtime, so that the @deco notation is pretty useless (because you'd have to change the original code)? Please explain why that would make the @deco notation pretty useless. Sybren -- The problem

Re: Time to bundle PythonWin

2006-05-12 Thread Dave Benjamin
On Thu, 11 May 2006, Alex Martelli wrote: Dave Benjamin [EMAIL PROTECTED] wrote: ... It's time to bundle PythonWin. No: the Python Standard Distribution, in 2.5, includes instead ctypes, which is lower-level than PythonWin but more general (exists for other platforms, lets you call other

Re: Decorator

2006-05-12 Thread bruno at modulix
Martin Blume wrote: bruno at modulix schrieb (snip) def deco(func): print decorating %s % func.__name__ def _wrapper(*args, **kw): print %s called % func.__name__ res = func(*args, **kw) print %s returned %s % (func.__name__, str(res)) return res ^^

Re: NEWBIE: Tokenize command output

2006-05-12 Thread bruno at modulix
Duncan Booth wrote: bruno at modulix wrote: Otherwise, just to be informed, what advantage does rstrip() have over [:-1] (if the two cases are considered uneventfully the same)? 1/ if your line doesn't end with a newline, line[:-1] will still remove the last caracter. In particular, if

Re: listener program in Python

2006-05-12 Thread bruno at modulix
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I basically want to remotely shut down windows from linux and write such a program in python. FWIW, s/from linux/from another machine/ -- bruno desthuilliers python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in

Re: which windows python to use?

2006-05-12 Thread Robert Kern
Robert Kern wrote: James Stroud wrote: Robert Kern wrote: James Stroud wrote: Enthought does not play well with cygwin, I've noticed. In what way? Does the mingw gcc that we distribute interfere with Cygwin's gcc? One can not run the enthought python interactive interpreter from a cygwin

Re: Replace

2006-05-12 Thread Anthra Norell
se = SE.SE (r' ~=.~=\=#') se ('tyrtrbd =ffgtyuf == =tyryr =u=p ff') 'tyrtrbd =#fgtyuf =# =#yryr =#=# ff' I am in the final stages of documenting my stream editor SE. There are quite a few problems raised on this list which SE would handle elegantly. Where do I propose it for

Re: New tail recursion decorator

2006-05-12 Thread Kay Schluehr
Duncan Booth wrote: The decorator also fails for functions which are tail-recursive but which contain other non-tail recursive calls within themselves. For example I would be pretty sure you couldn't write a working implementation of Ackermann's function using the decorator: def Ack(M, N):

Re: which windows python to use?

2006-05-12 Thread Robert Kern
Don Taylor wrote: Robert Kern wrote: In what way? Does the mingw gcc that we distribute interfere with Cygwin's gcc? Robert: Which C compiler will you be using for the Enthought 2.4 Windows release? Define using. We build Python with whatever compiler the official build is compiled

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Alexander Schmolck
jayessay [EMAIL PROTECTED] writes: Michele Simionato [EMAIL PROTECTED] writes: I was interested in a proof of concept, to show that Python can emulate Lisp special variables with no big effort. OK, but the sort of proof of concept given here is something you can hack up in pretty much

TkTable for info gathering

2006-05-12 Thread Gary Wessle
Hi I just finished with 1.5 tutorials about Tkinter, my thought is to use a table maybe TkTable to gather info from the user as to what file to chart data from, as well as info provided by the TkTable properties. each cell of the table will be either empty or contains a file path, let x=1 be

Re: New tail recursion decorator

2006-05-12 Thread Alexander Schmolck
Duncan Booth [EMAIL PROTECTED] writes: Tim N. van der Leeuw wrote: The other thing I do not understand, due to my limited understanding of what is tail-recursion: factorial2 (Duncan's definition) is not proper tail-recursion. Why not? How does it differ from 'real' tail recursion?

Re: Reg Ex help

2006-05-12 Thread Anthra Norell
se = SE.SE ('EAT ~/[A-Za-z0-9_]+/CHECKEDOUT~== | /= CHECKEDOUT=') se ('/main/parallel_branch_1/release_branch_1.0/dbg_for_python/CHECKEDOUT') 'dbg_for_python' If I understand your problem, this might be a solution. It is a stream editor I devised on the impression that it could handle in a

Best Mobile Devices for Python

2006-05-12 Thread Jeremy Winters
I have a project where I need to remote control one computer through a wireless tcp/ip connection in my home through a linksys router.I know there are versions of python that have been ported to mobile devices... but the whole arena of mobile devices is kind of intimidating... as it's hard to get

Re: Decorator

2006-05-12 Thread Martin Blume
Sybren Stuvel schrieb Martin Blume enlightened us with: Don't know if I enlightened anybody ... :-) Another question: Isn't decorating / wrapping usually done at runtime, so that the @deco notation is pretty useless (because you'd have to change the original code)? Please explain

Re: Decorator

2006-05-12 Thread Martin Blume
bruno at modulix schrieb [snip] The use case for @decorator is for wrapping functions or method *in the module/class itself*. That was the question. What's the use of doing it like that in the module *itself* (I mean, you change directly the original function)? It's not for module

Re: Decorator

2006-05-12 Thread bruno at modulix
Martin Blume wrote: Sybren Stuvel schrieb Martin Blume enlightened us with: Don't know if I enlightened anybody ... :-) Not sure... But let's hope someone else having doubts about @decorator will find this thread, so we won't have to point him/her to the documentation. Another question:

Discussion: Python and OpenMP

2006-05-12 Thread Carl J. Van Arsdall
Hey everyone, I know I've posted several questions regarding python and python's parallel capabilities so bear with me as I've never attempted to incite discussion. However, today I'm interested in sparking discussion over having an OpenMP style of interface in python. For those of you

Re: How to get a part of string which follows a particular pattern usingshell script

2006-05-12 Thread Anthra Norell
This is the third problem today which I propose to solve with my stream editor SE. If the group thinks it could be useful I would submit it the moment I'm done with the doc, which is in the final stage. Frederic se = SE.SE ('EAT ~addr=[0-9.]+~==(10) | addr\== ') string =

Re: which is better, string concatentation or substitution?

2006-05-12 Thread bruno at modulix
Ted wrote: Thank you Roy. It seems if you lurk here long enough you eventually get all you questions answered without even asking! ;-) +1 QOTW OT please avoid top-posting, and please avoid posting back a long message just to add three lines. /OT -- bruno desthuilliers python -c print

  1   2   >