Re: shelve error

2007-04-09 Thread Peter Otten
Alex Martelli wrote: > BTW, if you DO want to call shelve.open on a path f that may correspond > to an arbitrary existing file (and want to toss away the previous > contents of that file, if any) the correct way to call is then: > > s = shelve.open(whatever_path, 'n') > > since 'n' truncates an

Classes with initialization

2007-04-09 Thread mariano . suarezalvarez
Hi all, I'm currently using code similar to this: class ClassWithInitialization(type): def __init__(cls, name, bases, dict): type.__init__(name, bases, dict) dict['__class_init__'](cls) class A: __metaclass__ = ClassWithInitialization def __class_init__

Re: tuples, index method, Python's design

2007-04-09 Thread Georg Brandl
Paul Rubin schrieb: > Carsten Haese <[EMAIL PROTECTED]> writes: >> Will tuples also get a sort method? What about append and extend? pop? >> __iadd__? __delslice__? > > They are immutable so they won't get .sort() etc. sorted(...) already > works on them. > >> How many brain cells are actually f

Re: tuples, index method, Python's design

2007-04-09 Thread Georg Brandl
Paul Rubin schrieb: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> I think the problem is that Python developers are split between those who >> see tuples as immutable lists, and those who see them as records/structs. > > I think the construction > >def f(*a): ... > > shows that the "immut

Re: Unicode problem

2007-04-09 Thread Georg Brandl
Martin v. Löwis schrieb: >> Thanks! That's a nice little stumbling block for a newbie like me ;) Is >> there a way to make utf-8 the default encoding for every string, so that >> I do not have to encode each string explicitly? > > You can make sys.stdout encode each string with UTF-8, with > >

how do i configure Python2.3.6 on Solaris 10

2007-04-09 Thread Satish S Nandihalli
following errors were found on executing configure file: 1) configure: WARNING: thread.h: present but cannot be compiled configure: WARNING: thread.h: check for missing prerequisite headers? configure: WARNING: thread.h: see the Autoconf documentation configure: WARNING: thread.h: section

Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

2007-04-09 Thread 人言落日是天涯,望极天涯不见家
Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']? The range() just can generate the numeric list. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

2007-04-09 Thread Michael Bentley
On Apr 9, 2007, at 3:29 AM, 人言落日是天涯,望极天涯不 见家 wrote: > Is there a simple function to generate a list like ['a', 'b', 'c', ... > 'z']? The range() just can generate the numeric list. import string list(string.lowercase) -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

2007-04-09 Thread Thomas Krüger
人言落日是天涯,望极天涯不见家 schrieb: > Is there a simple function to generate a list like ['a', 'b', 'c', ... > 'z']? The range() just can generate the numeric list. There is: [ chr(i) for i in range(97, 123) ] Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

2007-04-09 Thread 人言落日是天涯,望极天涯不见家
On Apr 9, 4:35 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 9, 2007, at 3:29 AM, 人言落日是天涯,望极天涯不 > > 见家 wrote: > > Is there a simple function to generate a list like ['a', 'b', 'c', ... > > 'z']?   The range() just can generate the numeric list. > > import string > list(string.lowercase)

Re: Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

2007-04-09 Thread 7stud
On Apr 9, 2:29 am, "人言落日是天涯,望极天涯不见家" <[EMAIL PROTECTED]> wrote: > Is there a simple function to generate a list like ['a', 'b', 'c', ... > 'z']?   The range() just can generate the numeric list. Not very simple, but how about a list comprehension: import string lst = [char for char in string.let

Re: Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

2007-04-09 Thread 人言落日是天涯,望极天涯不见家
On Apr 9, 4:39 pm, Thomas Krüger <[EMAIL PROTECTED]> wrote: > 人言落日是天涯,望极天涯不见家 schrieb: > > > Is there a simple function to generate a list like ['a', 'b', 'c', ... > > 'z']?   The range() just can generate the numeric list. > > There is: > [ chr(i) for i in range(97, 123) ] > > Thomas Thanks you t

pluie documentation in english

2007-04-09 Thread [EMAIL PROTECTED]
I have converted the pluie documentation from french to english in a pdf. There may be some errors due to translation of the commands themselves that I have not fixed yet. I am still playing around with the library to see if it is of any use so there may be more documentation to come.. http

Kill thread

2007-04-09 Thread Teja
Hi all, Can any on help me out in killing a thread (i.e deleteing the reources like, stack ,memory etc) which is started with win32process.beginthreadex()??? Rite now, I am suspending the thread. But any pointers as to how to delete the thread permanently? Its pretty urgent... Please... Teja.P

Re: pluie documentation in english

2007-04-09 Thread Michel Claveau
Hi! Bonjour ! Thanks very well for translation. Merci beaucoup pour la traduction. I add a link on the index page of the site. J'ai ajouté un lien vers le document, dans la page d'accueil. Site: http://www.ponx.org/ponx/guie.htm But... I hope complete the (french) doc in next days. Mais... J'

Re: pluie documentation in english

2007-04-09 Thread [EMAIL PROTECTED]
On Apr 9, 4:25 am, Michel Claveau <[EMAIL PROTECTED]> wrote: > Hi! > Bonjour ! > > Thanks very well for translation. > Merci beaucoup pour la traduction. > > I add a link on the index page of the site. > J'ai ajouté un lien vers le document, dans la page d'accueil. > > Site:http://www.ponx.org/ponx

Re: Kill thread

2007-04-09 Thread Michel Claveau
Hi! If you have the PID of the process (example: 1234), use this command-line : TASKKILL /F /PID 1234 -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

2007-04-09 Thread [EMAIL PROTECTED]
map(chr,range(65,91)) /Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Crypto Suggestion/Help

2007-04-09 Thread Jimmy E Touma
Paul, Thanks for the reply. Yes the shop has only one machine and many users use it to perform transactions. Maybe a basic Linux/Unix permissions will do as Thomas Kruger suggested in the thread following you. --Jimmy Paul Rubin wrote: > Jimmy E Touma <[EMAIL PROTECTED]> writes: >> I need some ad

Re: pluie documentation in english

2007-04-09 Thread [EMAIL PROTECTED]
On Apr 9, 4:25 am, Michel Claveau <[EMAIL PROTECTED]> wrote: > Hi! > Bonjour ! > > Thanks very well for translation. > Merci beaucoup pour la traduction. > > I add a link on the index page of the site. > J'ai ajouté un lien vers le document, dans la page d'accueil. > > Site:http://www.ponx.org/ponx

how to use the string '\\.\'

2007-04-09 Thread 人言落日是天涯,望极天涯不见家
print r'\\.\' This line will cause error. I just want to print the \\.\ why the prefix character "r" isn't effective. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Memory allocation problem with python 2.4.3

2007-04-09 Thread Brice-Olivier Demory
Hi, I'm encountering an odd problem while running a python script which calls a C program called 'st_time' : Traceback (most recent call last): File "ccdd.py", line 177, in ? answer=proc_request(conn,addr,request) # proc the request File "ccdd.py", line 69, in proc_re

Re: how to use the string '\\.\'

2007-04-09 Thread Tim Golden
人言落日是天涯,望极天涯不见家 wrote: > print r'\\.\' > > This line will cause error. I just want to print the > \\.\ > why the prefix character "r" isn't effective. Thanks! Because of the way in which Python parses strings, you can't end a string -- even a raw one -- with an odd (1, 3, 5 etc) number of backsla

Re: how to use the string '\\.\'

2007-04-09 Thread Duncan Booth
"=?utf-8?B?5Lq66KiA6JC95pel5piv5aSp5rav77yM5pyb5p6B5aSp5rav5LiN6KeB5a62?=" <[EMAIL PROTECTED]> wrote: > print r'\\.\' > > This line will cause error. I just want to print the > \\.\ > why the prefix character "r" isn't effective. Thanks! > > See the FAQ: http://www.python.org/doc/faq/general

Re: Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

2007-04-09 Thread Duncan Booth
Michael Bentley <[EMAIL PROTECTED]> wrote: > > On Apr 9, 2007, at 3:29 AM, 人言落日是天涯,望极天涯不 > 见家 wrote: > >> Is there a simple function to generate a list like ['a', 'b', 'c', ... >> 'z']? The range() just can generate the numeric list. > > > import string > list(

Re: SNMP agent

2007-04-09 Thread [EMAIL PROTECTED]
Consider taking a look at pysnmp-4 -- it has been designed with Agent role in mind. Here's an example Agent script: http://pysnmp.sourceforge.net/examples/4.x/v3arch/agent/cmdrsp.html > I have a Python app and i would like to add someSNMPagent > functionality to it. -- http://mail.python.org/ma

Re: Kill thread

2007-04-09 Thread Teja
On Apr 9, 3:01 pm, Michel Claveau <[EMAIL PROTECTED]> wrote: > Hi! > > If you have the PID of the process (example: 1234), use this > command-line : >TASKKILL/F /PID 1234 > > -- > @-salutations > > Michel Claveau Hi Michel, Thnks for the replyBut TASKKILL kills the process entirely..N

Re: Comments in ConfigParser module

2007-04-09 Thread James Stroud
Joel Granados wrote: > > > On 4/6/07, *James Stroud* <[EMAIL PROTECTED] > > wrote: > > Joel Andres Granados wrote: > > Hi list: > > Any comment greatly appreciated > > Very clever. > -- > http://mail.python.org/mailman/listinfo/python-lis

[offtopic?] problem with UDP broadcast on Windows XP

2007-04-09 Thread Irmen de Jong
Hello Sorry this might be a bit offtopic but I don't really know where else to post this question. If you could point me in the right direction that is much appreciated. I'm running into a weird thing on Windows XP. I'm using Python 2.5 with latest pywin32 from Mark Hammond. I have this UDP soc

Re: Crypto Suggestion/Help

2007-04-09 Thread James Stroud
Jimmy E Touma wrote: > Hi all, > > I need some advise on doing the following. I have a Linux application > that allows users to access it via a code (password). At the end of the > day, I gather a log of activities of the users and zip the file and > would like to encrypt it so that the users can

Re: Nice "bug" to loose a contest

2007-04-09 Thread azi . stdout
On Apr 8, 1:40 pm, "aspineux" <[EMAIL PROTECTED]> wrote: > This code works like the python one, > I dont use buffered stdio f... functions, > but the more 'system call' read and write > > int main() > { > char buf[120]; > int len; > > while (len=read(1, buf, sizeof(buf))) { > wr

Re: Console UI

2007-04-09 Thread Jeremy Sanders
Clement wrote: > My project is based on console Application. Is there any console UI > except urwid. If so, can i come to know. You might try pytvision, http://pytvision.sourceforge.net/ , which are python bindings for a of the old borland turbovision environment (see http://tvision.sourceforge.

Re: Nice "bug" to loose a contest

2007-04-09 Thread Gabriel Genellina
En Mon, 09 Apr 2007 09:19:16 -0300, <[EMAIL PROTECTED]> escribió: > Yeah, I've noticed that too, altough I'm clueless on how stdio handles > that differently. Now I'm wondering, what's the behaviour of the > Python snippet that reads from stdout in Windows.. Can someone on > Windows try it and rep

Re: [offtopic?] problem with UDP broadcast on Windows XP

2007-04-09 Thread Gabriel Genellina
En Mon, 09 Apr 2007 08:43:23 -0300, Irmen de Jong <[EMAIL PROTECTED]> escribió: > I have this UDP socket server that binds on ('',9090) and is used > to be a broadcast responder. It works fine when I start the server > from the cmd prompt. UDP broadcast packets sent to ('',9090) > arrive in the

Re: tuples are useless???

2007-04-09 Thread Steven D'Aprano
On Sun, 08 Apr 2007 22:20:45 -0700, James Stroud wrote: > Steven D'Aprano wrote: >> On Mon, 09 Apr 2007 02:26:37 +, James Stroud wrote: >> >>> Bart Willems wrote: James Stroud wrote: > ... It boils down to the fact that tuples are useless as a result > unless you know you really

Breaking up Strings correctly:

2007-04-09 Thread Michael Yanowitz
Hello: I have been searching for an easy solution, and hopefully one has already been written, so I don't want to reinvent the wheel: Suppose I have a string of expressions such as: "((($IP = "127.1.2.3") AND ($AX < 15)) OR (($IP = "127.1.2.4") AND ($AY != 0))) I would like to split up in

Re: Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

2007-04-09 Thread Steven D'Aprano
On Mon, 09 Apr 2007 01:43:11 -0700, 7stud wrote: >> Is there a simple function to generate a list like ['a', 'b', 'c', ... >> 'z']?   The range() just can generate the numeric list. > > Not very simple, but how about a list comprehension: > > import string > > lst = [char for char in string.let

Re: tuples, index method, Python's design

2007-04-09 Thread Carsten Haese
On Mon, 2007-04-09 at 11:50 +1000, Steven D'Aprano wrote: > On Sun, 08 Apr 2007 20:10:21 -0400, Carsten Haese wrote: > > Will tuples also get a sort method? What about append and extend? pop? > > __iadd__? __delslice__? > > Since tuples are immutable, no. > [...] > > If you see tuples as an immut

Re: "Plugin" architecture - how to do?

2007-04-09 Thread anglozaxxon
On Apr 6, 9:59 am, "Nate Finch" <[EMAIL PROTECTED]> wrote: > On Apr 5, 10:57 am, [EMAIL PROTECTED] wrote: > > > I'm making a program that consists of a main engine + plugins. Both > > are in Python. My question is, how do I go about importing arbitrary > > code and have it be able to use the engi

Re: how to use the string '\\.\'

2007-04-09 Thread Gabriel Genellina
En Mon, 09 Apr 2007 08:21:44 -0300, Duncan Booth <[EMAIL PROTECTED]> escribió: > <[EMAIL PROTECTED]> wrote: > >> print r'\\.\' > > See the FAQ: > http://www.python.org/doc/faq/general/#why-can-t-raw-strings-r-strings-end-with-a-backslash This form is not included in the FAQ alternatives (should

Using/finding ODBC and DBI

2007-04-09 Thread Boudreau, Emile
Hello all, I'm trying to use ODBC and DBI but I don't seem to have the right files on my system. I have looked around and I can't find what I'm looking for. From the information I have been able to find these are not part of the standard python library. True?? Where can I find the modules that I'm

Managing a file buffer

2007-04-09 Thread David Johnson
Hi, I have an application that reads video from a socket and saves it to a file, which I then play using GStreamer. The major problem with this approach is that the file keeps getting bigger and bigger until the disk is full ;-) What I'd like to do is have a buffer, say 5MB in size, which I can

Re: Kill thread

2007-04-09 Thread Christian
On Apr 9, 5:14 am, "Teja" <[EMAIL PROTECTED]> wrote: > Hi all, > > Can any on help me out in killing a thread (i.e deleteing the reources > like, stack ,memory etc) which is started with > win32process.beginthreadex()??? > > Rite now, I am suspending the thread. But any pointers as to how to > dele

Database in memory

2007-04-09 Thread Jim
I have an application that will maintain an in-memory database in the form of a list of lists. Does anyone know of a way to search for and retreive "records" from such a structure? Many thanks, bootkey -- http://mail.python.org/mailman/listinfo/python-list

Re: Kill thread

2007-04-09 Thread Teja
On Apr 9, 6:18 pm, "Christian" <[EMAIL PROTECTED]> wrote: > On Apr 9, 5:14 am, "Teja" <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > Can any on help me out in killing a thread (i.e deleteing the reources > > like, stack ,memory etc) which is started with > > win32process.beginthreadex()??? > > > Ri

focus trap in tkinter

2007-04-09 Thread [EMAIL PROTECTED]
Hi all, I'm trying to write a simple tkinter program, then this problem popped up. The followin code will describe the problem. -- import Tkinter class countdown(Tkinter.Frame): def __init__(self, master = None): Tkinter.Frame.__in

Re: Unicode problem

2007-04-09 Thread Martin v. Löwis
> BTW, any reason why an EncodedFile can't act like a Unicode > writer/reader object > if one of its encodings is explicitly set to None? AFAIU, that's not the intention of EncodedFile: instead, it is meant to do recoding. I find it a pretty useless API, and rather see it go away than being enhanc

Re: Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

2007-04-09 Thread skip
Thomas> [ chr(i) for i in range(97, 123) ] Or with fewer magic numbers: [chr(i) for i in range(ord('a'), ord('z')+1)] Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: focus trap in tkinter

2007-04-09 Thread kyosohma
On Apr 9, 8:27 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm trying to write a simple tkinter program, then this problem popped > up. The followin code will describe the problem. > > -- > > import Tkinter > > class countdown(Tkinter.Fra

Re: Classes with initialization

2007-04-09 Thread kyosohma
On Apr 9, 2:26 am, [EMAIL PROTECTED] wrote: > Hi all, > > I'm currently using code similar to this: > > class ClassWithInitialization(type): > def __init__(cls, name, bases, dict): > type.__init__(name, bases, dict) > dict['__class_init__'](cls) > > class A: > __

Re: Nice "bug" to loose a contest

2007-04-09 Thread azi . stdout
On Apr 9, 2:47 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 09 Apr 2007 09:19:16 -0300, <[EMAIL PROTECTED]> escribió: > > > Yeah, I've noticed that too, altough I'm clueless on how stdio handles > > that differently. Now I'm wondering, what's the behaviour of the > > Python snippet

Re: python, wxpython and Mac OS X

2007-04-09 Thread Robert Kern
7stud wrote: > On Apr 8, 8:46 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> Why 2.4.4 instead of the official 2.5 binary fromwww.python.org? >> >> http://www.python.org/download/ > > 1) On some download page that listed both python 2.5 and 2.4, it said > that python 2.4 had more packages/modules

Re: Classes with initialization

2007-04-09 Thread Michele Simionato
On Apr 9, 9:26 am, [EMAIL PROTECTED] wrote: > Hi all, > > I'm currently using code similar to this: > > class ClassWithInitialization(type): > def __init__(cls, name, bases, dict): > type.__init__(name, bases, dict) > dict['__class_init__'](cls) > > class A: > __

Re: shelve error

2007-04-09 Thread Alex Martelli
Peter Otten <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > > BTW, if you DO want to call shelve.open on a path f that may correspond > > to an arbitrary existing file (and want to toss away the previous > > contents of that file, if any) the correct way to call is then: > > > > s = shelve

Re: Database in memory

2007-04-09 Thread Gabriel Genellina
En Mon, 09 Apr 2007 10:19:12 -0300, Jim <[EMAIL PROTECTED]> escribió: > I have an application that will maintain an in-memory database in the > form of a list of lists. Does anyone know of a way to search for and > retreive "records" from such a structure? Why not a true database? SQLite can han

Re: Database in memory

2007-04-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Jim wrote: > I have an application that will maintain an in-memory database in the > form of a list of lists. Does anyone know of a way to search for and > retreive "records" from such a structure? Scan the list of lists with a ``for`` loop. Or build indexes with diction

Re: Database in memory

2007-04-09 Thread Jeremy Sanders
Jim wrote: > I have an application that will maintain an in-memory database in the > form of a list of lists. Does anyone know of a way to search for and > retreive "records" from such a structure? The dictionary is the obvious way to index things: # items consist of name and age data = [ ['fr

Re: Why does not my wx.html.HtmlWindow work?

2007-04-09 Thread kyosohma
On Apr 8, 8:31 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Apr 9, 1:01 am, Rob Williscroft <[EMAIL PROTECTED]> wrote: > > > > > [EMAIL PROTECTED] wrote innews:[EMAIL PROTECTED] > > comp.lang.python: > > > > Below are my source code: > > > > import wx > > > import wx.html > > > > class M

Re: Managing a file buffer

2007-04-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, David Johnson wrote: > What I'd like to do is have a buffer, say 5MB in size, which I can point > GStreamer at. So every time I write 60K to the tail of the file, I'd need to > remove 60K from the head of the file. You can't remove data from the head of a file. At least

Re: how to use the string '\\.\'

2007-04-09 Thread Duncan Booth
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 09 Apr 2007 08:21:44 -0300, Duncan Booth ><[EMAIL PROTECTED]> escribió: > >> <[EMAIL PROTECTED]> wrote: >> >>> print r'\\.\' >> >> See the FAQ: >> http://www.python.org/doc/faq/general/#why-can-t-raw-strings-r-strings >> -end-with-a-backs

Re: Managing a file buffer

2007-04-09 Thread Jeremy Sanders
David Johnson wrote: > I have an application that reads video from a socket and saves it to a > file, which I then play using GStreamer. The major problem with this > approach is that the file keeps getting bigger and bigger until the disk > is full ;-) > > What I'd like to do is have a buffer, s

Re: Database Timestamp conversion error

2007-04-09 Thread kyosohma
On Apr 6, 10:15 pm, [EMAIL PROTECTED] wrote: > On Apr 6, 6:20 pm, "John Machin" <[EMAIL PROTECTED]> wrote: > > > > > On Apr 7, 6:48 am, [EMAIL PROTECTED] wrote: > > > > Hi, > > > > I am populating a mySQL database with data from the MS Access > > > database. I have successfully figured out how to

Re: Classes with initialization

2007-04-09 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > > Also: can someone enlighten me as to when code in class scope is run, > > exactly? It's run as a part of the execution of the class statement. > > if a class A has a metaclass M, then M.__init__ does not seem to get > > the code in A's class scope in its argu

ctypes failing when a library needs another library

2007-04-09 Thread Jorge Vargas
Hi I'm having an issue with ctypes loading libraries. I got the following setup. I have a library (coded by me) that calls a external library (installed with the package manager), and my ctypes program calls my lib. at first python couldn't find my lib but setting LD_LIBRARY_PATH=. fix that, but

Re: Cascading ifs

2007-04-09 Thread Ernesto García García
> tbl = [(my_regex, doSomething), (my_regex2, doSomething2), (my_regex3, > doSomething3)] > for regex, fun in tbl: > match = regexp.match(line) > if match: >fun(line) >break Thank you for the idea. This is a bit more difficult when functions need to work with a common con

Re: Breaking up Strings correctly:

2007-04-09 Thread Paul McGuire
On Apr 9, 7:19 am, "Michael Yanowitz" <[EMAIL PROTECTED]> wrote: > Hello: > >I have been searching for an easy solution, and hopefully one > has already been written, so I don't want to reinvent the wheel: > >Suppose I have a string of expressions such as: > "((($IP = "127.1.2.3") AND ($AX

Re: Kill thread

2007-04-09 Thread Gabriel Genellina
En Mon, 09 Apr 2007 06:14:26 -0300, Teja <[EMAIL PROTECTED]> escribió: > Can any on help me out in killing a thread (i.e deleteing the reources > like, stack ,memory etc) which is started with > win32process.beginthreadex()??? As you can read on: http://msdn2.microsoft.com/en-us/library/kdzttdcb(

Re: [offtopic?] problem with UDP broadcast on Windows XP

2007-04-09 Thread Irmen de Jong
Gabriel Genellina wrote: > Try running the service impersonating another user (not LOCAL_SERVICE, > the default). > You can change that from the service control panel. Alas, that didn't change anything. I made it run as a user account that has admin privileges even, and it still doesn't respond

Threads aren't distinguished by titles and they don't belong to anyone [was: Re: shelve error]

2007-04-09 Thread Steve Holden
7stud wrote: >> Discussion subject changed to "Python universal build, OSX 10.3.9 and >> undefined symbols when >> linking" by David Pratt > > What gives? How come you can change the title of my thread? > > > On Apr 8, 8:14 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: >> But if you open an err

Re: Database in memory

2007-04-09 Thread Travis Oliphant
Jim wrote: > I have an application that will maintain an in-memory database in the > form of a list of lists. Does anyone know of a way to search for and > retreive "records" from such a structure? > Actually, the new NumPy can work as a very-good fast and efficient simple in-memory database (o

Re: Using/finding ODBC and DBI

2007-04-09 Thread Gabriel Genellina
En Mon, 09 Apr 2007 10:12:20 -0300, Boudreau, Emile <[EMAIL PROTECTED]> escribió: > Hello all, I'm trying to use ODBC and DBI but I don't seem to have the > right files on my system. I have looked around and I can't find what I'm > looking for. From the information I have been able to find these

MySQL Insert Unicode Problem

2007-04-09 Thread erikcw
Hi, I'm trying to insert some data from an XML file into MySQL. However, while importing one of the files, I got this error: Traceback (most recent call last): File "wa.py", line 304, in ? main() File "wa.py", line 257, in main curHandler.walkData() File "wa.py", line 112, in walkD

doubt with importing module, given module name

2007-04-09 Thread Pradnyesh Sawant
Hello, I have a string which in reality is the name of a module to be imported. The name of the class contained in the module also has the same (although with different capitalization). My requirement is to import the module, and also create an instance of the class. eg: str = "module"

output of top on a linux box

2007-04-09 Thread Pradnyesh Sawant
Hello, I need the cpu usage of a linux box, for which i capture the output of "top" using "popen". However, i am facing problems during string handling. The code snippet is:- top = os.popen("top -n 1") rd = top.read().split("\n") splt = rd[2].split() # cpu = splt[2][:-4] # why ain't this working

Re: Breaking up Strings correctly:

2007-04-09 Thread Gerard Flanagan
On Apr 9, 1:19 pm, "Michael Yanowitz" <[EMAIL PROTECTED]> wrote: > Hello: > >I have been searching for an easy solution, and hopefully one > has already been written, so I don't want to reinvent the wheel: > >Suppose I have a string of expressions such as: > "((($IP = "127.1.2.3") AND ($AX

Re: output of top on a linux box

2007-04-09 Thread Jeff McNeil
Can you pull the same information from /proc/stat as opposed to using a pipe to top? The first line(s) should contain (at least): cpu usermode, lowprio, system, idle, hz. The 2.6 kernel adds iowait, irq, and soft irq. It seems that this might be a better solution than executing that additional c

Having trouble with relative imports

2007-04-09 Thread Echo
Here is my setup: rpg -objects --__init__.py --gameobject.py --material.py -__init__.py -run_tests.py -stats.py the contents of run_test.py is: import objects as o the contents of objects/__init__.py is: from material import * in objects/material.py I have: from .gameobject import GameObject fro

Re: doubt with importing module, given module name

2007-04-09 Thread Carsten Haese
On Mon, 2007-04-09 at 22:52 +0530, Pradnyesh Sawant wrote: > Hello, > I have a string which in reality is the name of a module to be > imported. The name of the class contained in the module also has the > same (although with different capitalization). My requirement is to > import the module, and

Re: Memory allocation problem with python 2.4.3

2007-04-09 Thread Chris Mellon
On 4/9/07, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 9 Apr 2007 04:12:59 -0700, "Brice-Olivier Demory" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > Nothing indicates a lack of memory. > > No? I'd consider a machine with only 23MB free rather heavily use

Re: output of top on a linux box

2007-04-09 Thread Pradnyesh Sawant
Thanks for the pointer to use /proc/stat However, that does not answer my other question about string slicing Any pointers in that direction would be helpful... Thanks a lot! On 4/9/07, Jeff McNeil <[EMAIL PROTECTED]> wrote: > Can you pull the same information from /proc/stat as opposed to using

Re: tuples, index method, Python's design

2007-04-09 Thread OKB (not okblacke)
Carsten Haese wrote: > I won't presume to speak for Guido, but if I had to connect the > dots between "tuples are immutable" and "tuples will rarely need an > index method", I'd do it like this: Consider an object X and a > tuple T. Tuples have "X in T" tests, so you can check if there > exists so

Hosting Companies: Help for Python Users?

2007-04-09 Thread Steve Holden
I know there are quite a few hosting companies now who represent themselves as Python-friendly. Rather than trawl through the Wiki pages, however, and email each one separately I am sending this request to the comp.lang.python list (and putting it on my blog) in the hope of attracting those com

recursively removing files and directories

2007-04-09 Thread bahoo
Hi, I found a message on Jan 16, 2006 regarding the same topic, except that I wanted to remove only certain files that satisfy the format "ABC_XXX_XXX.dat", but not the other files. Once the files are removed, if a folder becomes empty, I want to remove the folder as well. The solution to the Ja

Re: Crypto Suggestion/Help

2007-04-09 Thread Larry Bates
Jimmy E Touma wrote: > Hi all, > > I need some advise on doing the following. I have a Linux application > that allows users to access it via a code (password). At the end of the > day, I gather a log of activities of the users and zip the file and > would like to encrypt it so that the users can

Re: Hosting Companies: Help for Python Users?

2007-04-09 Thread Larry Bates
Steve Holden wrote: > I know there are quite a few hosting companies now who represent > themselves as Python-friendly. Rather than trawl through the Wiki pages, > however, and email each one separately I am sending this request to the > comp.lang.python list (and putting it on my blog) in the hope

Re: Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']?

2007-04-09 Thread Michael Bentley
On Apr 9, 2007, at 6:30 AM, Duncan Booth wrote: Michael Bentley <[EMAIL PROTECTED]> wrote: On Apr 9, 2007, at 3:29 AM, 人言落日是天涯,望极天涯不 见家 wrote: Is there a simple function to generate a list like ['a', 'b', 'c', ... 'z']? The range() just can generate the nu

Re: Database Timestamp conversion error

2007-04-09 Thread Gabriel Genellina
En Mon, 09 Apr 2007 11:42:33 -0300, <[EMAIL PROTECTED]> escribió: > Here's my results: > > # bad > > > > # good > > datetime.datetime(2007, 4, 9, 0, 0) You can convert a DbiDate object into a datetime object using: dt = datetime.datetime.fromtimestamp(float(dbidate)) Only dates after 1970 are

Re: recursively removing files and directories

2007-04-09 Thread Eli Criffield
On Apr 9, 1:44 pm, "bahoo" <[EMAIL PROTECTED]> wrote: > Hi, > > I found a message on Jan 16, 2006 regarding the same topic, except > that I wanted to remove only certain files that satisfy the format > "ABC_XXX_XXX.dat", but not the other files. Once the files are > removed, if a folder becomes em

Re: Breaking up Strings correctly:

2007-04-09 Thread Gabriel Genellina
En Mon, 09 Apr 2007 12:39:44 -0300, Paul McGuire <[EMAIL PROTECTED]> escribió: > On Apr 9, 7:19 am, "Michael Yanowitz" <[EMAIL PROTECTED]> wrote: >> >>Suppose I have a string of expressions such as: >> "((($IP = "127.1.2.3") AND ($AX < 15)) OR (($IP = "127.1.2.4") AND ($AY >> != >> 0))) >>

Re: recursively removing files and directories

2007-04-09 Thread Eli Criffield
Forgot the rmdir import os import re def processFiles(args,dir,fileList): for thisFile in fileList: if re.match(r'REGEXPATTERN',thisFile): os.unlink("%s%s"dir,thisFile) os.rmdir(dir) os.path.walk("/",processFiles,None) Eli Criffield -- http://mail.python.org/mailm

Re: [offtopic?] problem with UDP broadcast on Windows XP

2007-04-09 Thread Gabriel Genellina
En Mon, 09 Apr 2007 13:08:03 -0300, Irmen de Jong <[EMAIL PROTECTED]> escribió: > Gabriel Genellina wrote: > >> Try running the service impersonating another user (not LOCAL_SERVICE, >> the default). >> You can change that from the service control panel. > > Alas, that didn't change anything. >

[no subject]

2007-04-09 Thread Marco
Hi, I have a problem to install wxPython on my MacBook (Pythonversion 2.5). If would install the wxPython (python setup.py install), then I got this error: Traceback (most recent call last): File "/Users/marco/Desktop/flexo1/wxpython/wxPython-src-2.8.3.0/ wxPython/setup.py", line 49, in copy_

install wxPython

2007-04-09 Thread Marco
Hi, I have a problem to install wxPython on my MacBook (Pythonversion 2.5). If would install the wxPython (python setup.py install), then I got this error: Traceback (most recent call last): File "/Users/marco/Desktop/flexo1/wxpython/wxPython-src-2.8.3.0/ wxPython/setup.py", line 49, in copy_

How can I import functions from another python file

2007-04-09 Thread [EMAIL PROTECTED]
Hi, i have 2 python files in *different directory* , how can I import python functions from 1 python file to another? i get this error: import task ImportError: No module named task/ Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: recursively removing files and directories

2007-04-09 Thread Sick Monkey
Here is some code that could be useful It does not check the directories for 0 files, but that shouldn't be too difficult to add. # from os import listdir, unlink from os.path import isdir, isfile, islink, join, getmtime deldir = "C:\Some\Dir" delF

Antigen Notification: Antigen found a message matching a filter

2007-04-09 Thread Antigen_VITORIA
Microsoft Antigen for Exchange found a message matching a filter. The message is currently Detected. Message: "Python_list Digest_ Vol 43_ Issue 144" Filter name: "KEYWORD= spam: xxx " Sent from: "[EMAIL PROTECTED]" Folder: "SMTP Messages\Inbound And Outbound" Location: "ITURAN/First Administrativ

Antigen Notification: Antigen found a message matching a filter

2007-04-09 Thread Antigen_VITORIA
Microsoft Antigen for Exchange found a message matching a filter. The message is currently Detected. Message: "Python_list Digest_ Vol 43_ Issue 144" Filter name: "KEYWORD= spam: xxx " Sent from: "[EMAIL PROTECTED]" Folder: "SMTP Messages\Inbound And Outbound" Location: "ITURAN/First Administrativ

Re: output of top on a linux box

2007-04-09 Thread Gabriel Genellina
En Mon, 09 Apr 2007 14:56:03 -0300, Pradnyesh Sawant <[EMAIL PROTECTED]> escribió: > Thanks for the pointer to use /proc/stat > However, that does not answer my other question about string slicing > Any pointers in that direction would be helpful... > >> > top = os.popen("top -n 1") >> > rd = to

Re: [offtopic?] problem with UDP broadcast on Windows XP

2007-04-09 Thread Irmen de Jong
Gabriel Genellina wrote: > Ouch, no more ideas from me. You'll surely get more answers from a > Windows networking group - this appears not to be related to Python anyway. Yeah I know that... That's what I mentioned in my original post... But I'm a noob on that type of thing, no idea where to ge

recursively archiving files

2007-04-09 Thread bahoo
Hi, Can I use python to recursively compress files under subdirectories with a certain format such as "ABC_XXX_XXX.dat" into a .gz or .zip file? I used to do it with "tar" on unix, but I don't like to put commands into a single line, as it is often more prone to error. Thanks bahoo -- http://m

  1   2   >