Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Chris Angelico
On Wed, Dec 12, 2012 at 5:34 PM, Steven D'Aprano wrote: > So, let's see now... I identified that your Thesaurus code: > > * will fail silently; > * contains dead code that is never used; > * contains redundant code that is pointless; > * hides errors in the caller's code; > > and you consider this

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Steven D'Aprano
On Tue, 11 Dec 2012 16:08:34 -0500, Dave Cinege wrote: > On Tuesday 11 December 2012 03:12:19 Steven D'Aprano wrote: > >> Is this intended as a ready-for-production class? > > For me, yes. In production code. > >> py> d = Thesaurus() >> py> d['spam'] = {} > > Maybe because spam is type dict in

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Steven D'Aprano
On Tue, 11 Dec 2012 16:08:34 -0500, Dave Cinege wrote: > On Tuesday 11 December 2012 03:12:19 Steven D'Aprano wrote: > >> Is this intended as a ready-for-production class? > > For me, yes. In production code. > >> py> d = Thesaurus() >> py> d['spam'] = {} > > Maybe because spam is type dict in

Re: problem with usbtmc-communication

2012-12-11 Thread Jerry Hill
On Tue, Dec 11, 2012 at 1:58 AM, Jean Dubois wrote: > > I found examples in the usbtmc kernel driver documentation (the > examples there are given in C): > http://www.home.agilent.com/upload/cmc_upload/All/usbtmc.htm?&cc=BE&lc=dut Thanks for that link. I think it explains how the driver works pr

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Greg Donald
On Tue, Dec 11, 2012 at 11:05 PM, Steven D'Aprano wrote: > The question is not "will it parse", but will it parse CORRECTLY? > > What will it parse 11/12/10 as, and how do you know that is the intended > date? If it were me I'd look at more of the source dates I was tasked with parsing and dial i

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Greg Donald
On Tue, Dec 11, 2012 at 2:18 PM, Marc Christiansen wrote: parse('1. Januar 2013') > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib64/python3.3/site-packages/dateutil/parser.py", line 720, in > parse > return DEFAULTPARSER.parse(timestr, **kwargs) > File

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Steven D'Aprano
On Tue, 11 Dec 2012 02:35:29 -0600, Greg Donald wrote: > On Mon, Dec 10, 2012 at 10:34:31PM -0700, Michael Torrie wrote: >> I use a module I got from pypi called dateutil. It has a nice >> submodule called parser that can handle a variety of date formats with >> good accuracy. Not sure how it wo

PyParsing contextual suggestions?

2012-12-11 Thread Tim Chase
I've just started tinkering around with PyParsing and have unable to come up with an answer to the following without deep diving into the code. Is there a way to do a partial parsing and then get the list of possible things that could appear at the terminus of the parsing? My hope is to implement

Re: Matplotlib/Pylab Error

2012-12-11 Thread Mark Lawrence
On 10/12/2012 20:40, subhabangal...@gmail.com wrote: Dear Group, I am trying to enumerate few interesting errors on pylab/matplotlib. If any of the learned members can kindly let me know how should I address them. I think you'd get more responses if you post your questions on the matplotlib

Re: Matplotlib/Pylab Error

2012-12-11 Thread subhabangalore
On Tuesday, December 11, 2012 2:10:07 AM UTC+5:30, subhaba...@gmail.com wrote: > Dear Group, > > > > I am trying to enumerate few interesting errors on pylab/matplotlib. > > If any of the learned members can kindly let me know how should I address > them. > > > > I am trying to enumerate t

Re: Matplotlib/Pylab Error

2012-12-11 Thread Oscar Benjamin
On 10 December 2012 20:40, wrote: > Dear Group, > > I am trying to enumerate few interesting errors on pylab/matplotlib. > If any of the learned members can kindly let me know how should I address > them. > > I am trying to enumerate them as follows. > > i) >>> import numpy import pylab >>>

Re: Establishing Https connection

2012-12-11 Thread nenad . cikic
Many thanks, I will check it. Nenad -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with usbtmc-communication

2012-12-11 Thread wrw
On Dec 11, 2012, at 3:48 PM, Jean Dubois wrote: [byte] >> >> OK - I see where the examples came from, and I notice - >> >> int my_inst; >> my_inst=open(“/dev/usbtmc1”,O_RDWR); >> write(my_inst,”*RST\n”,5); >> close(my_inst); >> >> and similarly in another place

Re: Create xml with elementtree ET and xml escaping

2012-12-11 Thread nenad . cikic
Il giorno martedì 11 dicembre 2012 20:59:54 UTC+1, MRAB ha scritto: > > Hello, I have posted the same in XML group but it seems pretty dead there > > so I will repost here. > > > > > > I am new to xml processing in python. > > > I am looking to create XML. Xml is not too difficult so I thought

Re: The Zen of Zope, by Alex Clark

2012-12-11 Thread Alex Clark
On 2012-12-12 00:36:29 +, alex23 said: On Dec 12, 7:23 am, Alex Clark wrote: TL;DR: Zope has a lot to offer, and there are times when you may need its libraries to perform complex tasks. I always avoided Zope as I kept hearing "there's the Python way and then there's the Zope way", howev

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Mitya Sirenef
On 12/11/2012 07:53 PM, Mitya Sirenef wrote: By the way, the Thesaurus class reminds me of using the old recipe called 'Bunch': http://code.activestate.com/recipes/52308-the-simple-but-handy-collector-of-a-bunch-of-named/ like this: b = Bunch(x=1) b.stuff = Bunch(y=2) b.stuff.y 2 Sorry,

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Mitya Sirenef
On 12/11/2012 05:39 PM, Dave Cinege wrote: On Tuesday 11 December 2012 16:53:12 Ian Kelly wrote: > >> Just out of curiosity, how old are we talking? enumerate was added in >> Python 2.3, which is nearly 10 years old. Prior to 2.2 I don't think >> it was even possible to subclass dict, which wou

Re: Problem with print and output to screen

2012-12-11 Thread Mike
El martes, 11 de diciembre de 2012 20:07:09 UTC-3, Joel Goldstick escribió: > On Tue, Dec 11, 2012 at 6:00 PM, Dave Angel wrote: > > > On 12/11/2012 05:53 PM, Joel Goldstick wrote: > > > When you read the file line by line the end of line character is included > > > in the result > > > > >

Re: The Zen of Zope, by Alex Clark

2012-12-11 Thread alex23
On Dec 12, 7:23 am, Alex Clark wrote: > TL;DR: Zope has a lot to offer, and there are times when you may need > its libraries to perform complex tasks. I always avoided Zope as I kept hearing "there's the Python way and then there's the Zope way", however, all that did is lead me to avoid a frame

Re: forking and avoiding zombies!

2012-12-11 Thread andrea crotti
2012/12/11 Dennis Lee Bieber : > On Tue, 11 Dec 2012 10:34:23 -0300, peter declaimed > the following in gmane.comp.python.general: > >> >> stderrfile = '%s/error.log' % os.getcwd() >> stdoutfile = '%s/out.log' % os.getcwd() >> > Ouch... > > stdoutfile = os.path.join(os.getcwd(), "o

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Dave Cinege
On Tuesday 11 December 2012 17:39:12 Dave Cinege wrote: My memory is getting jogged more why did some things: raise KeyError(key + ' [%s]' % i) I did this to specificly give you the indice that failed recursion but provide the entire key name as it was provided to __getitem__ So if: g.

Re: Problem with print and output to screen

2012-12-11 Thread Joel Goldstick
On Tue, Dec 11, 2012 at 6:00 PM, Dave Angel wrote: > On 12/11/2012 05:53 PM, Joel Goldstick wrote: > > When you read the file line by line the end of line character is included > > in the result > > > > try user[:-1] instead to strip the return from your printed text > > > > The catch to that is

Re: Problem with print and output to screen

2012-12-11 Thread Dave Angel
On 12/11/2012 05:53 PM, Joel Goldstick wrote: > When you read the file line by line the end of line character is included > in the result > > try user[:-1] instead to strip the return from your printed text > The catch to that is the last line in the file might not have a newline. In that case, w

Re: Problem with print and output to screen

2012-12-11 Thread Joel Goldstick
When you read the file line by line the end of line character is included in the result try user[:-1] instead to strip the return from your printed text On Tue, Dec 11, 2012 at 5:31 PM, Mike wrote: > Hello, I am learning python and i have the next problem and i not > understand how fix. > The

Re: Problem with print and output to screen

2012-12-11 Thread Dave Angel
On 12/11/2012 05:31 PM, Mike wrote: > Hello, I am learning python and i have the next problem and i not understand > how fix. > The script is very simple, shows in the terminal the command but, the row is > divided in two: > Example: > > > /opt/zimbra/bin/zmprov ga u...@example.com > |egrep "(z

Re: MySQLdb compare lower

2012-12-11 Thread Cameron Simpson
On 11Dec2012 22:01, Anatoli Hristov wrote: | Excuse me for the noob question, but is there a way to compare a field | in mysql as lower() somehow? | | I have a situation where I compare the SKU in my DB and there are some | SKU that are with lowercase and some with uppercase, how can I solve | th

Re: MySQLdb compare lower

2012-12-11 Thread Anatoli Hristov
> I think this will work: > > sql = 'UPDATE product SET price=%s WHERE LOWER(sku)=%s' > cursor.execute(sql, (price, sku.lower()) > Thanks John, this works, I was about to make double check with lower and upper, but this saves me :) Thanks a lot. -- http://mail.python.org/mailman/listinfo/

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Cameron Simpson
On 11Dec2012 15:57, Dave Cinege wrote: | On Tuesday 11 December 2012 01:41:38 Ian Kelly wrote: | > running into bugs like this: | > >>> thes = Thesaurus() | > >>> thes.update = 'now' | > >>> thes.update | > | > | | I've noticed this but it's mostly pointless, as meaningful code does work. | (Al

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Dave Cinege
On Tuesday 11 December 2012 16:53:12 Ian Kelly wrote: > Just out of curiosity, how old are we talking? enumerate was added in > Python 2.3, which is nearly 10 years old. Prior to 2.2 I don't think > it was even possible to subclass dict, which would make your Thesaurus > implementation unusable,

Problem with print and output to screen

2012-12-11 Thread Mike
Hello, I am learning python and i have the next problem and i not understand how fix. The script is very simple, shows in the terminal the command but, the row is divided in two: Example: /opt/zimbra/bin/zmprov ga u...@example.com |egrep "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForward

Re: String manipulation in python..NEED HELP!!!!

2012-12-11 Thread Peter Pearson
On Tue, 11 Dec 2012 16:39:27 +, duncan smith wrote: [snip] > >>> alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" > >>> key = "XPMGTDHLYONZBWEARKJUFSCIQV" > >>> mapping = {} > >>> for i, ch in enumerate(alpha): > mapping[ch] = key[i] mapping = dict(zip(alpha, key)) -- To email me, substitute nowhe

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Ian Kelly
On Tue, Dec 11, 2012 at 2:53 PM, Ian Kelly wrote: > and then I ran the examples, and the output was unchanged. As Steven > pointed out, I don't see how that first branch could succeed anyway, > since self.data is never defined. It occurs to me that the UserDict class does have a data attribute.

Re: MySQLdb compare lower

2012-12-11 Thread John Gordon
In Anatoli Hristov writes: > I have a situation where I compare the SKU in my DB and there are some > SKU that are with lowercase and some with uppercase, how can I solve > this in your opinion ? > def Update_SQL(price, sku): > db = MySQLdb.connect("localhost","getit","opencart", > use_un

Re: accessing an OLE Automation (IDispatch) server from python which requires the use of "out params"

2012-12-11 Thread Mark Hammond
On 12/12/2012 2:48 AM, bitbucket wrote: On Monday, December 10, 2012 8:16:43 PM UTC-5, Mark Hammond wrote: "out" params are best supported if the object supplied a typelib - then Python knows the params are out and does the right thing automagically. If out params are detected, the result of the

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Ian Kelly
On Tue, Dec 11, 2012 at 1:57 PM, Dave Cinege wrote: > On Tuesday 11 December 2012 01:41:38 Ian Kelly wrote: >> Second, in __getitem__ you start a loop with "for i in >> range(len(l)):", and then you use i as an index into l several times. >> It would be cleaner and more Pythonic to do "for i, part

Re: String manipulation in python..NEED HELP!!!!

2012-12-11 Thread Tim Delaney
On 12 December 2012 07:52, Ross Ridge wrote: > John Gordon wrote: > > def encode(plain): > > '''Return a substituted version of the plain text.''' > > encoded = '' > > for ch in plain: > >encoded += key[alpha.index(ch)] > > return encoded > > Terry Reedy wrote: > >The tu

Re: The Zen of Zope, by Alex Clark

2012-12-11 Thread Alex Clark
On 2012-12-11 21:01:03 +, Gregory Ewing said: Steven D'Aprano wrote: On Sun, 09 Dec 2012 20:13:43 -0500, Alex Clark wrote: > The Zen of Zope, by Alex Clark I expect that I would find that hilarious if I knew anything about Zope :) It's probably a good thing I don't know much about Zo

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Dave Cinege
On Tuesday 11 December 2012 03:12:19 Steven D'Aprano wrote: > Is this intended as a ready-for-production class? For me, yes. In production code. > py> d = Thesaurus() > py> d['spam'] = {} Maybe because spam is type dict instead of type thes??? >>> import thesaurus >>> thes = thesaurus.Thesauru

Re: The Zen of Zope, by Alex Clark

2012-12-11 Thread Gregory Ewing
Steven D'Aprano wrote: On Sun, 09 Dec 2012 20:13:43 -0500, Alex Clark wrote: > The Zen of Zope, by Alex Clark I expect that I would find that hilarious if I knew anything about Zope :) It's probably a good thing I don't know much about Zope, because I'm already finding it hilarious. If I kn

Re: String manipulation in python..NEED HELP!!!!

2012-12-11 Thread Ross Ridge
John Gordon wrote: > def encode(plain): > '''Return a substituted version of the plain text.''' > encoded = '' > for ch in plain: >encoded += key[alpha.index(ch)] > return encoded Terry Reedy wrote: >The turns an O(n) problem into a slow O(n*n) solution. Much better to >

MySQLdb compare lower

2012-12-11 Thread Anatoli Hristov
Hello guys, Excuse me for the noob question, but is there a way to compare a field in mysql as lower() somehow? I have a situation where I compare the SKU in my DB and there are some SKU that are with lowercase and some with uppercase, how can I solve this in your opinion ? def Update_SQL(price,

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Dave Cinege
On Tuesday 11 December 2012 01:41:38 Ian Kelly wrote: > running into bugs like this: > >>> thes = Thesaurus() > >>> thes.update = 'now' > >>> thes.update > > I've noticed this but it's mostly pointless, as meaningful code does work. (Also you stepped on the existing 'update()' dictionary method

Re: problem with usbtmc-communication

2012-12-11 Thread Jean Dubois
On 11 dec, 15:34, w...@mac.com wrote: > On Dec 11, 2012, at 1:58 AM, Jean Dubois wrote: > > > > > > > > > > > On 10 dec, 16:34, w...@mac.com wrote: > >> On Dec 10, 2012, at 8:31 AM, Jean Dubois wrote: > > >> [byte] > >>> As you can see this approach suffers from the same "buffer problem" as > >>>

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Marc Christiansen
Greg Donald wrote: > On Mon, Dec 10, 2012 at 10:34:31PM -0700, Michael Torrie wrote: >> I use a module I got from pypi called dateutil. It has a nice submodule >> called parser that can handle a variety of date formats with good >> accuracy. Not sure how it works, but it handles all the common A

Re: Create xml with elementtree ET and xml escaping

2012-12-11 Thread MRAB
On 2012-12-11 17:47, nenad.ci...@gmail.com wrote: Hello, I have posted the same in XML group but it seems pretty dead there so I will repost here. I am new to xml processing in python. I am looking to create XML. Xml is not too difficult so I thought to create it manually using ElementTree. Fi

Re: Establishing Https connection

2012-12-11 Thread Kwpolska
On Tue, Dec 11, 2012 at 7:26 PM, wrote: > Hello, > Once I get my xml populated I have to send it to web service. > Should I use httplib? > I am reading the docs and I have managed to open the connection with > httplib.HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, > timeout[, sour

Re: String manipulation in python..NEED HELP!!!!

2012-12-11 Thread Terry Reedy
On 12/10/2012 5:59 PM, John Gordon wrote: def encode(plain): '''Return a substituted version of the plain text.''' encoded = '' for ch in plain: encoded += key[alpha.index(ch)] return encoded The turns an O(n) problem into a slow O(n*n) solution. Much better to build a

Establishing Https connection

2012-12-11 Thread nenad . cikic
Hello, Once I get my xml populated I have to send it to web service. Should I use httplib? I am reading the docs and I have managed to open the connection with httplib.HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, timeout[, source_address]]) After that i intend to use HTTPConn

[ANN] DjangoCon Europe 2013 call for papers

2012-12-11 Thread D.M. Procida
DjangoCon Europe will be held in Warsaw from the 15th-19th May 2013 (three days of talks followed by two of sprints and workshops). The organisers are very pleased to invite members of the Django community to submit their talk proposals for the event. We're looking for

Create xml with elementtree ET and xml escaping

2012-12-11 Thread nenad . cikic
Hello, I have posted the same in XML group but it seems pretty dead there so I will repost here. I am new to xml processing in python. I am looking to create XML. Xml is not too difficult so I thought to create it manually using ElementTree. First I noted that ET.toString does escape <>& but not

Re: String manipulation in python..NEED HELP!!!!

2012-12-11 Thread duncan smith
On 10/12/12 22:38, qbai...@ihets.org wrote: I need help with a program i am doing. it is a cryptography program. i am given a regular alphabet and a key. i need to use the user input and use the regular alphabet and use the corresponding letter in the key and that becomes the new letter. i hav

Re: accessing an OLE Automation (IDispatch) server from python which requires the use of "out params"

2012-12-11 Thread bitbucket
On Tuesday, December 11, 2012 10:48:53 AM UTC-5, bitbucket wrote: > > I noticed that the argument type is different for the out param (16392 > instead of 8). However, it doesn't appear to me that its generating return > values instead of args (though I'm not very experienced in python). > I see

Re: accessing an OLE Automation (IDispatch) server from python which requires the use of "out params"

2012-12-11 Thread bitbucket
On Monday, December 10, 2012 8:16:43 PM UTC-5, Mark Hammond wrote: > "out" params are best supported if the object supplied a typelib - then > Python knows the params are out and does the right thing automagically. > If out params are detected, the result of the function will be a tuple > of (

Re: accessing an OLE Automation (IDispatch) server from python which requires the use of "out params"

2012-12-11 Thread bitbucket
On Tuesday, December 11, 2012 3:42:35 AM UTC-5, Paul Kölle wrote: > Before switching technologies I'd check if this solves your problem > > http://geekswithblogs.net/Lance/archive/2009/01/14/pass-by-reference-parameters-in-powershell.aspx > > > TL;DR IMHO "out" parameters are basically pointer

JSON logging ?

2012-12-11 Thread Bart Thate
Is it possible to change hooks or something to let the logging SocketServer stuff handle JSON instead of pickle ? I am thinking of sending my JSON dict data through the logging system to remote. A default standard way to send stuff back and forth would be welcome here. pickle uses eval still ? o

Re: forking and avoiding zombies!

2012-12-11 Thread Thomas Rachel
Am 11.12.2012 14:34 schrieb peter: On 12/11/2012 10:25 AM, andrea crotti wrote: Ah sure that makes sense! But actually why do I need to move away from the current directory of the parent process? In my case it's actually useful to be in the same directory, so maybe I can skip that part, or othe

Re: forking and avoiding zombies!

2012-12-11 Thread peter
On 12/11/2012 10:57 AM, andrea crotti wrote: where in [] I have the PID of the process. In this suggested way I should use some other files as standard output and error, but for that I already have the logging module that logs in the right place.. It's not realy neccesary do use the stderr and st

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread noydb
On Tuesday, December 11, 2012 3:35:29 AM UTC-5, Greg Donald wrote: > On Mon, Dec 10, 2012 at 10:34:31PM -0700, Michael Torrie wrote: > > > I use a module I got from pypi called dateutil. It has a nice submodule > > > called parser that can handle a variety of date formats with good > > > accura

Re: forking and avoiding zombies!

2012-12-11 Thread andrea crotti
2012/12/11 Jean-Michel Pichavant : > - Original Message - >> So I implemented a simple decorator to run a function in a forked >> process, as below. >> >> It works well but the problem is that the childs end up as zombies on >> one machine, while strangely >> I can't reproduce the same on m

Re: problem with usbtmc-communication

2012-12-11 Thread wrw
On Dec 11, 2012, at 1:58 AM, Jean Dubois wrote: > On 10 dec, 16:34, w...@mac.com wrote: >> On Dec 10, 2012, at 8:31 AM, Jean Dubois wrote: >> >> [byte] >>> As you can see this approach suffers from the same "buffer problem" as >>> the approach with readline did. One now good argue as a workaro

Re: forking and avoiding zombies!

2012-12-11 Thread Jean-Michel Pichavant
- Original Message - > So I implemented a simple decorator to run a function in a forked > process, as below. > > It works well but the problem is that the childs end up as zombies on > one machine, while strangely > I can't reproduce the same on mine.. > > I know that this is not the per

Re: forking and avoiding zombies!

2012-12-11 Thread andrea crotti
2012/12/11 peter : > On 12/11/2012 10:25 AM, andrea crotti wrote: >> >> Ah sure that makes sense! >> >> But actually why do I need to move away from the current directory of >> the parent process? >> In my case it's actually useful to be in the same directory, so maybe >> I can skip that part, >> o

Re: forking and avoiding zombies!

2012-12-11 Thread peter
On 12/11/2012 10:25 AM, andrea crotti wrote: Ah sure that makes sense! But actually why do I need to move away from the current directory of the parent process? In my case it's actually useful to be in the same directory, so maybe I can skip that part, or otherwise I need another chdir after.. Y

Re: forking and avoiding zombies!

2012-12-11 Thread andrea crotti
Ah sure that makes sense! But actually why do I need to move away from the current directory of the parent process? In my case it's actually useful to be in the same directory, so maybe I can skip that part, or otherwise I need another chdir after.. -- http://mail.python.org/mailman/listinfo/pyth

Re: forking and avoiding zombies!

2012-12-11 Thread peter
On 12/11/2012 08:47 AM, andrea crotti wrote: Yes I wanted to avoid to do something too complex, anyway I'll just comment it well and add a link to the original code.. But this is now failing to me: def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): # Perform first fo

m2crypto load from memory to ctx.set_tmp_dh()

2012-12-11 Thread makeit . tsxtsx
o far I have not been able to load the diffie-hellman params on to ctx.set_tmp_dh(), the BIO class should help do that, but "my way" dont works, maybe I need to specify the smime ? here's what I tried: 1) dh_params=""" -BEGIN DH PARAMETERS- MIGHAoGBAJyoxPGR3wxcp8Nf5C3w0Jh9tFk/4eRMuimJN

Re: forking and avoiding zombies!

2012-12-11 Thread andrea crotti
Yes I wanted to avoid to do something too complex, anyway I'll just comment it well and add a link to the original code.. But this is now failing to me: def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): # Perform first fork. try: pid = os.fork() if

Re: MySQLdb insert HTML code error

2012-12-11 Thread Anatoli Hristov
> SSCCE starts with "Short". The HTML you unloaded into that email > hardly qualifies. > > When you're trying to figure out a problem that appears to happen only > when you have X and not when you have Y, see what the smallest example > data for X and Y are that continue to exhibit the difference.

Re: open URL in the current tab

2012-12-11 Thread Jabba Laci
Dear All, If someone is interested, I've made a module out of it. Available here: https://github.com/jabbalaci/jabbapylib/blob/master/jabbapylib/browser/firefox.py It seems you can program your Firefox instance from your script as you want through this add-on. I will explore the possibilities in

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Jean-Michel Pichavant
- Original Message - > Thesaurus: A different way to call a dictionary. > > Thesaurus is a new a dictionary subclass which allows calling keys as > if they are class attributes and will search through nested objects > recursively when __getitem__ is called. > > You will notice that the

Re: MySQLdb insert HTML code error

2012-12-11 Thread Chris Angelico
On Tue, Dec 11, 2012 at 11:46 AM, Anatoli Hristov wrote: >> Brilliant, I think your problem is in line 97 of the code that you *HAVEN'T >> QUOTED*. Please go here, read and inwardly digest before you say anything >> else http://www.sscce.org/ > > :) I thought it was clear. the "spec" is the descr

Re: accessing an OLE Automation (IDispatch) server from python which requires the use of "out params"

2012-12-11 Thread Paul Kölle
Hi, Am 10.12.2012 20:13, schrieb bitbucket: I have an existing Windows application which provides an OLE Automation (IDispatch) interface. I'm not able to change that interface. I'd like to call it from a scripting language. I figure this would provide a nice quick way to invoke on the app.

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Greg Donald
On Mon, Dec 10, 2012 at 10:34:31PM -0700, Michael Torrie wrote: > I use a module I got from pypi called dateutil. It has a nice submodule > called parser that can handle a variety of date formats with good > accuracy. Not sure how it works, but it handles all the common American > date formats I'

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Chris Angelico
n Tue, Dec 11, 2012 at 7:25 PM, Michael Torrie wrote: > On 12/11/2012 01:08 AM, Chris Angelico wrote: >> That sort of statement will get you either amusement or ire, depending >> on the respondent. From me, amusement, because there are enough >> "common American date formats" for you to feel you'v

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Michael Torrie
On 12/11/2012 01:08 AM, Chris Angelico wrote: > That sort of statement will get you either amusement or ire, depending > on the respondent. From me, amusement, because there are enough > "common American date formats" for you to feel you've done a thorough > test. Also what I meant was common "eng

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Michael Torrie
On 12/11/2012 01:08 AM, Chris Angelico wrote: > There are a LOT more date formats than those used in the USA. The most > obvious trio is American MDY, European DMY, Japanese YMD, but there > are plenty more to deal with. Have fun. For the record I didn't write the module, so I don't care whether o

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-11 Thread Steven D'Aprano
On Mon, 10 Dec 2012 22:48:50 -0500, Dave Cinege wrote: > Thesaurus: A different way to call a dictionary. Is this intended as a ready-for-production class? > Thesaurus is a new a dictionary subclass which allows calling keys as if > they are class attributes and will search through nested objec

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Chris Angelico
On Tue, Dec 11, 2012 at 4:34 PM, Michael Torrie wrote: > I use a module I got from pypi called dateutil. It has a nice submodule > called parser that can handle a variety of date formats with good > accuracy. Not sure how it works, but it handles all the common American > date formats I've throw