Re: Queue get timeout parameter question

2007-04-09 Thread Godzilla
On Apr 10, 2:20 pm, Paul Rubin wrote: > "Godzilla" <[EMAIL PROTECTED]> writes: > > After the time sync, say 15 seconds backward, the thread is sitting on > > that get() method for a total of 17 seconds. We can only sync the > > device once per day and the time can drift u

Re: setup() and C extensions

2007-04-09 Thread 7stud
Also: 1) When you create a C array to map python names to the C functions that you defined: static PyMethodDef MyFunctions[] = { {"my_calc", (PyCFunction)my_func, METH_VARARGS, "my very speedy c function"}, {NULL, NULL, 0, NULL} }; Why do you need to cast my_func to PyCFunction? 2) Whe

Re: TASK KILL

2007-04-09 Thread Michel Claveau
> Will TASKKILL kills a thread when thread id is given ?? Or does it > kill only a process?? > > How to ensure that a thread is killed? Hi! Sorry, TASKKILL is only for process. For help on TASKKILL :TASKKILL /? Other infos with TASKLIST (TASKLIST /?) If the object who use process is a servi

setup() and C extensions

2007-04-09 Thread 7stud
Hi, I can't find any documentation on the setup() function in the distutils.core module; specifically I want to know what the 'name' argument does. In some examples in the python docs, they use the name argument like this: from distutils.core import setup, Extension module1 = Extension('dem

Re: how can I clear a dictionary in python

2007-04-09 Thread Antoon Pardon
On 2007-04-04, Aahz <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Antoon Pardon <[EMAIL PROTECTED]> wrote: >>On 2007-04-03, Aahz <[EMAIL PROTECTED]> wrote: >>> In article <[EMAIL PROTECTED]>, >>> Larry Bates <[EMAIL PROTECTED]> wrote: Aahz wrote: > In article <[EMAIL PROT

TASK KILL

2007-04-09 Thread Teja
Will TASKKILL kills a thread when thread id is given ?? Or does it kill only a process?? How to ensure that a thread is killed? -- http://mail.python.org/mailman/listinfo/python-list

RE: RFC: Assignment as expression (pre-PEP)

2007-04-09 Thread Delaney, Timothy (Tim)
Alex Martelli wrote: >> As others have mentioned, your particular instance is probably >> evidence that you need to restructure your code a little bit, but I >> do agree that "x = y; if x: ..." is a common enough idiom that it >> warrants a shortcut. And reusing "as", I think, is nice and readable

Re: ulimit on open sockets ?

2007-04-09 Thread Alex Martelli
Maxim Veksler <[EMAIL PROTECTED]> wrote: > ValueError: filedescriptor out of range in select() > """ > > Should I be using a different version of select or something? Or select typically supports 1024 FDs at most (a design limit of the underlying operating system). You may want to try poll inst

Re: RFC: Assignment as expression (pre-PEP)

2007-04-09 Thread Alex Martelli
Adam Atlas <[EMAIL PROTECTED]> wrote: > Hasn't this been discussed many many times before? I think Guido has > been favourable to the idea of allowing :=, but that was a long time > ago, and I don't think anything ever came of it. > > Personally, if anything, I'd like to see more use of the 'as'

confirm password for logged in user

2007-04-09 Thread André Wyrwa
Hei, I know this kind of stuff has probably been asked a couple of times already, and did quite a bit of googling about it, but the answers i found were either unsatisfying or not specific enough to what i want to do: I'm writing on a (Linux only) python daemon that runs as regular user. Under c

Re: Check for keypress on Linux xterm ?

2007-04-09 Thread Grant Edwards
On 2007-04-09, hlubenow <[EMAIL PROTECTED]> wrote: > My problem is, I don't want my program to wait for the keypress. > I just want to check, if a key is currently pressed and if not, I'd like to > continue with my program (like "INKEY$" in some BASIC-dialects). The answer to this frequently aske

Re: how can I clear a dictionary in python

2007-04-09 Thread Antoon Pardon
On 2007-04-04, Delaney, Timothy (Tim) <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: > >> People are often enough not very exact in their communication and >> that goes double for people who are new in a particular subject. >> So I think it is entirely appropiate to think about the real question

Re: Queue get timeout parameter question

2007-04-09 Thread Paul Rubin
"Godzilla" <[EMAIL PROTECTED]> writes: > After the time sync, say 15 seconds backward, the thread is sitting on > that get() method for a total of 17 seconds. We can only sync the > device once per day and the time can drift up to 15 seconds per day!! Try to avoid syncing lke that. System clocks

Queue get timeout parameter question

2007-04-09 Thread Godzilla
Dear all, I have been using the queue module for a multithreaded environment and things seem to work well... until we had a requirement for the application to be able to time sync to the server. With the time sync, it actually disorientated the timeout in the queue's get() method... e.g. get(item

Re: tuples are useless???

2007-04-09 Thread James Stroud
Steven D'Aprano wrote: > 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 usele

Re: python, wxpython and Mac OS X

2007-04-09 Thread 7stud
On Apr 9, 8:10 am, Robert Kern <[EMAIL PROTECTED]> wrote: > > Should I remove 2.4.4 and install 2.5 instead? > > No, it's okay. > > -- > Robert Kern Ok, thanks. I'll download wxPython and see if I can get it installed properly. -- http://mail.python.org/mailman/listinfo/python-list

Re: Custom Python Runtime

2007-04-09 Thread Jack
Thanks for all the replies. It would be great to have all customization related information on one doc page. A few more questions: 1. One Windows, it's possible to zip all files in a Python24.zip. I'm not very clear if it's used in the stardard distribution. What can, and what can not be put into

Re: Breaking up Strings correctly:

2007-04-09 Thread Adam Atlas
On Apr 9, 8: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: Pyparsing is indeed a fine package, but if Paul gets to plug his module, then so do I! :

Re: output of top on a linux box

2007-04-09 Thread Jeff McNeil
The code snippet prints "cpu usage: us,, " on my workstation, bumping the splt index to 3 prints the correct sys. usage. What does the header of your 'top' command look like? There's a very good chance it's different than what I'm testing with. As for the slice, assuming 'splt[2]' is '0.5%sy', t

Re: RFC: Assignment as expression (pre-PEP)

2007-04-09 Thread Adam Atlas
Hasn't this been discussed many many times before? I think Guido has been favourable to the idea of allowing :=, but that was a long time ago, and I don't think anything ever came of it. Personally, if anything, I'd like to see more use of the 'as' keyword as in Python 2.5's new 'with' statement.

Re: ulimit on open sockets ?

2007-04-09 Thread Bjoern Schliessmann
Maxim Veksler wrote: > I've written this code, the general idea was to listen on all > 65535 port of tcp for connection. Please excuse the question: Why would anyone want to do such a manic thing (instead of, e. g., using raw sockets)? Regards, Björn -- BOFH excuse #326: We need a licensed

Re: How can I import functions from another python file

2007-04-09 Thread Shane Geiger
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/ The directory that module is in must by on your python path in order to import it. That's not exactly c

Find Programming Job?

2007-04-09 Thread Cindy
Find Your Programming Job Vacancy and resources here --> http://www.jobbankdata.com/job-programming.htm -- http://mail.python.org/mailman/listinfo/python-list

ulimit on open sockets ?

2007-04-09 Thread Maxim Veksler
Hi, I've written this code, the general idea was to listen on all 65535 port of tcp for connection. """ #!/usr/bin/env python import socket, select def get_non_blocking_socket(port_number): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setblocking(0) s.bind(('0.0.0.0', port

Re: Classes with initialization

2007-04-09 Thread Carl Banks
On Apr 9, 3: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: Debugging multithreaded program using Eclipse/Pydev

2007-04-09 Thread John Henry
On Apr 7, 3:23 pm, Heikki Toivonen <[EMAIL PROTECTED]> wrote: > John Henry wrote: > >>From what I can gather, it appears the only *real* option I have is to > > debug under Eclipse/Pydev. I did a google search of this newsgroup > > and didn't turn up too many hits. Before I invest the time to lea

Check for keypress on Linux xterm ?

2007-04-09 Thread hlubenow
Hello, I'd like to check, if a single key is pressed on a Linux xterm. This code waits for a key to be pressed and returns the character: #!/usr/bin/env python import sys import tty import termios fd = sys.stdin.fileno() old_settings = termios.tcget

Re: Comments in ConfigParser module

2007-04-09 Thread Gabriel Genellina
En Sun, 08 Apr 2007 06:17:46 -0300, Joel Granados <[EMAIL PROTECTED]> escribió: > On 7 Apr 2007 13:19:06 -0700, Gabriel Genellina <[EMAIL PROTECTED]> > wrote: >> >> Joel Andres Granados wrote: >> >> > The module also allows the comments to appear in the same line as the >> > "name = value" const

Re: Hosting Companies: Help for Python Users?

2007-04-09 Thread Neil Hodgson
Steve Holden: > Dennis Lee Beiber: > > > Too many 3rd-party modules still aren't available in 2.5 > > versions for my tastes... > > This applies particularly (though not exclusively) to the Windows > platform, for various reasons -- the most common one is that Linux > developers frequently d

Re: MySQL Insert Unicode Problem

2007-04-09 Thread John Nagle
erikcw wrote: > 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()

Re: How can I import functions from another python file

2007-04-09 Thread Gabriel Genellina
En Mon, 09 Apr 2007 18:06:11 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > i have 2 python files in *different directory* , how can I import > python functions from 1 python file to another? See the tutorial about modules, packages, and the module search path: http://docs.python.or

Re: recursively archiving files

2007-04-09 Thread Larry Bates
bahoo wrote: > 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. >

Re: How can I import functions from another python file

2007-04-09 Thread Lee Harr
On 2007-04-09, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > 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/ > The directory that module is in must b

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

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

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

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: 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

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

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_

[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_

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. >

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: 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
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: 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: 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: 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: 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

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

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

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

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: 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: 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

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: 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

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

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

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"

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

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

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

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: [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

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: 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: 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

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: 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

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: 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: 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 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: 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: 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: 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 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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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

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 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

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

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

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

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: 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: 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

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: 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

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

  1   2   >