RE: [Python-Dev] Azure event hub network access

2015-02-05 Thread Steve Dower
This would be much better posted on the github page for the project. I don't have the URL handy, but if you search github for "Python Azure SDK" you'll find it. Cheers, Steve Sent from my Windows Phone From: syed khalid Sent: ‎2/‎5/

Azure event hub network access

2015-02-05 Thread syed khalid
I am getting http error 404. I am able to access the site via telnet which eliminates network issues. Here is the code and subsequent errors user/bin/python import sys import azure import socket from azure.servicebus import ( _service_bus_error_handler ) from azure.servicebus.servicebusser

Re: meaning of: line, =

2015-02-05 Thread Gregory Ewing
Chris Angelico wrote: [] = x # is equivalent to try: next(iter(x)) except StopIteration: pass else: raise ValueError("too many values to unpack (expected 0)") It's a way of asserting that an iterator is exhausted! But why disallow using () for the same thing? This is a blatant case of outright

Re: meaning of: line, =

2015-02-05 Thread Chris Angelico
On Fri, Feb 6, 2015 at 12:12 PM, Devin Jeanpierre wrote: > Here's another example, one that still exists in Python 3: > [] = '' () = '' > File "", line 1 > SyntaxError: can't assign to () > > The syntax explicitly blacklists (), but forgets to blacklist []. So... this is actually a re

Re: meaning of: line, =

2015-02-05 Thread Devin Jeanpierre
On Thu, Feb 5, 2015 at 8:08 AM, Ian Kelly wrote: > On Thu, Feb 5, 2015 at 2:40 AM, Steven D'Aprano > wrote: >> Devin Jeanpierre wrote: >>> On Wed, Feb 4, 2015 at 1:18 PM, Chris Angelico wrote: [result] = f() result > 42 Huh, was not aware of that alternate syntax.

Re: meaning of: line, =

2015-02-05 Thread Gregory Ewing
Devin Jeanpierre wrote: On Wed, Feb 4, 2015 at 1:18 PM, Chris Angelico wrote: On Thu, Feb 5, 2015 at 4:36 AM, Peter Otten <__pete...@web.de> wrote: [result] = f() result Huh, was not aware of that alternate syntax. Nor are most people. Nor is Python, in some places -- it seems like peop

Re: Monte Carlo probability calculation in Python

2015-02-05 Thread Paul Moore
On Thursday, 5 February 2015 21:01:21 UTC, Ian wrote: > Building on Rob's example: > > def monopoly(throws, per=2, rerolls=3, sides=6): > all_dice = np.random.randint(1, sides+1, size=(throws, rerolls, per)) > doubles = all_dice[...,0] == all_dice[...,1] > three_doubles = doubles[:,0]

Re: multiprocessing.Queue() and missing sem_open

2015-02-05 Thread Chris Angelico
On Fri, Feb 6, 2015 at 7:22 AM, Оlе Ѕtrеісhеr wrote: > I am just trying to prepare a package (astropy) for (Debian) Hurd. This > os lacks a sem_open() implementation. When I now try: > > import multiprocessing > q = multiprocessing.Queue() > > I get an ImportError with Python 2.7, but an Attribute

Re: Monte Carlo probability calculation in Python

2015-02-05 Thread Ian Kelly
On Thu, Feb 5, 2015 at 12:25 PM, Paul Moore wrote: > On Thursday, 5 February 2015 16:57:07 UTC, Rob Gaddi wrote: >> You don't need the whole scipy stack, numpy will let you do everything >> you want. The trick to working in numpy is to parallelize your problem; >> you don't do a thing a thousan

Re: Monte Carlo probability calculation in Python

2015-02-05 Thread Rob Gaddi
On Thu, 05 Feb 2015 11:25:42 -0800, Paul Moore wrote: > On Thursday, 5 February 2015 16:57:07 UTC, Rob Gaddi wrote: >> You don't need the whole scipy stack, numpy will let you do everything >> you want. The trick to working in numpy is to parallelize your >> problem; >> you don't do a thing a t

Re: pymongo and attribute dictionaries

2015-02-05 Thread Anssi Saari
Steven D'Aprano writes: > Vito De Tullio wrote: > >> Steven D'Aprano wrote: >> This just does not roll of the fingers well. Too many “reach for modifier keys” in a row. >>> >>> *One* modifier key in a row is too many? >>> >>> s o m e SHIFT D o c [ ' SHIFT _ i d ' ] >> >> I'm not OP,

multiprocessing.Queue() and missing sem_open

2015-02-05 Thread Оlе Ѕtrеісhеr
Hi, I am just trying to prepare a package (astropy) for (Debian) Hurd. This os lacks a sem_open() implementation. When I now try: import multiprocessing q = multiprocessing.Queue() I get an ImportError with Python 2.7, but an AttributeError with Python 3.4. In the documentation of multiprocessin

Re: meaning of: line, =

2015-02-05 Thread Tim Chase
On 2015-02-05 09:08, Ian Kelly wrote: > > Got an example where you can use a,b but not [a,b] or (a,b)? > > >>> def f(a, (b, c)): > ... print a, b, c > ... Interesting. I knew that at one point you could do this with lambdas but never thought to do it with regular functions. There are ti

Re: Monte Carlo probability calculation in Python

2015-02-05 Thread Paul Moore
On Thursday, 5 February 2015 16:57:07 UTC, Rob Gaddi wrote: > You don't need the whole scipy stack, numpy will let you do everything > you want. The trick to working in numpy is to parallelize your problem; > you don't do a thing a thousand times; you do it on a thousand-length > array. For e

Re: meaning of: line, =

2015-02-05 Thread Rustom Mody
On Thursday, February 5, 2015 at 10:15:29 PM UTC+5:30, Rustom Mody wrote: > On Thursday, February 5, 2015 at 9:39:27 PM UTC+5:30, Ian wrote: > > On Thu, Feb 5, 2015 at 2:40 AM, Steven D'Aprano wrote: > > > Devin Jeanpierre wrote: > > > > > >> On Wed, Feb 4, 2015 at 1:18 PM, Chris Angelico wrote: >

Re: Monte Carlo probability calculation in Python

2015-02-05 Thread Rob Gaddi
On Thu, 05 Feb 2015 08:20:41 -0800, Paul Moore wrote: > I'm interested in prototyping a Monte Carlo type simulation algorithm in > Python. The background is that a friend has written a similar program in > C++, and I'm interested in seeing if I can achieve something comparable > in a much better

Re: meaning of: line, =

2015-02-05 Thread Tim Chase
On 2015-02-05 08:45, Rustom Mody wrote: > > >>> def f(a, (b, c)): > > ... print a, b, c > > What the hell is that?! > First I am hearing/seeing it. > Whats it called? "tuple parameter unpacking", removed in Py3 https://www.python.org/dev/peps/pep-3113/ -tkc -- https://mail.python.org/ma

Re: meaning of: line, =

2015-02-05 Thread Skip Montanaro
Tuple packing. No longer supported in Python 3, but in available in Python <= 2. Skip On Thu, Feb 5, 2015 at 10:45 AM, Rustom Mody wrote: > On Thursday, February 5, 2015 at 9:39:27 PM UTC+5:30, Ian wrote: >> On Thu, Feb 5, 2015 at 2:40 AM, Steven D'Aprano wrote: >> > Devin Jeanpierre wrote: >>

Re: meaning of: line, =

2015-02-05 Thread Rustom Mody
On Thursday, February 5, 2015 at 9:39:27 PM UTC+5:30, Ian wrote: > On Thu, Feb 5, 2015 at 2:40 AM, Steven D'Aprano wrote: > > Devin Jeanpierre wrote: > > > >> On Wed, Feb 4, 2015 at 1:18 PM, Chris Angelico wrote: > >>> On Thu, Feb 5, 2015 at 4:36 AM, Peter Otten wrote: > Another alternative i

Re: Monte Carlo probability calculation in Python

2015-02-05 Thread Paul Moore
On Thursday, 5 February 2015 16:28:07 UTC, Joel Goldstick wrote: > have you googled "python monte carlo"? Yes. And a number of other variations. None gave anything that seemed to relate. It's quite likely though that I'm simply not understanding how things like pymc (which came up in the search

Re: Monte Carlo probability calculation in Python

2015-02-05 Thread Joel Goldstick
On Thu, Feb 5, 2015 at 11:20 AM, Paul Moore wrote: > I'm interested in prototyping a Monte Carlo type simulation algorithm in > Python. The background is that a friend has written a similar program in > C++, and I'm interested in seeing if I can achieve something comparable in > a much better lan

Monte Carlo probability calculation in Python

2015-02-05 Thread Paul Moore
I'm interested in prototyping a Monte Carlo type simulation algorithm in Python. The background is that a friend has written a similar program in C++, and I'm interested in seeing if I can achieve something comparable in a much better language :-) The basic job of the program will be to simulat

Re: meaning of: line, =

2015-02-05 Thread Ian Kelly
On Thu, Feb 5, 2015 at 2:40 AM, Steven D'Aprano wrote: > Devin Jeanpierre wrote: > >> On Wed, Feb 4, 2015 at 1:18 PM, Chris Angelico wrote: >>> On Thu, Feb 5, 2015 at 4:36 AM, Peter Otten <__pete...@web.de> wrote: Another alternative is to put a list literal on the lefthand side: >>

Re: Usage of some pastebin service proposed

2015-02-05 Thread Skip Montanaro
On Wed, Feb 4, 2015 at 10:53 PM, Abhiram R wrote: > So is it possible to let everyone know that they need to paste their code on > some site like pastebin.com and give us the link here so help can be > provided better? Better would be to attach small code snippets. I agree with Ben about the HTM

Re: Indentation issues with python

2015-02-05 Thread Denis McMahon
On Wed, 04 Feb 2015 19:07:53 -0800, syed khalid wrote: > I downloaded this code and am attempting to run it. I keep getting > indentation error. > class EventHubClient(object): > def sendMessage(self,body,partition):eventHubHost = > "pac-ns.servicebus.windows.net" >httpclient = _HTTPClient(se

Re: meaning of: line, =

2015-02-05 Thread Steven D'Aprano
Devin Jeanpierre wrote: > On Wed, Feb 4, 2015 at 1:18 PM, Chris Angelico wrote: >> On Thu, Feb 5, 2015 at 4:36 AM, Peter Otten <__pete...@web.de> wrote: >>> Another alternative is to put a list literal on the lefthand side: >>> >> def f(): yield 42 >>> >>> ... >> [result] = f() >> res

Re: meaning of: line, =

2015-02-05 Thread Devin Jeanpierre
On Wed, Feb 4, 2015 at 1:18 PM, Chris Angelico wrote: > On Thu, Feb 5, 2015 at 4:36 AM, Peter Otten <__pete...@web.de> wrote: >> Another alternative is to put a list literal on the lefthand side: >> > def f(): yield 42 >> >> ... > [result] = f() > result >> 42 > > Huh, was not aware of

Re: meaning of: line, =

2015-02-05 Thread ast
"ast" a écrit dans le message de news:54d227ef$0$3292$426a7...@news.free.fr... thanks for the answers -- https://mail.python.org/mailman/listinfo/python-list