Re: Semaphore Techniques

2009-07-28 Thread Carl Banks
On Jul 28, 3:15 pm, John D Giotta wrote: > I'm looking to run a process with a limit of 3 instances, but each > execution is over a crontab interval. I've been investigating the > threading module and using daemons to limit active thread objects, but > I'm not very successful at grasping the docum

Re: need help using Tkinter

2009-07-28 Thread Jan Kaliszewski
28-07-2009 o 17:17 Manzur Ahmed wrote: i wanted to ask you if one of you could help me to use Tkinter. i'm trying to just create a simple GUI for which I have provided the code for below. [snip] i tried to google search this and there were some threads that were saying to install tcl but t

Re: xlrd - insert column?

2009-07-28 Thread John Machin
On Jul 29, 6:05 am, LeeRisq wrote: > Does xlrd have the capability to insert a column? No. If there was anything in the PyPI description, the README, or the docs that gave you the faintest hope that xlrd does anything other than read Excel files, please raise a documentation bug-fix request. Sta

Re: bad certificate error

2009-07-28 Thread Nobody
On Tue, 28 Jul 2009 21:44:05 +0200, Piet van Oostrum wrote: >>j># cert_file is a PEM formatted certificate chain file. >>j>connection = httplib.HTTPSConnection(host, int(port), key_file, >>j> cert_file) > > What happens if you set cert_file to None? This would indicate tha

Re: New implementation of re module

2009-07-28 Thread MRAB
William Dode wrote: On 28-07-2009, MRAB wrote: With the official Python 2.6 distribution for Mac OS X it works. The source code is intended to replace the current 're' module in Python 2.7 (and I'll be porting it to Python 3.2), so I'm not that worried about Python versions earlier than 2.6 for

Re: Regular expression solution

2009-07-28 Thread Nobody
On Tue, 28 Jul 2009 16:12:19 -0700, nickname wrote: > I'm a newbie with python. I am looking to write a regex > program which can take in a piece of text and remove some parts of it > and supply the remaining parts back. > > The input can be something like: > document.write("h" +"e"+

merge two png pic

2009-07-28 Thread cocobear
This two png file has their own palette >>> im1.mode 'P' >>> im.mode 'P' >>> im.getpalette == im1.getpalette False I can use this code to merge two png pic together: Map = Image.new("RGB", (x,y)) Map.paste(im, box) Map.paste(im1,box) Map = Map.convert("L", optimize=True, palette=Image.ADAPTIVE)

Re: merge two png pic

2009-07-28 Thread Xavier Ho
On Wed, Jul 29, 2009 at 11:20 AM, cocobear wrote: > > >>> Image.new("RGB",(44544,38656)) > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 1710, in > new >return Image()._new(core.fill(mode, size, color)) > MemoryError

Re: Suggestions for Python MapReduce?

2009-07-28 Thread Phillip B Oldham
In answer to my own question, I came across Octo.py[1] today. Not tested/played-with/used it yet, however, though it seems simple enough. Still welcoming any suggestions for other/similar tools. [1] http://code.google.com/p/octopy/ -- http://mail.python.org/mailman/listinfo/python-list

Re: The longest word

2009-07-28 Thread NiklasRTZ
There were 3 solutions. Everybody's homework is someone's "what's this?" max('asdasfd faop29v8 asejrhjhw awg5w35g aw3g5aw3g kajhsdkfhlskjdhfakljsdhf awg3 aw3'.split(), key=len) sorted("a AAA aa a sdfsdfsdfsdf vv".split(' '),key=len)[-1] sorted("a AAA aa a vv".split(' '),lambda a,b: len

Re: If Scheme is so good why MIT drops it?

2009-07-28 Thread Дамјан Георгиевски
> So do all these OSes have some kind of __mega_unifying_poll system > call that works for anything that might possibly block, that you can > exploit from a user process? On Linux at least, the select/poll/epoll is that system, the trick is to use eventfd, timerfd and signalfd which are Linux spe

Print value CLOB via cx_Oracle

2009-07-28 Thread Vincent Vega
Hi, I call function in Oracle database use cx_Oracle. In standard I define: db = cx_Oracle.connect(username, password, tnsentry) cursor = db.cursor() I create variable 'y' (result function 'fun_name') and call function 'fun_name': y = cursor.var(cx_Oracle.CLOB) cursor.callfunc(fun_name

Re: Regular expression solution

2009-07-28 Thread tiefeng wu
2009/7/29 Nobody : >> The output should be something like >> document.write("hello my name is  21c";) > > import re > r = re.compile(r'"\s*\+\s*"') > s = r'''document.write("h" +"e"+ "ll"+ "o"+ " m" +"y"+" n"+"ame"+ > " is  "+"21c";)''' > r.sub('', s) > Nobody's solution is good. here is m

Re: Regular expression solution

2009-07-28 Thread Brian
On Tue, Jul 28, 2009 at 9:11 PM, tiefeng wu wrote: > 2009/7/29 Nobody : > >> The output should be something like > >> document.write("hello my name is 21c";) > > > > import re > > r = re.compile(r'"\s*\+\s*"') > > s = r'''document.write("h" +"e"+ "ll"+ "o"+ " m" +"y"+" > n"+"ame"+ > > "

simple splash screen?

2009-07-28 Thread NighterNet
I am trying to make a simple splash screen from python 3.1.Not sure where to start looking for it. Can any one help? -- http://mail.python.org/mailman/listinfo/python-list

Re: M2Crypto hangs on this URL

2009-07-28 Thread Heikki Toivonen
John Nagle wrote: > There's something strange about this URL: > > "https://sagar310.pontins.com/sraep/"; The following program finishes fine for me using M2Crypto 0.20beta1 + openssl 0.9.8g. Like Martin mentioned in another message, maybe someone fixed the site. from M2Crypto import SSL ctx = SS

Re: need help using Tkinter

2009-07-28 Thread Manzur Ahmed
i figured it out. its actually because i'm using python 3.1. for python 3.0+, many of the packages are lowercased, tkinter being one of them and so thats why i wan getting a module not found error . . . thanks for getting back to me. manzur On Tue, Jul 28, 2009 at 8:06 PM, Jan Kaliszewski wro

Re: bad certificate error

2009-07-28 Thread Gabriel Genellina
En Tue, 28 Jul 2009 09:02:40 -0300, Steven D'Aprano escribió: On Mon, 27 Jul 2009 23:16:39 -0300, Gabriel Genellina wrote: I don't see the point on "fixing" either the Python script or httplib to accomodate for an invalid server certificate... If it's just for internal testing, I'd use HTTP i

Re: "Deprecated sets module" with Python 2.6

2009-07-28 Thread Gabriel Genellina
En Tue, 28 Jul 2009 17:28:09 -0300, Virgil Stokes escribió: I would appreciate help on correcting a problem when trying to create an *.exe file using py2exe via GUI2exe with Python 2.6.2. When using GUI2exe to create an *.exe I always get the following warning during the compile process:

<    1   2