Re: Can't connect to SimpleXMLRPCServer. Help needed.

2006-04-12 Thread John Abel
tead of "localhost" ? > > I'm kind of new to client/server programming, so I'm at a loss here. > Thank you very much for your attention. > > Jose Carlos. > > > > > > 2006/4/12, John Abel <[EMAIL PRO

Re: Can't connect to SimpleXMLRPCServer. Help needed.

2006-04-12 Thread John Abel
Your server is only listening on 127.0.0.1. Jose Carlos Balderas Alberico wrote: > Up till now I've been setting up my server and client in the same > machine, using the "localhost" address for everything. > Once I've made it work, I need to move my client application to the > computer where it'

Re: Python on linux

2005-11-18 Thread John Abel
Here's one I used a while back. Returns a dict containing details per partition def _getAvailPartitions(): validTypes = [ 'ufs', 'nfs', 'reiserfs' ] mntTab = file( '/etc/mtab', 'r' ) drvDetails = {} for mntLine in mntTab: splitLine = mntLine.split()

Re: xml.dom.minidom - parseString - How to avoid ExpatError?

2005-10-27 Thread John Abel
Have a look on: http://xml.com/pub/a/98/10/guide0.html?page=4#WELLFORMED Explains it better then I can. J Gregory Piñero wrote: > What do you mean by well-formed? What is required to make XML well > formed? > > -Greg > > > On 10/26/05, *John Abel* <[EMAIL PROTECTED]

Re: xml.dom.minidom - parseString - How to avoid ExpatError?

2005-10-26 Thread John Abel
Try this page: http://docs.python.org/lib/module-xml.sax.saxutils.html I've just tried the code, taking out the  , and adding in the belo, as the XML is not well formed, otherwise. The code then works. HTH J Gregory Piñero wrote: > Should I try some sort of XML group instead? I'm still s

Re: Looping Problem (Generating files - only the last record generates a file)

2005-10-26 Thread John Abel
[EMAIL PROTECTED] wrote: >Hello All, > >I have a problem with the program that should generate x number of txt >files (x is the number of records in the file datafile.txt). > >Once I execute the program (see below) only one file (instead of x >files) is created. The file created is based on the la

Re: Security on XML-RPC

2005-10-25 Thread John Abel
dcrespo wrote: >Hi all, > >Anyone knows a simpler but stronger control access to XML-RPC functions >than the one I comment here? > >My actual system works like this: > >I have a TCP Server and an XML-RPC Server. Both of them verify if the >IP address is allowed. > >The TCP Server works for validat

Re: Python/Apache Oddness On OSX

2005-10-25 Thread John Abel
[EMAIL PROTECTED] wrote: >John Abel wrote: > > >>Hi, >> >>I'm running Python 2.3.5/2.4.2 on OSX 10.4.2, and am trying to run CGI >>scripts using the builtin Apache. For ease, I've symlinked my custom >>modules into the /Library/Python/2.3/

Python/Apache Oddness On OSX

2005-10-24 Thread John Abel
Hi, I'm running Python 2.3.5/2.4.2 on OSX 10.4.2, and am trying to run CGI scripts using the builtin Apache. For ease, I've symlinked my custom modules into the /Library/Python/2.3/site-packages directory, and they import OK via command line python. However, when I perform the import from a

Re: "dynamical" importing

2005-10-19 Thread John Abel
Fredrik Lundh wrote: >John Abel wrote: > > > >>def _importModule( moduleName ): >>modName = __import__ ( moduleName ) >>modComponents = moduleName.split( '.' ) >>for indivComp in modComponents[ 1: ]: >>modName =

Re: "dynamical" importing

2005-10-19 Thread John Abel
Try: userModule = _importModule( pathToModule ) def _importModule( moduleName ): modName = __import__ ( moduleName ) modComponents = moduleName.split( '.' ) for indivComp in modComponents[ 1: ]: modName = getattr( modName, indivComp ) return modName HTH, J Joerg Schust

Re: Make SimpleXMLRPCServer Require Auth?

2005-10-12 Thread John Abel
John Abel wrote: >Hi, > >I implemented a SimpleXMLRPCServer, modified it slightly to restrict >clients based on their IP, but I need to take it a stage further, and >add user authentication. I would appreciate any pointers as to how I >might go about this, or any pack

Make SimpleXMLRPCServer Require Auth?

2005-10-12 Thread John Abel
Hi, I implemented a SimpleXMLRPCServer, modified it slightly to restrict clients based on their IP, but I need to take it a stage further, and add user authentication. I would appreciate any pointers as to how I might go about this, or any packages which already provide this. I'm guessing th

Re: Generating images with text in them

2005-07-21 Thread John Abel
Have you downloaded the pilfonts.zip from effbot.org? J phil hunt wrote: >I am trying to generate some images (gifs or pngs) with text in >them. I can use the Python Imaging Library, but it only has access >to the default, rather crappy, font. > >Ideally I'd like to use one of the nicer fonts

Re: Python scripts wont run - HELP

2005-07-18 Thread John Abel
windozbloz wrote: >Bye Bye Billy Bob... > >Hello All, >I'm a fairly literate windoz amateur programmer mostly in visual basic. I >have switched to SuSE 9.2 Pro and am trying to quickly come up to speed >with Python 2.3.4. I can run three or four line scripts from the command >line but have not be

Re: Missing Something Simple

2005-07-12 Thread John Abel
harold fellermann wrote: > >so, if I understand you right, what you want to have is a list of >mutable objects, whose value you can change without changing the >objects' >references. > > Yes! >class Proxy : > def __init__(self,val) : self.set(val) > def set(self,val) : self.val = v

Re: Missing Something Simple

2005-07-12 Thread John Abel
>have been declared before being used in the list. Basically, I'm after >the Python way of using deferencing. > > OK, that should say dereferencing. J -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing Something Simple

2005-07-12 Thread John Abel
harold fellermann wrote: >Hi, > > > >>I have a list of variables, which I am iterating over. I need to set >>the value of each variable. My code looks like: >> >>varList = [ varOne, varTwo, varThree, varFour ] >> >>for indivVar in varList: >>indivVar = returnVarFromFunction() >> >>However,

Missing Something Simple

2005-07-12 Thread John Abel
Hi, I have a list of variables, which I am iterating over. I need to set the value of each variable. My code looks like: varList = [ varOne, varTwo, varThree, varFour ] for indivVar in varList: indivVar = returnVarFromFunction() However, none of the variables in the list are being set.

Re: Got an interesting problem. (platform ruuning issue)

2005-06-29 Thread John Abel
Jeffrey Maitland wrote: >when running scripts they seem to work fine on ia-32 but I get >segfault on ia-64 what the heck should I be looking for? > >I did notice that it seems to work ok only for certain scripts but any >script that imports MySQLdb or glob seems to make this occur. > >Thanks Jeff

Re: building python 2.4.1

2005-06-28 Thread John Abel
Andreas Heiss wrote: >John Abel wrote: > > > >>Andreas Heiss wrote: >> >> >> >>>Hi ! >>>I am trying to build python 2.4.1 from source on a Linux system. >>>Everything seems fine, but tkinter seems not to work. >>>T

Re: building python 2.4.1

2005-06-28 Thread John Abel
Andreas Heiss wrote: >Hi ! >I am trying to build python 2.4.1 from source on a Linux system. >Everything seems fine, but tkinter seems not to work. >The file _tkinter.pyd is missing. >How can tell configure to build all necessary components ? > >Thanks >Andreas > > It looks to like Tcl/Tk is no

Re: Python choice of database

2005-06-20 Thread John Abel
Philippe C. Martin wrote: >Thank you all for your answers. > >A pure Python would have beenmy first choice. yet I now feel I should spend >some time looking at PySQLite (I like the fact it's pre-compiled for >Windows). > >Thanks. > >Philippe > > > >Philippe C. Martin wrote: > > > >>Hi, >> >>I am

Re: Python choice of database

2005-06-20 Thread John Abel
Just thought of a couple more: SnakeSQL KirbyBase J John Abel wrote: >Gadfly >PySQLite ( requires SQLite library ) > >J > >Philippe C. Martin wrote: > > > >>Hi, >> >>I am looking for a stand-alone (not client/server) database solution for >&g

Re: Python choice of database

2005-06-20 Thread John Abel
Gadfly PySQLite ( requires SQLite library ) J Philippe C. Martin wrote: >Hi, > >I am looking for a stand-alone (not client/server) database solution for >Python. > >1) speed is not an issue >2) I wish to store less than 5000 records >3) each record should not be larger than 16K > > >As I start w

Re: Basic questions about packages/modules.

2005-06-10 Thread John Abel
Negroup wrote: >Hi, first of all sorry for boring you with a such simple request. I'm >using Python since few days, and I like it even if I'm not yet in >confidence. I'd like to organize my programs in hierarchical >structures, thus I thought that packages could be the solution, >however I have so

Re: Perl s/ To Python?

2005-06-10 Thread John Abel
JZ wrote: >Dnia Fri, 10 Jun 2005 14:57:21 +0100, John Abel napisał(a): > > > >>$testVar =~ s#/mail/.*$##g >> >>The only way I can think of doing it, is: >> >>mailPos = testVar.find( "mail" ) >>remainder = testVar[ :mailPos ] >>

Perl s/ To Python?

2005-06-10 Thread John Abel
Does anyone know of a quick way of performing this: $testVar =~ s#/mail/.*$##g The only way I can think of doing it, is: mailPos = testVar.find( "mail" ) remainder = testVar[ :mailPos ] Any ideas would be appreciated. I'm iterating over a lot of entries, and running these lines for each entr

Re: Simple SMTP server

2005-06-09 Thread John Abel
Jesse Noller wrote: >Hello - > >I am looking at implementing a simple SMTP server in python - I know >about the smtpd module, but I am looking for code examples/snippets as >the documentation is sparse. > >The server I am looking at writing is really simple - it just needs to >fork/thread appropri

Re: optparse.py: FutureWarning error

2005-06-09 Thread John Abel
Magnus Lycka wrote: >John Abel wrote: > > >>Magnus Lycka wrote: >> >> > > > >>As a programmer on Win32, and *nix platforms, I agree with needing >>better tools. however, I find cygwin a pita. For tools such as grep >>and find, t

Re: optparse.py: FutureWarning error

2005-06-08 Thread John Abel
Magnus Lycka wrote: >Terry Reedy wrote: > > >>This should REALLY be on the doc page of the Python site. >> >> >Agreed. > > > >>It is really time to stop pretending that the only Python users >>that count have a *nix on their desk. >> >> >I agree with this too, but if you're a program

Re: ANN: ActivePython 2.4.1 for Mac OS X is now available!

2005-06-07 Thread John Abel
Trent Mick wrote: >Today ActiveState is announcing support for Mac OS X. I'm happy to >announce that ActivePython 2.4.1 for Mac OS X is now available for free >download from: > >http://www.ActiveState.com/Products/ActivePython/ > >This brings the number of free ActivePython platforms to four

Re: dictionaries and threads

2005-06-02 Thread John Abel
Bloke wrote: >I've been trying to find a Python tutorial on threading - does anyone >have a reference? > >Rob > > > You could try this: http://heather.cs.ucdavis.edu/~matloff/Python/PyThreads.pdf J -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a python program during idle time only

2005-05-27 Thread John Abel
Shane Hathaway wrote: >Mike Meyer wrote: > > >>On a completely different topic, this looks like the wrong way to solve >>the problem. You want to update a search engine based on changes to the >>underlying file system. The right way to do this isn't to just keep >>rescanning the file system, it'

Re: More Rewrite Request Within SocketServer?

2005-05-27 Thread John Abel
Paul Rubin wrote: > If verify_request is finished before the new thread starts, then I'd > >think it could set a flag and the new thread could find it. You get a >race condition only if both threads are trying to mess with the flag >simultaneously. > > Hmm, I think you're right. Thanks! J --

Re: Running a python program during idle time only

2005-05-27 Thread John Abel
John Abel wrote: >Shane Hathaway wrote: > > > >>Mike Meyer wrote: >> >> >> >> >>>On a completely different topic, this looks like the wrong way to solve >>>the problem. You want to update a search engine based on changes to the

Re: Running a python program during idle time only

2005-05-27 Thread John Abel
Shane Hathaway wrote: >Mike Meyer wrote: > > >>On a completely different topic, this looks like the wrong way to solve >>the problem. You want to update a search engine based on changes to the >>underlying file system. The right way to do this isn't to just keep >>rescanning the file system, it'

Re: More Rewrite Request Within SocketServer?

2005-05-27 Thread John Abel
Paul Rubin wrote: >John Abel <[EMAIL PROTECTED]> writes: > > >>OK, I'm guessing what I was after ( see below ) isn't possible. Does >>anyone know of an easy way of having verify_request inform the request >>handler of certain events, say client is un

More Rewrite Request Within SocketServer?

2005-05-27 Thread John Abel
dler class ( self.server.hostAllowed for example ), but that wouldn't work quite right in a threaded server. Any ideas? J Original Message Subject:ReWrite Request Within SocketServer? Date: Wed, 25 May 2005 17:04:53 +0100 From: John Abel <[EMAIL PROTECTED]> To: python-

Re: __init__() not called automatically

2005-05-26 Thread John Abel
bruno modulix wrote: >Paul McNett wrote: > > >>Sriek wrote: >> >> >> >(snip) > > >>>Similarly, why do we have to explicitly use the 'self' keyword >>>everytime? >>>This is closer to a wart, IMO, >>> >>> > > > Here's one of the shorter threads discussing 'self'. I remember one lo

ReWrite Request Within SocketServer?

2005-05-25 Thread John Abel
Hi! I may be missing something simple, but is there a way to have verify_request change the request before it gets processed by the RequestHandlerClass? Regards J -- http://mail.python.org/mailman/listinfo/python-list

Re: Process monitoring

2005-05-20 Thread John Abel
gsteff wrote: >Hey, I'm working on a Python program that will launch some other >non-Python process using os.spawn (in the os.P_NOWAIT mode) and then >basically wait for it to finish (while doing some other stuff in the >interim). Normally, the new process will signal that it's done by >writing t

Re: Defunct Processes With subprocess.Popen

2005-05-12 Thread John Abel
Mike Meyer wrote: >John Abel <[EMAIL PROTECTED]> writes: > > > >>Hi! >> >>I'm currently writing a script which launches external programs, but >>it keeps leaving zombie/defunct processes behind, until I kill the >>launching script, which

Re: reg mail sending without smtp module

2005-05-11 Thread John Abel
praba kar wrote: >Dear All, > > Is it possible to send a message as a mail >with out smtplib module? If you find out any module >for mail sending(without smtplib) kindly mail me. > >regards >Prabahar > > > >Yahoo! In

Defunct Processes With subprocess.Popen

2005-05-11 Thread John Abel
Hi! I'm currently writing a script which launches external programs, but it keeps leaving zombie/defunct processes behind, until I kill the launching script, which is a bit of a pain, as it's supposed to be a daemon. The code I'm using is: newPid = subprocess.Popen( cmdLine[ 1: ], executable=

Re: A Module on Time & Date

2005-05-10 Thread John Abel
Sara Khalatbari wrote: >Is there a Module in Python that gives you the time & >date of today??? > > > > >__ >Do you Yahoo!? >Make Yahoo! your home page >http://www.yahoo.com/r/hs > > time - http://docs.python.org/lib/module-time.html datetime - h

Re: How do you convert a string obj to a file obj?

2005-05-04 Thread John Abel
Matthew Thorley wrote: >I'm writing a web app whereby a user uploads a tar acrhive which is then >opened and processed. My web form reads the file like this: > >while 1: >data = value.file.read(1024 * 8) # Read blocks of 8KB at a time >if not data: break > >which leaves me with data as a s

Re: Getting PID for process

2005-04-29 Thread John Abel
try: import os myPID = os.getpid() So you can kill it at a later date, it would be worth writing that out to a file somewhere - C:\temp? I'm sure you can get a kill command for Win32. HTH J Harlin Seritt wrote: Let's say I have a simple script on Windows NT. I would like for that script to find

Re: LD_LIBRARY_PATH - how to set?

2005-03-30 Thread John Abel
te: On Mar 31, 2005 9:20 AM, John Abel <[EMAIL PROTECTED]> wrote: What OS? Linux? Solaris? Does it matter? If so, please explain why ( lack of knowledge ) I am using Linux ( Debian Surge ) Thanks J Roman Yakovenko wrote: Hi. I have small problem. I need to load extension mod

Re: LD_LIBRARY_PATH - how to set?

2005-03-30 Thread John Abel
What OS? Linux? Solaris? J Roman Yakovenko wrote: Hi. I have small problem. I need to load extension module that depends on shared library. Before actually importing module I tried to edit os.environ or to call directly to os.putenv without any success - shared library was not found. I tried to s

Re: Annoying Socket Problem

2005-02-19 Thread John Abel
Never mind, sorted now. On 18 Feb 2005, at 15:10, John Abel wrote: Read/tried that before posting. Even with a flush, everything hangs until I kill the client. Irmen de Jong wrote: John Abel wrote: I'm hoping this is something simple, and someone can point me in the right direction her

Re: Annoying Socket Problem

2005-02-18 Thread John Abel
Read/tried that before posting. Even with a flush, everything hangs until I kill the client. Irmen de Jong wrote: John Abel wrote: I'm hoping this is something simple, and someone can point me in the right direction here. I have a class based on SocketServer (ThreadingTCPServer), and

Annoying Socket Problem

2005-02-18 Thread John Abel
I'm hoping this is something simple, and someone can point me in the right direction here. I have a class based on SocketServer (ThreadingTCPServer), and I've used makefile on the socket so I use the "for in " routine. My client sends it a small amount of data. However, both programs appear

Re: FTP Server

2005-01-26 Thread John Abel
If you're after a simple FTP server, have a look at medusa. Regards John [EMAIL PROTECTED] wrote: What's the simplest way to write an FTP Server in Python? A short research on the newsgroup and on the Cookbook did not bring out anything relevant (but I hear a little voice in the back of my head say

Re: FTP Server

2005-01-26 Thread John Abel
[EMAIL PROTECTED] wrote: If you're after a simple FTP server, have a look at medusa. Uhm ... Medusa does not seem actively maintained nowadays. M.S. AFAIK, it's maintained to the extent, that if you find bugs/enhance it and let the medusa-dev list know, it more than likely will get fi