Re: testing client-server sockets

2008-04-18 Thread David Harrison
On 18/04/2008, Astan Chee <[EMAIL PROTECTED]> wrote: > Server code: > > import os, sys, socket > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > host = '' > port = 5602 > s.bind((host,port)) > try: > s.listen(1) > while 1: > conn, addr = s.accept() > print

Re: testing client-server sockets

2008-04-18 Thread David Harrison
On 18/04/2008, Astan Chee <[EMAIL PROTECTED]> wrote: > Hi, > I have a client-server socket script in python. Something like this > http://ubuntuforums.org/showthread.php?t=208962 > Now the problem I have is that I want to try to connect the client to > the server on the same machine, but it giv

Re: Sorting Directories from files in a os.listdir??

2008-04-10 Thread David Harrison
On 10/04/2008, Soren <[EMAIL PROTECTED]> wrote: > Hi, > > I'd like to read the filenames in a directory, but not the > subdirectories, os.listdir() gives me everything... how do I separate > the directory names from the filenames? Is there another way of doing > this? The only thing I can thin

Re: Converting a tuple to a list

2008-04-08 Thread David Harrison
On 09/04/2008, Gabriel Ibanez <[EMAIL PROTECTED]> wrote: > Hi all .. > > I'm trying to using the map function to convert a tuple to a list, without > success. > > I would like to have a lonely line that performs the same as loop of the > next script: > > ---

Re: Sorting a List of Objects by an Attribute of the Objects Case-Insensitively

2008-04-08 Thread David Harrison
On 09/04/2008, Jason <[EMAIL PROTECTED]> wrote: > Hi folks-- > > Basically, I have a pressing need for a combination of 5.2 "Sorting a > List of Strings Case-Insensitively" & 5.3 "Sorting a List of Objects > by an Attribute of the Objects" from the Python Cookbook. > > My first guess isn't work

Re: ldap

2008-04-07 Thread David Harrison
On 07/04/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > sorry, i'm new with Python. > I must do interaction beetween Python and Ldap, and I don't know how > do this. > Searching on the web I know that exists PythonLdap, but I dont'know if > this is best choise or not. > > Thank's > > -

Re: Help replacing os.system call with subprocess call

2008-04-06 Thread David Harrison
On 07/04/2008, David Harrison <[EMAIL PROTECTED]> wrote: > On 07/04/2008, David Pratt <[EMAIL PROTECTED]> wrote: > > Hi. I am trying to replace a system call with a subprocess call. I have > > tried subprocess.Popen and subprocess.call with but have not been > &

Re: Help replacing os.system call with subprocess call

2008-04-06 Thread David Harrison
On 07/04/2008, David Pratt <[EMAIL PROTECTED]> wrote: > Hi. I am trying to replace a system call with a subprocess call. I have > tried subprocess.Popen and subprocess.call with but have not been > successful. The command line would be: > > svnadmin dump /my/repository > svndump.db > > This is

Re: Question: Threading and embedding python in an application

2005-05-10 Thread David Harrison
uot;, self computation(lFp) lFp.close() t = MyThread("/var/tmp/big.log") t.start() On 2005-05-10 12:48:36 -0700, Mike Meyer <[EMAIL PROTECTED]> said: > David Harrison <[EMAIL PROTECTED]> writes: > >> I am working on an application on Mac OS X

Question: Threading and embedding python in an application

2005-05-09 Thread David Harrison
I am working on an application on Mac OS X that calls out to python via PyImport_ImportModule(). I find that if the imported module creates and starts a python thread, the thread seems to be killed when the import of the module is complete. Is this expected? Does python have to be in control t