Re: cPAMIE/Python String and Date Comparisons

2005-11-08 Thread RB
Here's an example:

import cPAMIE
import time
from time import sleep


search_txt = 'MSNBC Pairs Chung, Povich'
date_txt = '8 November 2005'

date_tuple = time.strptime(date_txt,'%d %B %Y')
today_tuple = time.localtime()

if date_tuple[:3] == today_tuple[:3]:
print date_txt + ' is today\'s date.'
else:
print date_txt + ' is not today\'s date.'

ie=cPAMIE.PAMIE('http://www.prophet.net/quotes/stocknews.jsp?symbol=MSFT')
sleep(1)# let the browser start loading...

while ie.getIE().Busy:  # wait for the page to fully load
sleep(1)
sleep(1)# extra pauses tend to help.

# Get ASCII string of page data without HTML tags.
page_txt =
str((ie.getIE().Document.body.innerText).encode('ascii','ignore'))

if search_txt in page_txt:
print '\"' + search_txt + '\"' + ' found on page.'
else:
print '\"' + search_txt + '\"' + ' not found on page.'

ie.Quit() 



-RB

-- 
http://mail.python.org/mailman/listinfo/python-list


silent error in email module

2006-11-27 Thread rb . online
Hi all,

I rencently had trouble finding a bug in an email processing script
because of an error that pass silently in the email module.
The get_payload() method in the email.message module always return
something when the decode argument is set to True.
This behaviour is well documented, but is their a reason to catch the
decoding errors ?
Why not let them pop-up to the calling code ?
Do you think it's worth submitting a RFE ?

renaud

-- 
http://mail.python.org/mailman/listinfo/python-list


Python 2.3.7 Does not compile on Ubuntu 8.10 i386

2008-11-05 Thread tilley . rb
Hi guys,

Testing some older versions of Python. 2.2.3 compiled and runs just
fine on same machine. I get this error during 2.3.7 make:

case $MAKEFLAGS in \
*-s*)  CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-
DNDEBUG -g -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q
build;; \
*)  CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG -
g -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py build;; \
esac
*** buffer overflow detected ***: ./python terminated
=== Backtrace: =
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0x4016e558]
/lib/tls/i686/cmov/libc.so.6[0x4016c680]
/lib/tls/i686/cmov/libc.so.6[0x4016cde8]
./python(PySys_SetArgv+0x150)[0x80deeb0]
./python(Py_Main+0x324)[0x8056864]
./python(main+0x22)[0x8056512]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0x4008a685]
./python[0x8056451]
=== Memory map: 
08048000-08119000 r-xp  08:01 41855033   /home/brad/Desktop/
Python-2.3.7/python
08119000-0811a000 r--p 000d 08:01 41855033   /home/brad/Desktop/
Python-2.3.7/python
0811a000-08138000 rw-p 000d1000 08:01 41855033   /home/brad/Desktop/
Python-2.3.7/python
08138000-0813b000 rw-p 08138000 00:00 0
0958a000-095f9000 rw-p 0958a000 00:00 0  [heap]
4000-4001a000 r-xp  08:01 37863443   /lib/ld-2.8.90.so
4001a000-4001b000 r-xp 4001a000 00:00 0  [vdso]
4001b000-4001c000 r--p 0001a000 08:01 37863443   /lib/ld-2.8.90.so
4001c000-4001d000 rw-p 0001b000 08:01 37863443   /lib/ld-2.8.90.so
4001d000-4001f000 rw-p 4001d000 00:00 0
4001f000-40026000 r--s  08:01 43081971   /usr/lib/gconv/gconv-
modules.cache
4002c000-40041000 r-xp  08:01 37881007   /lib/tls/i686/cmov/
libpthread-2.8.90.so
40041000-40042000 r--p 00014000 08:01 37881007   /lib/tls/i686/cmov/
libpthread-2.8.90.so
40042000-40043000 rw-p 00015000 08:01 37881007   /lib/tls/i686/cmov/
libpthread-2.8.90.so
40043000-40045000 rw-p 40043000 00:00 0
40045000-40047000 r-xp  08:01 37880987   /lib/tls/i686/cmov/
libdl-2.8.90.so
40047000-40048000 r--p 1000 08:01 37880987   /lib/tls/i686/cmov/
libdl-2.8.90.so
40048000-40049000 rw-p 2000 08:01 37880987   /lib/tls/i686/cmov/
libdl-2.8.90.so
40049000-4004b000 r-xp  08:01 37881015   /lib/tls/i686/cmov/
libutil-2.8.90.so
4004b000-4004c000 r--p 1000 08:01 37881015   /lib/tls/i686/cmov/
libutil-2.8.90.so
4004c000-4004d000 rw-p 2000 08:01 37881015   /lib/tls/i686/cmov/
libutil-2.8.90.so
4004d000-40071000 r-xp  08:01 37880989   /lib/tls/i686/cmov/
libm-2.8.90.so
40071000-40072000 r--p 00023000 08:01 37880989   /lib/tls/i686/cmov/
libm-2.8.90.so
40072000-40073000 rw-p 00024000 08:01 37880989   /lib/tls/i686/cmov/
libm-2.8.90.so
40073000-40074000 rw-p 40073000 00:00 0
40074000-401cc000 r-xp  08:01 37880981   /lib/tls/i686/cmov/
libc-2.8.90.so
401cc000-401ce000 r--p 00158000 08:01 37880981   /lib/tls/i686/cmov/
libc-2.8.90.so
401ce000-401cf000 rw-p 0015a000 08:01 37880981   /lib/tls/i686/cmov/
libc-2.8.90.so
401cf000-40318000 rw-p 401cf000 00:00 0
40318000-40357000 r--p  08:01 13140898   /usr/lib/locale/
en_US.utf8/LC_CTYPE
40364000-40371000 r-xp  08:01 37863486   /lib/libgcc_s.so.1
40371000-40372000 r--p c000 08:01 37863486   /lib/libgcc_s.so.1
40372000-40373000 rw-p d000 08:01 37863486   /lib/libgcc_s.so.1
bfb7e000-bfb93000 rw-p bffeb000 00:00 0  [stack]
Aborted
make: *** [sharedmods] Error 134

Any tips?

Thanks
--
http://mail.python.org/mailman/listinfo/python-list