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 torr...@gmail.com 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

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 objects

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 or

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 english

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 torr...@gmail.com 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

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've

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: MySQLdb insert HTML code error

2012-12-11 Thread Chris Angelico
On Tue, Dec 11, 2012 at 11:46 AM, Anatoli Hristov toli...@gmail.com 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

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 code

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

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. It's

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

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-

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

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.. --

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..

Re: forking and avoiding zombies!

2012-12-11 Thread andrea crotti
2012/12/11 peter pjmak...@gmail.com: 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,

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 perfect

Re: problem with usbtmc-communication

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

Re: forking and avoiding zombies!

2012-12-11 Thread andrea crotti
2012/12/11 Jean-Michel Pichavant jeanmic...@sequans.com: - 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

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 accuracy. Not

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

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

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 ?

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 pointers (pass

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 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: 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

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

[ANN] DjangoCon Europe 2013 call for papers

2012-12-11 Thread D.M. Procida
DjangoCon Europe http://2013.djangocon.eu 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

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

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

Re: Establishing Https connection

2012-12-11 Thread Kwpolska
On Tue, Dec 11, 2012 at 7:26 PM, nenad.ci...@gmail.com 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[,

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.

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Marc Christiansen
Greg Donald gdon...@gmail.com 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

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 jeandubois...@gmail.com wrote: On 10 dec, 16:34, w...@mac.com wrote: On Dec 10, 2012, at 8:31 AM, Jean Dubois jeandubois...@gmail.com wrote: [byte] As you can see this approach suffers from the same

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 built-in method update of Thesaurus object at 0x01DB30C8 I've noticed this but it's mostly pointless, as meaningful code does work. (Also you stepped on

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

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 tjre...@udel.edu wrote: The turns an O(n) problem into a slow O(n*n) solution. Much

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

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.Thesaurus t =

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

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

2012-12-11 Thread Tim Delaney
On 12 December 2012 07:52, Ross Ridge rri...@csclub.uwaterloo.ca 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

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 d...@linkscape.net 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

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: MySQLdb compare lower

2012-12-11 Thread John Gordon
In mailman.742.1355259688.29569.python-l...@python.org Anatoli Hristov toli...@gmail.com 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):

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 ian.g.ke...@gmail.com 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

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 nowhere-spamcop,

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

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, so

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

2012-12-11 Thread Cameron Simpson
On 11Dec2012 15:57, Dave Cinege d...@linkscape.net wrote: | On Tuesday 11 December 2012 01:41:38 Ian Kelly wrote: | running into bugs like this: | thes = Thesaurus() | thes.update = 'now' | thes.update | | built-in method update of Thesaurus object at 0x01DB30C8 | | I've noticed this

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. --

Re: MySQLdb compare lower

2012-12-11 Thread Cameron Simpson
On 11Dec2012 22:01, Anatoli Hristov toli...@gmail.com 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,

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

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 miguelc...@gmail.com wrote: Hello, I am learning python and i have the next problem and i not

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, we'd

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 d...@davea.name 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

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:

Re: forking and avoiding zombies!

2012-12-11 Thread andrea crotti
2012/12/11 Dennis Lee Bieber wlfr...@ix.netcom.com: On Tue, 11 Dec 2012 10:34:23 -0300, peter pjmak...@gmail.com declaimed the following in gmane.comp.python.general: stderrfile = '%s/error.log' % os.getcwd() stdoutfile = '%s/out.log' % os.getcwd() Ouch... stdoutfile =

Re: The Zen of Zope, by Alex Clark

2012-12-11 Thread alex23
On Dec 12, 7:23 am, Alex Clark acl...@aclark.net 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

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 d...@davea.name 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: 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 would

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

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 acl...@aclark.net 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

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 to create

Re: problem with usbtmc-communication

2012-12-11 Thread wrw
On Dec 11, 2012, at 3:48 PM, Jean Dubois jeandubois...@gmail.com 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

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: Matplotlib/Pylab Error

2012-12-11 Thread Oscar Benjamin
On 10 December 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 am trying to enumerate them as follows. i) import numpy import

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 them as

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

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

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 works,

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 use...@solar-empire.de wrote: parse('1. Januar 2013') Traceback (most recent call last): File stdin, line 1, in module File /usr/lib64/python3.3/site-packages/dateutil/parser.py, line 720, in parse return

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 steve+comp.lang.pyt...@pearwood.info 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

Re: problem with usbtmc-communication

2012-12-11 Thread Jerry Hill
On Tue, Dec 11, 2012 at 1:58 AM, Jean Dubois jeandubois...@gmail.com 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=BElc=dut Thanks for that link. I think it explains how

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 instead of type

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 instead of type

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 steve+comp.lang.pyt...@pearwood.info 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

[issue16659] Pure Python implementation of random

2012-12-11 Thread Mark Dickinson
Mark Dickinson added the comment: I wonder whether it would make sense to use an array to hold the MT state, for a closer match with the C code. (Not sure whether this would have a noticeable effect on performance.) -- ___ Python tracker

[issue16662] load_tests not invoked in package/__init__.py

2012-12-11 Thread Robert Collins
New submission from Robert Collins: In loader.py: if fnmatch(path, pattern): # only check load_tests if the package directory itself matches the filter name = self._get_name_from_path(full_path) package =

[issue12600] Add example of using load_tests to parameterise Test Cases

2012-12-11 Thread Robert Collins
Robert Collins added the comment: BTW I'm very happy with testscenarios (on pypi) for this, modulo one small issue which is the use of __str__ by the stdlib [which isn't easily overridable - there is a separate issue on that]. I'd be delighted to have testscenarios be in the stdlib, if thats

[issue16659] Pure Python implementation of random

2012-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Patch updated. Tests now test both implementation. Thank Ezio for tip. -- Added file: http://bugs.python.org/file28279/random_pure_python_2.patch ___ Python tracker rep...@bugs.python.org

[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- dependencies: +Pure Python implementation of random ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16651 ___

[issue16659] Pure Python implementation of random

2012-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I wonder whether it would make sense to use an array to hold the MT state, for a closer match with the C code. I don't think it makes sense. The algorithm is same and list is more natural for Python. Also arrays a little slower than lists, but it doesn't

[issue16656] os.walk ignores international dirs on Windows

2012-12-11 Thread anatoly techtonik
anatoly techtonik added the comment: In Python 3 it fails with UnicodeEncodeError in C:\Python33\lib\encodings\cp437.py, while Vista's 'dir' command shows everything correctly in the same console, so somebody definitely overlooked that aspect. This bug is clearly an issue for developers who

[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: What's the purpose of these alternate implementations? For education, experiments? As a replacement for other VMs? Other modules that could be considered: marshal operator unicodedata -- ___ Python tracker

[issue16656] os.walk ignores international dirs on Windows

2012-12-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: - Do you have a full traceback of the failing os.walk() in Python3.3? - What's the result of os.listdir(u'.') ? -- nosy: +amaury.forgeotdarc status: pending - open ___ Python tracker rep...@bugs.python.org

[issue1748064] inspect.getargspec fails on built-in or slot wrapper methods

2012-12-11 Thread Andrew Svetlov
Andrew Svetlov added the comment: Close the issue as duplicate for #16490 -- nosy: +asvetlov resolution: - duplicate stage: test needed - committed/rejected status: open - closed superseder: - inspect.getargspec() and inspect.getcallargs() don't work for builtins

[issue16656] os.walk ignores international dirs on Windows

2012-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What are the results of os.listdir(b'.') and os.listdir(u'.') on Python 2.7 and Python 3.3+? What are the results of os.stat(b'Русское имя') and os.stat(b'Русское имя') on Python 2.7 and Python 3.3+? What are the results of sys.getdefaultencoding(),

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-11 Thread Andrew Svetlov
Andrew Svetlov added the comment: How Argument Clinic solves problems like #16490? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16612 ___ ___

[issue16659] Pure Python implementation of random

2012-12-11 Thread Brett Cannon
Brett Cannon added the comment: To see how to write tests that exercise both the C and Python versions look at test_heapq and test_warnings as examples. It will require some refactoring, but it's easy to do. -- ___ Python tracker

[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-11 Thread Brett Cannon
Brett Cannon added the comment: Alex: yes, the builtins could almost all be re-implemented in pure Python, but there is a performance consideration vs. benefit (e.g. if we re-implemented map() in Python which VMs would use it vs. implement it in some native way for performance?). But one

[issue16656] os.walk ignores international dirs on Windows

2012-12-11 Thread R. David Murray
R. David Murray added the comment: My guess is that your unicode issue is issue 1602, which is non-trivial to solve. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___

[issue16662] load_tests not invoked in package/__init__.py

2012-12-11 Thread R. David Murray
R. David Murray added the comment: test_email is a package, and has a load_tests in its __init__.py that I had to add in order to make python -m unittest test.test_email work. So I'm not sure what bug you are reporting here. -- nosy: +r.david.murray

[issue16663] Poor documentation for METH_KEYWORDS

2012-12-11 Thread r3m0t
New submission from r3m0t: http://docs.python.org/3.3/c-api/structures.html#METH_KEYWORDS Methods with these flags must be of type PyCFunctionWithKeywords. The function expects three parameters: self, args, and a dictionary of all the keyword arguments. The flag is typically combined with

[issue16659] Pure Python implementation of random

2012-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, I used test_heapq and test_decimal as an example. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16659 ___

[issue16659] Pure Python implementation of random

2012-12-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28278/random_pure_python.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16659 ___

[issue16656] os.walk ignores international dirs on Windows

2012-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My guess is that your unicode issue is issue 1602, which is non-trivial to solve. In such case the output will be something like: ['English name', ''] [] [] -- ___ Python tracker rep...@bugs.python.org

[issue16596] Skip stack unwinding when next, until and return pdb commands executed in generator context

2012-12-11 Thread Xavier de Gaye
Xavier de Gaye added the comment: The 'until' command is also broken (by xdegaye's patch) when issued at a return debug event and not debugging a generator. This new patch fixes both problems. The patch also adds another test case to check that pdb stops after a 'next', 'until' or 'return'

[issue16664] [PATCH] Test Glob: files starting with .

2012-12-11 Thread Sebastian Kreft
New submission from Sebastian Kreft: Please find attached a patch to improve the test cases for the glob module. It adds test cases for files starting with '.'. -- components: Tests files: python.patch keywords: patch messages: 177345 nosy: Sebastian.Kreft priority: normal severity:

  1   2   >