storing pickles in sql data base

2007-07-10 Thread David Bear
field in my sql table, or should what sql type should I save the pickle as? -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a process every N days

2007-06-07 Thread David Bear
s alot of data and I'd like to remove all > data older than 30 days. My ideal solution would be something that > runs in the background but only wakes up to run every few days to > check for old data. > > Thanks, > > Dan McLeran And you can use cron to launch your py

running a random function

2007-06-07 Thread David Bear
I would like to write some code that would randomly select a function from a list of functions and call it. I was looking in the globals names space and randomly selecting items that were of type function.. but I didn't see a way of actually running the function. Any pointers? -- David

string templates

2007-04-04 Thread David Bear
I was justing wondering how safe python string templates are to use with unicode. I was just scanning pep 292 and it seems to say that they are -- or can by with inheritance... but I don't quite understand. -- David Bear -- let me buy your intellectual property, I want to own your tho

Re: persistent fifo queue class

2007-03-07 Thread David Bear
Diez B. Roggisch wrote: > David Bear schrieb: >> I'm looking to see if there are any examples or prewritting fifo queue >> classes. I know this is a broad topic. I'm looking to implement a simple >> application where a web server enqueue and pickle using a local

Re: using python to query active directory

2007-03-06 Thread David Bear
jay graves wrote: > On Mar 6, 1:34 pm, David Bear <[EMAIL PROTECTED]> wrote: >> Is it possible to use python to make calls agains microsoft active >> directory? I suppose this should be qualified by what is needed to do it >> from windows (I assume the win32all

using python to query active directory

2007-03-06 Thread David Bear
Is it possible to use python to make calls agains microsoft active directory? I suppose this should be qualified by what is needed to do it from windows (I assume the win32all package) and from linux (if possible). Any code samples would be great. -- David Bear -- let me buy your intellectual

persistent fifo queue class

2007-03-05 Thread David Bear
lication dequeue the pickles again using a local socket. -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

more examples on lamba

2007-02-02 Thread David Bear
Coming from BASIC and Pascal, these are constructions that never entered into youthfull learning;-) -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

python 2.3 module ref

2007-01-29 Thread David Bear
Since redhat packages python2.3 with their distro (RHEL 4..) I was looking for a module reference for that version. Looking at python.org I only see current documentation. any pointers to a 2.3 module ref? -- David Bear -- let me buy your intellectual property, I want to own your thoughts

understanding htmllib

2006-10-03 Thread David Bear
e documentation on this module at python.org seems to assume a great deal about what the reader would already know about which methods they should subclass. -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

Re: help tranlating perl expressions

2006-09-28 Thread David Bear
Fredrik Lundh wrote: > David Bear wrote: > > > I am trying to translate some perl code to python and I need some > > advice on making fixed sized strings. > > looks like you're reimplementing HMAC; there's no need to do that in > Python, really, si

help tranlating perl expressions

2006-09-28 Thread David Bear
y)); #zero-fill to blocksize } else { $key = sha1($key); #if longer, pre-hash key } Finally it concatenates and xors these strings together like this: return sha1($key^$opad . sha1($key^$ipad . $data)); I when python XOR's strings, is it the same as when perl xor's th

Re: inet_aton and struct issue

2006-08-30 Thread David Bear
David Bear wrote: > Diez B. Roggisch wrote: > >> David Bear schrieb: >>> I found this simple recipe for converting a dotted quad ip address to a >>> string of a long int. >>> >>> struct.unpack('L',socket.inet_aton(ip))[0] >>>

Re: inet_aton and struct issue

2006-08-30 Thread David Bear
Diez B. Roggisch wrote: > David Bear schrieb: >> I found this simple recipe for converting a dotted quad ip address to a >> string of a long int. >> >> struct.unpack('L',socket.inet_aton(ip))[0] >> >> trouble is when I use this, I get >>

inet_aton and struct issue

2006-08-30 Thread David Bear
Is there a better way to take a dotted quad and convert it to a string representation of an long int? -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

current recursion level

2006-08-03 Thread David Bear
Is there an easy way to get the current level of recursion? I don't mean sys.getrecursionlimit. I want to know during a live run of a script how many times the functions has recursed -- curses, I don't know how to say it better. -- David Bear -- let me buy your intellectual property,

Re: readline not found error

2006-07-31 Thread David Bear
Robert Kern wrote: > David Bear wrote: >> I built python 2.4.2 for suse linux 9.3. I configured it to be a separate >> instance of python from the version packaged with suse. >> >> Now when I start it I get an error: >> python >> Python 2.4.2 (#4, Jul 27

realine not found error

2006-07-31 Thread David Bear
e-5.0-7.2 readline-32bit-9.3-7.1 it id truly does exist: locate readline ... /lib/libreadline.so.5 /lib/libreadline.so.5.0 /lib64/libreadline.so.5 /lib64/libreadline.so.5.0 ... I googled about for this and there were numerous hits on this problem from others, but I never found a 'sol

PIL issues

2006-07-31 Thread David Bear
To add a missing option, make sure you have the required library, and set the corresponding ROOT variable in the setup.py script. I don't know what ROOT variable the message is referring too. Any advice would be appreciated. -- David Bear -- let me buy your intellectual property, I wa

under naming

2006-07-31 Thread David Bear
= 'a local var' module B from A import * _myvar -- is not available. Is this in a pep somewhere ? -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

using logger module

2006-07-17 Thread David Bear
problem with the syslog server. I am using python 2.4 -- on a 2.6.11.4-xx kernel. (suse 9.3) -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

popen2 question

2006-06-21 Thread David Bear
ave time to reimplement what was written in perl. When I run the perl code directly, I get the output I want. When I run it through the os.popen2 module, I get an additional 1 appended. (It's all string output) Is this normal behavior for this module? What am I missing? -- David Bear -- let me

calling perl modules from python

2006-05-11 Thread David Bear
' from a python program. I found the following: http://www.annocpan.org/~GAAS/pyperl-1.0/perlmodule.pod and wondered if anyone had any comments. This thing implements a perl interpreter inside python. That seems like overkill to me. I wonder what wisdom this group can offer. -- David Bea

unboundlocalerror with cgi module

2006-04-10 Thread David Bear
or: print "exception..." item,value=(None,None) return(item,value) However, the except block does not seem to catch the exception and an unboundlocalerror is thrown anyway. What am I missing? -- David Bear -- let me buy your intellectual pr

using a perl mod

2006-03-27 Thread David Bear
utput, I was hoping to use the perl mods and the perl objects returned by these mods in python -- since I can't stand reading perl. The question then becomes, are there any python modules that encapsulate and map perl objects into python object? -- David Bear -- let me buy your intellectual p

Re: python cgi permision error

2006-03-17 Thread David Bear
true, even if I gave /var/www permision > recursively to 777(I know this not good idea, just for testing), still > have permision denied stuff. > Btw I'm using SuSE 10, Apache/2.0.54, and python 2.4 > Sighhh, there's a lot of weird thing with my apache and I can't >

apache config file parser

2006-03-17 Thread David Bear
I was wondering if anyone has written an apache config file parser in python. There seem to be a number of perl mods to do this. But I don't seem to be able to find anything in python. -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- --

verify a user

2006-01-18 Thread David Bear
If I have a unix user name, is there a way to verify that the user really exists and query default group memberships? -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

Re: understanding stat module names

2006-01-18 Thread David Bear
Claudio Grondi wrote: > David Bear wrote: >> I'm trying to use os.chmod and am refered to the stat module. >> >> Is there are explanation of: >> * S_ISUID >> * S_ISGID >> * S_ENFMT >> * S_ISVTX >> * S_IREAD >>

understanding stat module names

2006-01-18 Thread David Bear
x27;S_IROTH', 'S_IRUSR', 'S_IRWXG', 'S_IRWXO', 'S_IRWXU', 'S_ISBLK', 'S_ISCHR', 'S_ISDIR', 'S_ISFIFO', 'S_ISGID', 'S_ISLNK', 'S_ISREG', 'S_ISSOCK', 'S_ISUID', 'S_ISVT

config errors on Freebsd and python 2.3

2006-01-05 Thread David Bear
'm just wondering if there is an 'easy' fix... -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

Re: sql escaping module - Frank Millman Followup

2005-12-08 Thread David Bear
number 1, if the tape column it goes into is of type int or num or float, will the DBAPI really know what to do with the newline? -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

Re: sql escaping module

2005-12-08 Thread David Bear
Fredrik Lundh wrote: > David Bear wrote: > >> Being new to pgdb, I'm finding there are lot of things I don't understand >> when I read the PEP and the sparse documentation on pgdb. >> >> I was hoping there would be a module that would properly esca

sql escaping module

2005-12-07 Thread David Bear
hon string object ends up being a properly type for postgresql. I've bought 3 books on postgresql and none of th code samples demonstrate this. web searchs for 'python sql escape string' yeild way too many results. Any pointers would be greatly appreciated. -- David Bear -- let

Re: insert a dictionary into sql data base

2005-12-06 Thread David Bear
you very much for the greater explanation. Yes, I was not understanding that that %s in one instance was a python string format operator, and in another instance it was a placeholder sent to the dbapi objects (and I supposed on down into the data base cursor) for the parameters following the function call. BIG DIFFERENCE. -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

Re: insert a dictionary into sql data base

2005-12-05 Thread David Bear
Fredrik Lundh wrote: > David Bear wrote > >> Fredrik Lundh wrote: >> >> > cursor.execute( >> > "INSERT INTO table (%s) VALUES (%%s);" % (",".join(fields)), >> > *values >> > ) >> >> Thanks

Re: insert a dictionary into sql data base

2005-12-05 Thread David Bear
Fredrik Lundh wrote: > David Bear wrote > >> Fredrik Lundh wrote: >> >> > cursor.execute( >> > "INSERT INTO table (%s) VALUES (%%s);" % (",".join(fields)), >> > *values >> > ) >> >> Thanks

Re: insert a dictionary into sql data base

2005-12-05 Thread David Bear
print "INSERT INTO table (%s) VALUES (%%s);" % (",".join(fields), *values) ^ SyntaxError: invalid syntax -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

insert a dictionary into sql data base

2005-12-05 Thread David Bear
ls are represented as lists. So, then I need to strip the [] from them, but then ... there must be an easier way. Any advise? -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

Re: email module documentation

2005-11-22 Thread David Bear
Robert Kern wrote: > David Bear wrote: >> I'm confused about how to use the email module in python 2.4.x >> >> I'm using python packaged with suse 9.3. >> >>>From the module documetation at http://docs.python.org/lib/node597.html I >> found th

email module documentation

2005-11-22 Thread David Bear
_name__', 'cStringIO', 'email', 'getMessage', 'sys'] This is nothing like the documentation on python.org. Any idea what I am missing? -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

stringified cPickle

2005-11-17 Thread David Bear
'save.p','w')) I don't really want to write to a file. I know I could write to sys.stdout. But I'd rather collect the string and do some garbage collect, etc before I exit the script. Is there a way to have cPickle just hand me a string? -- David Bear -- let me buy yo

rsync protocol in python

2005-06-27 Thread David Bear
I was wondering if anyone has implemented the rsync protocol in python. -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

a dictionary from a list

2005-06-24 Thread David Bear
ctionary, and the value of the keys set to null? -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

getting an object name

2005-06-21 Thread David Bear
Let's say I have a list called, alist. If I pass alist to a function, how can I get the name of it? alist = range(10) def afunction(list): listName = list.__name__ (fails for a list object) -- http://mail.python.org/mailman/listinfo/python-list

reading a list from a file

2005-06-20 Thread David Bear
r = " ' " Well, reading character by char until I have the list and then parse it all myself. I was hoping there was a pythonic way of doing this.. -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

just learning eric ide

2005-06-13 Thread David Bear
seems like a terrific environment. -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

EOFError not getting raised

2005-06-09 Thread David Bear
I have been trying to do something like this: f = open('someDocs.str', 'r') try: while True: ln = f.readline() except EOFError: print 'reached eof' f.close() sys.exit(1) However, EOFError is never raised. What am I missing? -- http://mail.python.org/mailman/listinfo/pyt

creating a hex value

2005-06-01 Thread David Bear
delim: do something I've looked at the hex function but it doesn't sound like what I want. -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- -- http://mail.python.org/mailman/listinfo/python-list

ipv4 class

2005-04-12 Thread David Bear
I was hoping to write some network utils and found an ipv4 class written by Keith Dart circa 1999. It doesn't work any longer under python 2.3. I think I found it on starship python and links to his web site point to a non-functional server. anyone know of a simple ipv4 class I might steal...

mod_python and zope

2005-03-31 Thread David Bear
m not really good at experimenting without destroying things. -- David Bear phone: 480-965-8257 fax:480-965-9189 College of Public Programs/ASU Wilson Hall 232 Tempe, AZ 85287-0803 "Beware the IP portfolio, everyone will be suspect of trespassing" -- http://mail.python.org/mailman/listinfo/python-list

return the last item in a list

2005-03-30 Thread David Bear
I've googled for the above and get way too many hits.. I'm looking for an 'easy' way to have the last item in a list returned. I've thought about list[len(list)-1] but thought there would be a more gracefull way. -- http://mail.python.org/mailman/listinfo/python-list

query python env

2005-01-13 Thread David Bear
How does one query the python environment, ie pythonhome, pythonpath, etc. also, are there any HOWTO's on keeping multiple versions of python happy? -- http://mail.python.org/mailman/listinfo/python-list