WSME 0.4b1 released

2012-09-14 Thread Christophe de Vienne
About WSME -- WSME (Web Service Made Easy) is a very easy way to implement webservices in your python web application (or standalone). What's New ? This release brings new features like a Base class for complex types, a File type for transferring files, more restful rest

Karlsruhe (Germany) Python User Group, September 21st 2012, 7pm

2012-09-14 Thread Jürgen A . Erhard
The Karlsruhe Python User Group (KaPy) meets again. Friday, 2012-09-21 (September 21st) at 19:00 (7pm) in the rooms of Entropia eV (the local affiliate of the CCC). See http://entropia.de/wiki/Anfahrt on how to get there. For your calendars: meetings are held monthly, on the 3rd Friday.

Re: Python presentations

2012-09-14 Thread 88888 Dihedral
Chris Angelico於 2012年9月14日星期五UTC+8上午6時39分25秒寫道: On Fri, Sep 14, 2012 at 8:33 AM, Alexander Blinne n...@blinne.net wrote: On 13.09.2012 21:01, 8 Dihedral wrote: def powerlist(x, n): # n is a natural number result=[] y=1 for i in xrange(n):

Re: hi

2012-09-14 Thread alex23
On Sep 14, 3:44 pm, Dwight Hutto dwightdhu...@gmail.com wrote: CEO:http://www.hitwebdevelopment.com I don't know what gives more of a negative impression of your business, your acting like a tedious douchebag or the website itself. -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing strings from the back?

2012-09-14 Thread alex23
On Sep 14, 3:39 pm, Dwight Hutto dwightdhu...@gmail.com wrote: Please explain any logic whatsoever that would give you that conclusion. Well, this: I think you're referring to a play on words(ramit). Using foreign names derogatively is a common tactic of the racist. Ain't I so punny. Not

Re: Guides for communicating with business accounting systems

2012-09-14 Thread Ben Finney
Emile van Sebille em...@fenx.com writes: The only standard I'm aware of is the EDI specification which I first encountered in the mid 70's and which is updated routinely. The full spec is the size of a telephone book (do they even still make those?) Thanks, that's something to look into. And

Re: How to implement a combo Web and Desktop app in python.

2012-09-14 Thread Dieter Maurer
Shawn McElroy luckysm...@gmail.com writes: ... So I need to find a way I can implement this in the best way... It is in general very difficult to say reliable things about the best way. Because, that depends very much on details. My former employer has created a combo destop/online

Re: Guides for communicating with business accounting systems

2012-09-14 Thread Chris Angelico
On Fri, Sep 14, 2012 at 4:28 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: Chris Angelico ros...@gmail.com writes: Don't use MySQL. :) Okay, that's hardly a *rule*, but it's a strong recommendation. That's another struggle we have in our future, unfortunately. We moved from MySQL to

Re: Decorators not worth the effort

2012-09-14 Thread Dieter Maurer
On Sep 14, 3:54 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: I don't like decorators, I think they're not worth the mental effort. Fine. I like them because they can vastly improve reusability and drastically reduce redundancies (which I hate). Improved reusability and reduced

Re: How to implement a combo Web and Desktop app in python.

2012-09-14 Thread Shawn McElroy
This does help. I have not determined if I will make a native UI for the desktop yet. To start I just figured I would use the web based interface, and if needed, use something like qt, or wx. As for the ability to drag items into the user interface, there are javascript libraries that can

Re: hi

2012-09-14 Thread Ian Kelly
On Fri, Sep 14, 2012 at 12:09 AM, alex23 wuwe...@gmail.com wrote: On Sep 14, 3:44 pm, Dwight Hutto dwightdhu...@gmail.com wrote: CEO:http://www.hitwebdevelopment.com I don't know what gives more of a negative impression of your business, your acting like a tedious douchebag or the website

Re: hi

2012-09-14 Thread Dwight Hutto
On Fri, Sep 14, 2012 at 2:09 AM, alex23 wuwe...@gmail.com wrote: On Sep 14, 3:44 pm, Dwight Hutto dwightdhu...@gmail.com wrote: CEO:http://www.hitwebdevelopment.com I don't know what gives more of a negative impression of your business, your acting like a tedious douchebag or the website

Re: pythonOCC examples doesn't work?

2012-09-14 Thread Chris Angelico
On Fri, Sep 14, 2012 at 11:14 AM, Dwight Hutto dwightdhu...@gmail.com wrote: [over a hundred quoted lines snipped] And if you look at the above in gmail, you can see the ...'s that when not clicked, won't show some of the responses I leave just above, and it clips my signature line as well.

Re: hi

2012-09-14 Thread Dwight Hutto
On Fri, Sep 14, 2012 at 3:08 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Fri, Sep 14, 2012 at 12:09 AM, alex23 wuwe...@gmail.com wrote: On Sep 14, 3:44 pm, Dwight Hutto dwightdhu...@gmail.com wrote: CEO:http://www.hitwebdevelopment.com I don't know what gives more of a negative impression

Re: [SOLVED] Least-lossy string.encode to us-ascii?

2012-09-14 Thread Vlastimil Brom
2012/9/14 Tim Chase python.l...@tim.thechases.com: On 09/13/12 16:44, Vlastimil Brom wrote: import unicodedata unicodedata.normalize(NFD, userviço móvil).encode(ascii, ignore).decode(ascii) u'servico movil' Works well for all the test-cases I threw at it. Thanks! -tkc Hi, I am

Re: pythonOCC examples doesn't work?

2012-09-14 Thread Dwight Hutto
honest. How do you feel? Interesting... Um, I guess like an inconsiderate bandwidth hog, but from now on I'll trim more text. First it was too little, and now it's too much. I just tend to cut out some or all depending on the scope of the conversation. If I just hit reply all, and send it

Re: hi

2012-09-14 Thread genban tade
Great to meet you, thank you for your advise 2012/9/14 Dwight Hutto dwightdhu...@gmail.com You'll love it here. It's always amusing. But remember to hit reply all Unless you might want to contact someone personally. Some don't mind, and some may complain. Me I don't care either way.

Re: Comparing strings from the back?

2012-09-14 Thread Dwight Hutto
I think you're referring to a play on words(ramit). Using foreign names derogatively is a common tactic of the racist. Not really. But nice spin on my pun to make me look bad. Keep trying, and maybe you'll come up with an insult/ propaganda that's less obvious to the viewer that you're a

Re: pythonOCC examples doesn't work?

2012-09-14 Thread Chris Angelico
On Fri, Sep 14, 2012 at 5:49 PM, Dwight Hutto dwightdhu...@gmail.com wrote: honest. How do you feel? Interesting... Um, I guess like an inconsiderate bandwidth hog, but from now on I'll trim more text. What you may have missed was that that was a quote from Princess Bride. Don't take it

Re: hi

2012-09-14 Thread alex23
On Sep 14, 5:22 pm, Dwight Hutto dwightdhu...@gmail.com wrote: Completely OT for this discussion. My apologies, I'll leave you to your thrashing around like a giant child then. -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing strings from the back?

2012-09-14 Thread alex23
On Sep 14, 6:04 pm, Dwight Hutto dwightdhu...@gmail.com wrote: Using foreign names derogatively is a common tactic of the racist. Not really. But nice spin on my pun to make me look bad. It actually *is* common behaviour of racists. It's similar to if I said, this is real 'queer' of you to

Re: Comparing strings from the back?

2012-09-14 Thread Dwight Hutto
On Fri, Sep 14, 2012 at 4:20 AM, alex23 wuwe...@gmail.com wrote: On Sep 14, 6:04 pm, Dwight Hutto dwightdhu...@gmail.com wrote: Using foreign names derogatively is a common tactic of the racist. Not really. But nice spin on my pun to make me look bad. It actually *is* common behaviour of

Re: subprocess call is not waiting.

2012-09-14 Thread Hans Mulder
On 13/09/12 19:24:46, woo...@gmail.com wrote: It possibly requires a shell=True, That's almost always a bad idea, and wouldn't affect waiting anyway. but without any code or any way to test, we can not say. That's very true. -- HansM -- http://mail.python.org/mailman/listinfo/python-list

Re: hi

2012-09-14 Thread Dwight Hutto
On Fri, Sep 14, 2012 at 4:16 AM, alex23 wuwe...@gmail.com wrote: On Sep 14, 5:22 pm, Dwight Hutto dwightdhu...@gmail.com wrote: Completely OT for this discussion. My apologies, I'll leave you to your thrashing around like a giant child then. Please explain that one. I usually keep the

Re: Decorators not worth the effort

2012-09-14 Thread Jean-Michel Pichavant
- Original Message - On Sep 14, 3:54 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: I don't like decorators, I think they're not worth the mental effort. Because passing a function to a function is a huge cognitive burden? --

Re: Batching HTTP requests with httplib (Python 2.7)

2012-09-14 Thread Chicken McNuggets
On 14/09/2012 03:31, Cameron Simpson wrote: On 13Sep2012 19:34, Chicken McNuggets chic...@mcnuggets.com wrote: | I'm writing a simple library that communicates with a web service and am | wondering if there are any generally well regarded methods for batching | HTTP requests? | | The problem

Asynchronous Soappy on AppEngine

2012-09-14 Thread Dennis
Hi, I've noticed that my Soappy calls get converted to URLFetch calls on Google AppEngine. There seems to be documentation that UrlFetch can do Asynchronous operations [1] but I'm not really sure how to make the soap operations asynchronous. Tried looking at the Soapproxy class and see if I can

Re: Comparing strings from the back?

2012-09-14 Thread Steven D'Aprano
On Fri, 14 Sep 2012 01:20:53 -0700, alex23 wrote: On Sep 14, 6:04 pm, Dwight Hutto dwightdhu...@gmail.com wrote: [snip] Please don't feed the trolls. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing strings from the back?

2012-09-14 Thread alex23
On Sep 14, 6:53 pm, Dwight Hutto dwightdhu...@gmail.com wrote: Not if there name is ramit. What if your name was john? I'd say I'll be right back, I have to go take a crap on the john. It's a joke about a name, not where it originates. I'd recommend reading up on white privilege but I'm pretty

What's wrong with my arc tangens calculation?

2012-09-14 Thread xliiv
I do some math with python: import math as m m.degrees(m.atan(2)) 63.43494882292201 but when i lookup tg in a paper table (last decade math book) i've got these values: tg(63'10'') = 1.9768 tg(63'20'') = 1.9912 tg(63'30'') = 2.0057 For me python should return something more like 63'2x'' than

Re: What's wrong with my arc tangens calculation?

2012-09-14 Thread Chris Angelico
On Fri, Sep 14, 2012 at 8:49 PM, xliiv tymoteusz.jankow...@gmail.com wrote: I do some math with python: import math as m m.degrees(m.atan(2)) 63.43494882292201 but when i lookup tg in a paper table (last decade math book) i've got these values: tg(63'10'') = 1.9768 tg(63'20'') = 1.9912

Re: What's wrong with my arc tangens calculation?

2012-09-14 Thread Laszlo Nagy
but when i lookup tg in a paper table (last decade math book) i've got these values: tg(63'10'') = 1.9768 tg(63'20'') = 1.9912 tg(63'30'') = 2.0057 For me python should return something more like 63'2x'' than 63'4x''(becasue 63'30'' is higher than 2.0) what's wrong? 63° 30 is 63.5°. So

Re: Batching HTTP requests with httplib (Python 2.7)

2012-09-14 Thread Dwight Hutto
| The problem with most web services is that they require a list of | sequential commands to be executed in a certain order to complete a | given task (or at least the one I am using does) so having to manually | call each command is a bit of a pain. How would you go about the design | of a

Re: What's wrong with my arc tangens calculation?

2012-09-14 Thread xliiv
On Friday, September 14, 2012 12:55:06 PM UTC+2, Laszlo Nagy wrote: but when i lookup tg in a paper table (last decade math book) i've got these values: tg(63'10'') = 1.9768 tg(63'20'') = 1.9912 tg(63'30'') = 2.0057 For me python should return something more like

Re: Decorators not worth the effort

2012-09-14 Thread Duncan Booth
Jean-Michel Pichavant jeanmic...@sequans.com wrote: I wrote the following one, used to decorate any function that access an equipment, it raises an exception when the timeout expires. The timeout is adapted to the platform, ASIC of FPGA so people don't need to specify everytime one timeout

Re: Comparing strings from the back?

2012-09-14 Thread Dwight Hutto
I'd recommend reading up on white privilege but I'm pretty sure it'd be a wasted suggestion. Not really, I tend to like interdisciplinary study. But I'm a little of everything if you like Darwin. It's similar to if I said, this is real 'queer' of you to do ya big pansy, and next you'll be

Re: Comparing strings from the back?

2012-09-14 Thread Dwight Hutto
[snip] Please don't feed the trolls. You're down here under the bridge with the rest of us trolls too, Steven. 24/7 -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python presentations

2012-09-14 Thread Alexander Blinne
On 14.09.2012 00:38, Chris Angelico wrote: On Fri, Sep 14, 2012 at 8:33 AM, Alexander Blinne n...@blinne.net wrote: def powerlist(x,n): if n==1: return [1] p = powerlist(x,n-1) return p + [p[-1]*x] Eh, much simpler. def powerlist(x,n): return [x*i for i in

Re: Decorators not worth the effort

2012-09-14 Thread Steven D'Aprano
On Fri, 14 Sep 2012 11:28:22 +0200, Jean-Michel Pichavant wrote: PS : Here's the decorator, just to give you an idea about how it looks. Small piece of code, but took me more than 2 hours to write it. I removed some sensible parts so I don't expect it to run. [snip timeout class] Holy

Re: Python presentations

2012-09-14 Thread Chris Angelico
On Fri, Sep 14, 2012 at 9:47 PM, Alexander Blinne n...@blinne.net wrote: On 14.09.2012 00:38, Chris Angelico wrote: On Fri, Sep 14, 2012 at 8:33 AM, Alexander Blinne n...@blinne.net wrote: def powerlist(x,n): if n==1: return [1] p = powerlist(x,n-1) return p + [p[-1]*x]

Re: Decorators not worth the effort

2012-09-14 Thread Ulrich Eckhardt
Am 14.09.2012 11:28, schrieb Jean-Michel Pichavant: Decorators are very popular so I kinda already know that the fault is mine. Now to the reason why I have troubles writing them, I don't know. Every time I did use decorators, I spent way too much time writing it (and debugging it). I wrote the

Re: subprocess call is not waiting.

2012-09-14 Thread paulstaten
os.system worked fine, and I found something in another section of code that was causing the Too many open errors. (I was fooled, because output from subprocess call didn't seem to be coming out until the open files error. I'll go back and play with subprocess.call more, since os.system works.

Re: Decorators not worth the effort

2012-09-14 Thread Tim Chase
On 09/14/12 07:01, Steven D'Aprano wrote: [snip timeout class] Holy over-engineering Batman!!! No wonder you don't think much of decorators, [snip] Most of my decorator functions are under a dozen lines. And that's the complicated ones! As are mine, and a sizable chunk of those

Re: What's wrong with my arc tangens calculation?

2012-09-14 Thread Mark Lawrence
On 14/09/2012 11:54, Chris Angelico wrote: On Fri, Sep 14, 2012 at 8:49 PM, xliiv tymoteusz.jankow...@gmail.com wrote: I do some math with python: import math as m m.degrees(m.atan(2)) 63.43494882292201 but when i lookup tg in a paper table (last decade math book) i've got these values:

Re: What's wrong with my arc tangens calculation?

2012-09-14 Thread Chris Angelico
On Fri, Sep 14, 2012 at 11:13 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: Somebody or something has a length, height or width of 63 feet 30 inches? :) Sounds like the height of a building with a barometer. The thirty inches, of course, being the height of the barometer. ChrisA (big, big

Re: Decorators not worth the effort

2012-09-14 Thread Jean-Michel Pichavant
- Original Message - Jean-Michel Pichavant jeanmic...@sequans.com wrote: I wrote the following one, used to decorate any function that access an equipment, it raises an exception when the timeout expires. The timeout is adapted to the platform, ASIC of FPGA so people don't

Re: Decorators not worth the effort

2012-09-14 Thread andrea crotti
I think one very nice and simple example of how decorators can be used is this: def memoize(f, cache={}, *args, **kwargs): def _memoize(*args, **kwargs): key = (args, str(kwargs)) if not key in cache: cache[key] = f(*args, **kwargs) return cache[key]

Re: Decorators not worth the effort

2012-09-14 Thread Chris Angelico
On Sat, Sep 15, 2012 at 12:12 AM, andrea crotti andrea.crott...@gmail.com wrote: def fib(n): if n = 1: return 1 return fib(n-1) + fib(n-2) @memoize def fib_memoized(n): if n = 1: return 1 return fib_memoized(n-1) + fib_memoized(n-2) The second fibonacci

Re: Guides for communicating with business accounting systems

2012-09-14 Thread Walter Hurry
On Fri, 14 Sep 2012 16:36:58 +1000, Chris Angelico wrote: Actually I haven't used Postgres with Python yet. Should probably do that at some point. But the MySQL bindings for Python aren't so awesome they can't be matched by any other. I have found psycopg2 excellent in every respect. --

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-14 Thread Token Type
Thanks. By the way, do we have a list of explanations of error message? If so, whenever we come across error message, we can refer to it and solve the problem accordingly. -- http://mail.python.org/mailman/listinfo/python-list

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-14 Thread Chris Angelico
On Sat, Sep 15, 2012 at 1:01 AM, Token Type typeto...@gmail.com wrote: Thanks. By the way, do we have a list of explanations of error message? If so, whenever we come across error message, we can refer to it and solve the problem accordingly. Not really, but if you paste the message into

Re: Decorators not worth the effort

2012-09-14 Thread Steven D'Aprano
On Fri, 14 Sep 2012 15:22:26 +0200, Jean-Michel Pichavant wrote: Here's Steven example: # Untested! def timeout(t=15): # Decorator factory. Return a decorator to actually do the work. if FPGA: t *= 3 def decorator(func): @functools.wraps(func) def

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-14 Thread Steven D'Aprano
On Fri, 14 Sep 2012 08:01:11 -0700, Token Type wrote: Thanks. By the way, do we have a list of explanations of error message? If so, whenever we come across error message, we can refer to it and solve the problem accordingly. Forget about a list of explanations of error message[s]. There is

Re: Decorators not worth the effort

2012-09-14 Thread Jean-Michel Pichavant
- Original Message - On Fri, 14 Sep 2012 15:22:26 +0200, Jean-Michel Pichavant wrote: Here's Steven example: # Untested! def timeout(t=15): # Decorator factory. Return a decorator to actually do the work. if FPGA: t *= 3 def decorator(func):

Re: Decorators not worth the effort

2012-09-14 Thread andrea crotti
2012/9/14 Chris Angelico ros...@gmail.com: Trouble is, you're starting with a pretty poor algorithm. It's easy to improve on what's poor. Memoization can still help, but I would start with a better algorithm, such as: def fib(n): if n=1: return 1 a,b=1,1 for i in

Re: Least-lossy string.encode to us-ascii?

2012-09-14 Thread wxjmfauth
Le jeudi 13 septembre 2012 23:25:27 UTC+2, Tim Chase a écrit : I've got a bunch of text in Portuguese and to transmit them, need to have them in us-ascii (7-bit). I'd like to keep as much information as possible, just stripping accents, cedillas, tildes, etc. So serviço móvil becomes

PyConUK 2012 Schedule now online

2012-09-14 Thread Zeth
Hello! PyConUK 2012, the UK Python Conference, is taking place in Coventry from Friday 28th September to Monday 1st October. That is only two weeks away! Everyone is welcome from complete beginners through to experienced experts. The core is on Saturday and Sunday so if you cannot get time

Re: Decorators not worth the effort

2012-09-14 Thread 88888 Dihedral
Chris Angelico於 2012年9月14日星期五UTC+8下午10時41分06秒寫道: On Sat, Sep 15, 2012 at 12:12 AM, andrea crotti andrea.crott...@gmail.com wrote: def fib(n): if n = 1: return 1 return fib(n-1) + fib(n-2) @memoize def fib_memoized(n): if n = 1:

Re: Decorators not worth the effort

2012-09-14 Thread Chris Angelico
On Sat, Sep 15, 2012 at 2:15 AM, andrea crotti andrea.crott...@gmail.com wrote: The poor algorithm is much more close to the mathematical definition than the smarter iterative one.. And in your second version you include some ugly caching logic inside it, so why not using a decorator then? I

Re: subprocess call is not waiting.

2012-09-14 Thread Wanderer
On Friday, September 14, 2012 8:22:44 AM UTC-4, pauls...@gmail.com wrote: os.system worked fine, and I found something in another section of code that was causing the Too many open errors. (I was fooled, because output from subprocess call didn't seem to be coming out until the open files

Re: Decorators not worth the effort

2012-09-14 Thread Terry Reedy
On 9/13/2012 10:12 PM, Cameron Simpson wrote: On 13Sep2012 18:58, alex23 wuwe...@gmail.com wrote: | On Sep 14, 3:54 am, Jean-Michel Pichavant jeanmic...@sequans.com | wrote: | I don't like decorators, I think they're not worth the mental effort. | | Because passing a function to a function is a

Re: Decorators not worth the effort

2012-09-14 Thread Terry Reedy
On 9/14/2012 5:28 AM, Jean-Michel Pichavant wrote: Decorators are very popular so I kinda already know that the fault is mine. Now to the reason why I have troubles writing them, I don't know. Every time I did use decorators, I spent way too much time writing it (and debugging it). -- Terry

Re: Decorators not worth the effort

2012-09-14 Thread Terry Reedy
2nd try, hit send button by mistake before On 9/14/2012 5:28 AM, Jean-Michel Pichavant wrote: Decorators are very popular so I kinda already know that the fault is mine. Now to the reason why I have troubles writing them, I don't know. Every time I did use decorators, I spent way too much time

Re: Least-lossy string.encode to us-ascii?

2012-09-14 Thread Terry Reedy
On 9/14/2012 12:15 PM, wxjmfa...@gmail.com wrote: PS Avoid Py3.3 :-) pps Start using 3.3 as soon as possible. It has Python's first fully portable non-buggy Unicode implementation. The second release candidate is already out. -- Terry Jan Reedy --

Re: Decorators not worth the effort

2012-09-14 Thread Terry Reedy
On 9/14/2012 4:29 PM, Terry Reedy wrote: On 9/13/2012 10:12 PM, Cameron Simpson wrote: On 13Sep2012 18:58, alex23 wuwe...@gmail.com wrote: | On Sep 14, 3:54 am, Jean-Michel Pichavant jeanmic...@sequans.com | wrote: | I don't like decorators, I think they're not worth the mental effort. | |

Re: Least-lossy string.encode to us-ascii?

2012-09-14 Thread Terry Reedy
On 9/13/2012 10:09 PM, Mark Tolonen wrote: On Thursday, September 13, 2012 4:53:13 PM UTC-7, Tim Chase wrote: On 09/13/12 18:36, Terry Reedy wrote: 'keep as much information as possible' would mean an effectively lossless transliteration, which you could do with a dict. {o-with-accent: 'o',

Re: Decorators not worth the effort

2012-09-14 Thread Ian Kelly
On Fri, Sep 14, 2012 at 2:29 PM, Terry Reedy tjre...@udel.edu wrote: For a simple, unparameterized wrapper, the difficulty is entirely in the wrapper maker. It must define the final wrapper as a nested function and return it*. It is irrelevant whether the wrapper maker is used with pre-def

Re: Decorators not worth the effort

2012-09-14 Thread Joshua Landau
On 14 September 2012 18:30, Chris Angelico ros...@gmail.com wrote: On Sat, Sep 15, 2012 at 2:15 AM, andrea crotti andrea.crott...@gmail.com wrote: The poor algorithm is much more close to the mathematical definition than the smarter iterative one.. And in your second version you include

RE: Comparing strings from the back?

2012-09-14 Thread Prasad, Ramit
Dwight Hutto wrote: On Thu, Sep 13, 2012 at 5:17 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 13/09/2012 21:34, Joshua Landau wrote: On 13 September 2012 20:53, Mark Lawrence breamore...@yahoo.co.uk wrote:acci sequence On 13/09/2012 19:39, Prasad, Ramit wrote: Dwight Hutto

RE: pythonOCC examples doesn't work?

2012-09-14 Thread Prasad, Ramit
Dwight Hutto wrote: Chris Angelico wrote: honest. How do you feel? Interesting... Um, I guess like an inconsiderate bandwidth hog, but from now on I'll trim more text. First it was too little, and now it's too much. It is a fine line to walk and nobody does it perfectly all the time.

RE: Comparing strings from the back?

2012-09-14 Thread Prasad, Ramit
Dwight Hutto wrote: On Fri, Sep 14, 2012 at 4:20 AM, alex23 wuwe...@gmail.com wrote: On Sep 14, 6:04 pm, Dwight Hutto dwightdhu...@gmail.com wrote: Using foreign names derogatively is a common tactic of the racist. Not really. But nice spin on my pun to make me look bad. It actually

RE: Decorators not worth the effort

2012-09-14 Thread Prasad, Ramit
Jean-Michel Pichavant wrote: [snip] Ultimately, the goal is to have something like @timeout(2) def doAction1 @timeout(4) def doAction2 [snip] Here's Steven example: # Untested! def timeout(t=15): # Decorator factory. Return a decorator to actually do the work. if FPGA:

Re: Decorators not worth the effort

2012-09-14 Thread Steven D'Aprano
On Fri, 14 Sep 2012 15:16:47 -0600, Ian Kelly wrote: If only there were a conceptually simpler way to do this. Actually, there is. I give you: metadecorators! [code snipped but shown below] Which I think is certainly easier to understand than the nested functions approach. Maybe for you,

Re: Comparing strings from the back?

2012-09-14 Thread Steve Howell
On Sep 6, 4:04 am, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On Thu, 06 Sep 2012 06:07:38 -0400, Dave Angel d...@davea.name wrote: For random strings (as defined below), the average compare time is effectively unrelated to the size of the string, once the size passes some point.

Re: Decorators not worth the effort

2012-09-14 Thread Steve Howell
On Sep 14, 6:05 am, Tim Chase python.l...@tim.thechases.com wrote: On 09/14/12 07:01, Steven D'Aprano wrote: [snip timeout class] Holy over-engineering Batman!!! No wonder you don't think much of decorators, [snip] Most of my decorator functions are under a dozen lines. And that's the

unit test strategy

2012-09-14 Thread Aaron Brady
Hello, I've developing a test script. There's a lot of repetition. I want to introduce a strategy for approaching it, but I don't want the program to be discredited because of the test script. Therefore, I'd like to know what people's reactions to and thoughts about it are. The first

Re: Comparing strings from the back?

2012-09-14 Thread Dwight Hutto
On Fri, Sep 14, 2012 at 6:43 PM, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: Dwight Hutto wrote: On Fri, Sep 14, 2012 at 4:20 AM, alex2find-work-home/3 wuwe...@gmail.com wrote: On Sep 14, 6:04 pm, Dwight Hutto dwightdhu...@gmail.com wrote: Using foreign names derogatively is a common

Re: unit test strategy

2012-09-14 Thread Dwight Hutto
On Fri, Sep 14, 2012 at 10:59 PM, Aaron Brady castiro...@gmail.com wrote: Hello, I've developing a test script. There's a lot of repetition. I want to introduce a strategy for approaching it, but I don't want the program to be discredited because of the test script. Therefore, I'd like

Re: unit test strategy

2012-09-14 Thread Dwight Hutto
On Fri, Sep 14, 2012 at 11:26 PM, Dwight Hutto dwightdhu...@gmail.com wrote: On Fri, Sep 14, 2012 at 10:59 PM, Aaron Brady castiro...@gmail.com wrote: Hello, I've developing a test script. There's a lot of repetition. I want to introduce a strategy for approaching it, but I don't want the

Re: Decorators not worth the effort

2012-09-14 Thread Dwight Hutto
On Fri, Sep 14, 2012 at 2:40 AM, Dieter Maurer die...@handshake.de wrote: On Sep 14, 3:54 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: I don't like decorators, I think they're not worth the mental effort. Fine. I like them because they can vastly improve reusability and

Re: pythonOCC examples doesn't work?

2012-09-14 Thread Dwight Hutto
On Fri, Sep 14, 2012 at 6:51 PM, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: Dwight Hutto wrote: Chris Angelico wrote: honest. How do you feel? Interesting... Um, I guess like an inconsiderate bandwidth hog, but from now on I'll trim more text. First it was too little, and now it's

Re: pythonOCC examples doesn't work?

2012-09-14 Thread Chris Angelico
On Sat, Sep 15, 2012 at 1:47 PM, Dwight Hutto dwightdhu...@gmail.com wrote: That's no problem, But some suported ad some opposed, it's a democracy, but a dictatorship by the moderators. How much did I err in their opinion of stating my opinion, in relation to the statistical whole? Actually,

Re: subprocess call is not waiting.

2012-09-14 Thread Chris Rebert
On Fri, Sep 14, 2012 at 5:22 AM, paulsta...@gmail.com wrote: os.system worked fine, and I found something in another section of code that was causing the Too many open errors. (I was fooled, because output from subprocess call didn't seem to be coming out until the open files error. I'll

Moving folders with content

2012-09-14 Thread jyoung79
Hello, I am working in both OS X Snow Leopard and Lion (10.6.8 and 10.7.4). I'm simply wanting to move folders (with their content) from various servers to the hard drive and then back to different directories on the servers. I want to be careful not to remove any metadata or resource forks

Re: pythonOCC examples doesn't work?

2012-09-14 Thread Dwight Hutto
On Fri, Sep 14, 2012 at 11:53 PM, Chris Angelico ros...@gmail.com wrote: On Sat, Sep 15, 2012 at 1:47 PM, Dwight Hutto dwightdhu...@gmail.com wrote: That's no problem, But some suported ad some opposed, it's a democracy, but a dictatorship by the moderators. How much did I err in their opinion

[issue15943] urllib2 always sends header connection: close

2012-09-14 Thread Santiago Velasco
New submission from Santiago Velasco: I have noticed that urllib2 will always send the 'connection: close' in the headers, looking at the code there is no way to override this from outside of the open method. I am currently working with a server that kills connection upon reading the

[issue8109] Server-side support for TLS Server Name Indication extension

2012-09-14 Thread danblack
Changes by danblack daniel.bl...@openquery.com: Removed file: http://bugs.python.org/file26950/issue8109_server_side_sni.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8109 ___

[issue8109] Server-side support for TLS Server Name Indication extension

2012-09-14 Thread danblack
danblack added the comment: Daniel, your patch looks quite interesting. Please, send a contributor agreement to the PSF: http://www.python.org/psf/contrib/contrib-form-python/ . Let me know when you status have changed. Already done. Has been accepted and I've got an acknowledgement email.

[issue15943] urllib2 always sends header connection: close

2012-09-14 Thread R. David Murray
R. David Murray added the comment: This is a duplicate of issue 12849. I'm not sure that we support keep-alive using urllib. We do using httplib, if I understand correctly. -- nosy: +r.david.murray resolution: - duplicate stage: - committed/rejected status: open - closed

[issue12849] urllib2 headers issue

2012-09-14 Thread R. David Murray
R. David Murray added the comment: I've closed issue 15943 as a duplicate of this one. As I said there, I'm not sure that we (can?) support keep-alive in urllib, though we do in httplib (which is the http package in python3). -- nosy: +r.david.murray, sanxiago versions: +Python 2.7,

[issue12849] Cannot override 'connection: close' in urllib2 headers

2012-09-14 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- title: urllib2 headers issue - Cannot override 'connection: close' in urllib2 headers ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12849

[issue15944] memoryviews and ctypes

2012-09-14 Thread David Beazley
New submission from David Beazley: I've been playing with the interaction of ctypes and memoryviews and am curious about intended behavior. Consider the following: import ctypes d = ctypes.c_double() m = memoryview(d) m.ndim 0 m.shape () m.readonly False m.itemsize 8 As you can see,

[issue15842] Some SocketIO methods can succeed after close()

2012-09-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset fad797916266 by Antoine Pitrou in branch '3.2': Issue #15842: the SocketIO.{readable,writable,seekable} methods now raise ValueError when the file-like object is closed. http://hg.python.org/cpython/rev/fad797916266 New changeset 3b0e20f71d8a by

[issue15842] Some SocketIO methods can succeed after close()

2012-09-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, I've committed the patch. Thanks Alessandro! -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15842

[issue15944] memoryviews and ctypes

2012-09-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: You can still read the underlying representation: d = ctypes.c_double(0.6) m = memoryview(d) bytes(m) b'33\xe3?' d.value = 0.7 bytes(m) b'ff\xe6?' -- nosy: +pitrou, skrah ___ Python tracker

[issue15944] memoryviews and ctypes

2012-09-14 Thread David Beazley
David Beazley added the comment: I don't want to read the representation by copying it into a bytes object. I want direct access to the underlying memory--including the ability to modify it. As it stands now, it's completely useless. -- ___

[issue15944] memoryviews and ctypes

2012-09-14 Thread Stefan Krah
Stefan Krah added the comment: 0-dim memory is indexed by x[()]. The ctypes example has an additional problem, because format=d is not yet implemented in memoryview. Only native single character formats in struct module syntax are implemented, and d in struct module syntax means standard size,

[issue15944] memoryviews and ctypes

2012-09-14 Thread Stefan Krah
Stefan Krah added the comment: BTW, if c_double means native machine double, then ctypes should fill in Py_buffer.format with d and not d in order to be PEP-3118 compatible. -- ___ Python tracker rep...@bugs.python.org

[issue15944] memoryviews and ctypes

2012-09-14 Thread David Beazley
David Beazley added the comment: Even with the d format, I'm not sure why it can't be cast to simple byte-view. None of that seems to work at all. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15944

[issue15898] OSX TTY bug

2012-09-14 Thread Ronald Oussoren
Changes by Ronald Oussoren ronaldousso...@mac.com: -- nosy: +ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15898 ___ ___

  1   2   >