Re: how to use pycallgraph in ubuntu and window?

2016-10-14 Thread dieter
meInvent bbird writes: > i install in ubunbu 14 > > pip install graphviz > pip install pycallgraph > > martin@ubuntu:~/Downloads$ pycallgraph graphviz -- ./pusher.py > Traceback (most recent call last): > ... > pycallgraph.exceptions.PyCallGraphException: The command "dot" is required to > be in

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-14 Thread Rustom Mody
On Friday, October 14, 2016 at 10:31:36 AM UTC+5:30, Marko Rauhamaa wrote: > Gregory Ewing : > > > Marko Rauhamaa wrote: > >> This suggests even the promoters of functional programming > >> intuitively prefer imperative programming, but that's ok as long as > >> it's all functional under the hood.

Re: how to use pycallgraph in ubuntu and window?

2016-10-14 Thread meInvent bbird
succeed to draw graph, thanks originally i think pip install graphviz is enough then search again there is an win32 executable file graphviz need to be install On Friday, October 14, 2016 at 2:58:48 PM UTC+8, dieter wrote: > meInvent bbird writes: > > > i install in ubunbu 14 > > > > pip inst

Re: How to process syntax errors

2016-10-14 Thread Pierre-Alain Dorange
wrote: > Steve, You are absolutely right. I am trying to eliminate the method of > using parenthesis while calling in my file. Especially when I call it > from a instance. Then write a simple interpreter. You want to change the language syntax, as said previously, do not except python to underst

Re: Without compilation, how to find bugs?

2016-10-14 Thread BartC
On 14/10/2016 01:59, sohcahto...@gmail.com wrote: On Thursday, October 13, 2016 at 4:06:36 PM UTC-7, pozz wrote: Are the things exactly how I understood, or do I miss something in Python? As others have said, user a linter. With Python you're supposed to just be able run any source code i

Re: how to send a json of yield list

2016-10-14 Thread meInvent bbird
succeed to run, is it the yield return the whole list 2000 * 2000 * 2000 items? as i know that yield is return [1,1,1] etc one by one once it get if it return 2000*2000*2000 items, why? i have to add a queue get this yield in order to succeed but i do not understand the situation when using qu

Re: how to send a json of yield list

2016-10-14 Thread meInvent bbird
when not to use queue, it is faster now while True: for ii in getcombinations(): item = ii print(item) sock.send(json.dumps(ii)) On Friday, October 14, 2016 at 5:11:35 PM UTC+8, meInvent bbird wrote: > succeed to run, > > is it the yield return the whole list

Re: Without compilation, how to find bugs?

2016-10-14 Thread Chris Angelico
On Fri, Oct 14, 2016 at 8:04 PM, BartC wrote: > On 14/10/2016 01:59, sohcahto...@gmail.com wrote: >> >> On Thursday, October 13, 2016 at 4:06:36 PM UTC-7, pozz wrote: > > >>> Are the things exactly how I understood, or do I miss something in >>> Python? >> >> >> As others have said, user a linter.

Re: TCL/TK as default UI toolkit, and wayland

2016-10-14 Thread kerbingamer376
Python's "standard" (and bundled on most platforms) UI tookkit is TCL/TK. However, this has A LOT of drawbacks: * It's eyesore on a lot of platforms * It's non-pythonic * It just flat out fails on some desktop environments * On linux it requires X, however lots of distros are now using wayland an

Re: TCL/TK as default UI toolkit, and wayland

2016-10-14 Thread kerbingamer376
On Friday, October 14, 2016 at 12:40:53 PM UTC+1, kerbingamer376 wrote: > Python's "standard" (and bundled on most platforms) UI tookkit is TCL/TK. > However, this has A LOT of drawbacks: > > * It's eyesore on a lot of platforms > * It's non-pythonic > * It just flat out fails on some desktop env

Re: Without compilation, how to find bugs?

2016-10-14 Thread Steve D'Aprano
On Fri, 14 Oct 2016 08:04 pm, BartC wrote: > On 14/10/2016 01:59, sohcahto...@gmail.com wrote: >> On Thursday, October 13, 2016 at 4:06:36 PM UTC-7, pozz wrote: > >>> Are the things exactly how I understood, or do I miss something in >>> Python? >> >> As others have said, user a linter. > > With

Re: TCL/TK as default UI toolkit, and wayland

2016-10-14 Thread Chris Warrick
On 14 October 2016 at 13:40, kerbingamer376 wrote: > Python's "standard" (and bundled on most platforms) UI tookkit is TCL/TK. > However, this has A LOT of drawbacks: > > * It's eyesore on a lot of platforms > * It's non-pythonic > * It just flat out fails on some desktop environments > * On linu

Namespace for timeit

2016-10-14 Thread ROGER GRAYDON CHRISTMAN
Trying to use timeit within a function: def test(name, sorter, size): """Tests and times the sorting algorithm on given array size""" print(name,end='\t') array = [0]*size for i in range(size): array[i] = randrange(20) timeit('sorter( array, size )', number=1)

PyDev 5.3.0 Released

2016-10-14 Thread Fabio Zadrozny
Release Highlights: --- * **Important** PyDev now requires Java 8 and Eclipse 4.5 onwards. * PyDev 4.5.5 is the last release supporting Java 7 and Eclipse 3.8. * See: update sites page for the update site of older versions of PyDev. * See: the **PyDev does

Re: TCL/TK as default UI toolkit, and wayland

2016-10-14 Thread Michael Torrie
On 10/14/2016 05:40 AM, kerbingamer376 wrote: > Python's "standard" (and bundled on most platforms) UI tookkit is TCL/TK. > However, this has A LOT of drawbacks: > > * It's eyesore on a lot of platforms I thought this was largely solved in recent versions of Tcl/Tk that use the new Tile widget s

Re: Without compilation, how to find bugs?

2016-10-14 Thread breamoreboy
On Friday, October 14, 2016 at 12:06:36 AM UTC+1, pozz wrote: > I come from the C language, that is a compiled and strongly typed > language. Python is compiled and dynamically and strongly typed but C is compiled and statically and weakly typed. > > All the tricks have a common goal: to disco

Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Lele Gaifax
Hi all, trying out pgcli with Python 3.6.0b2 I got an error related to what seem a different behaviour, or even a bug, of re.sub(). The original intent is to replace spaces within a string with the regular expression \s+ (see https://github.com/dbcli/pgcli/blob/master/pgcli/packages/prioritizat

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Chris Angelico
On Sat, Oct 15, 2016 at 2:40 AM, Lele Gaifax wrote: > Accordingly to the documentation > (https://docs.python.org/3.6/library/re.html#re.sub) > “unknown escapes [in the repl argument] such as \& are left alone”. > > Am I missing something, or is this a regression? Further down, you'll find this

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Peter Otten
Lele Gaifax wrote: > Hi all, > > trying out pgcli with Python 3.6.0b2 I got an error related to what seem a > different behaviour, or even a bug, of re.sub(). > > The original intent is to replace spaces within a string with the regular > expression \s+ (see > https://github.com/dbcli/pgcli/blo

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Lele Gaifax
Peter Otten <__pete...@web.de> writes: > Lele Gaifax wrote: > >> The original intent is to replace spaces within a string with the regular >> expression \s+ (see >> ... >> Accordingly to the documentation >> (https://docs.python.org/3.6/library/re.html#re.sub) “unknown escapes [in >> the repl argu

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Lele Gaifax
Chris Angelico writes: > There's a shift as of 3.6 to make unrecognized alphabetic escapes into > errors, or at least warnings. But we are talking about raw strings here, specifically r'\s+'. I agree that with plain strings it's a plus. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di q

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Lele Gaifax
Lele Gaifax writes: > And the documentation as well, to clarify the fact immediately, without > assuming one will scroll down to the "changed in version" part (at least, that > is what seem the rule in other parts of the manual). Also, I'd prefer the "Changed in 3.6" be less ambiguous whether it

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Chris Angelico
On Sat, Oct 15, 2016 at 3:45 AM, Lele Gaifax wrote: > Chris Angelico writes: > >> There's a shift as of 3.6 to make unrecognized alphabetic escapes into >> errors, or at least warnings. > > But we are talking about raw strings here, specifically r'\s+'. > > I agree that with plain strings it's a

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Peter Otten
Lele Gaifax wrote: > Peter Otten <__pete...@web.de> writes: > >> Lele Gaifax wrote: >> >>> The original intent is to replace spaces within a string with the >>> regular expression \s+ (see >>> ... >>> Accordingly to the documentation >>> (https://docs.python.org/3.6/library/re.html#re.sub) “unkno

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Ned Batchelder
On Friday, October 14, 2016 at 12:50:44 PM UTC-4, Lele Gaifax wrote: > Chris Angelico writes: > > > There's a shift as of 3.6 to make unrecognized alphabetic escapes into > > errors, or at least warnings. > > But we are talking about raw strings here, specifically r'\s+'. > > I agree that with

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Ned Batchelder
On Friday, October 14, 2016 at 1:00:12 PM UTC-4, Chris Angelico wrote: > On Sat, Oct 15, 2016 at 3:45 AM, Lele Gaifax wrote: > > Chris Angelico writes: > > > >> There's a shift as of 3.6 to make unrecognized alphabetic escapes into > >> errors, or at least warnings. > > > > But we are talking abo

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Chris Angelico
On Sat, Oct 15, 2016 at 4:12 AM, Ned Batchelder wrote: > There doesn't seem to be a change to string literals at all. It's only a > change in the regex engine. > > Python 3.6.0b2 (default, Oct 10 2016, 21:30:05) > [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin > Typ

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Lele Gaifax
Ned Batchelder writes: > On Friday, October 14, 2016 at 12:50:44 PM UTC-4, Lele Gaifax wrote: >> Chris Angelico writes: >> >> > There's a shift as of 3.6 to make unrecognized alphabetic escapes into >> > errors, or at least warnings. >> >> But we are talking about raw strings here, specificall

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Ned Batchelder
On Friday, October 14, 2016 at 1:27:09 PM UTC-4, Chris Angelico wrote: > On Sat, Oct 15, 2016 at 4:12 AM, Ned Batchelder > wrote: > > There doesn't seem to be a change to string literals at all. It's only a > > change in the regex engine. > > > > Python 3.6.0b2 (default, Oct 10 2016, 21:30:05

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Chris Angelico
On Sat, Oct 15, 2016 at 4:48 AM, Ned Batchelder wrote: > On Friday, October 14, 2016 at 1:27:09 PM UTC-4, Chris Angelico wrote: >> On Sat, Oct 15, 2016 at 4:12 AM, Ned Batchelder >> wrote: >> > There doesn't seem to be a change to string literals at all. It's only a >> > change in the regex engi

Re: cannot import name pyhop

2016-10-14 Thread Irmen de Jong
On 14-10-2016 7:31, Gipper wrote: > I'm trying to run a script that calls pyhop (from pyhop import pyhop). > Details here > https://docs.extrahop.com/5.0/extrahop-python-api/#metrics > > I've followed the directions to install and import pyhop, but no matter what > I do, I always get the follow

Re: Namespace for timeit

2016-10-14 Thread Skip Montanaro
> timeit('sorter( array, size )', number=1) I'm not a timeit whiz, but I'm kind of surprised there isn't a call form where it goes something like timeit(callable, *args, ...) There is a globals keyword argument though. I think you could probably call it with globals=locals() in your case

trying to make a simple program help please :)

2016-10-14 Thread LongHairLuke
Hi, l l am trying to make a simple guess program. This is my script: def main(): print ("Guess a letter between a and e") randomNumber = b userGuess = input("Your guess: ") if userGuess == randomNumber: print("You got it") else: print ("That's not it") main() Wh

Re: trying to make a simple program help please :)

2016-10-14 Thread MRAB
On 2016-10-14 19:11, LongHairLuke wrote: Hi, l l am trying to make a simple guess program. This is my script: def main(): print ("Guess a letter between a and e") randomNumber = b userGuess = input("Your guess: ") if userGuess == randomNumber: print("You got it") else: pr

Re: trying to make a simple program help please :)

2016-10-14 Thread Irmen de Jong
On 14-10-2016 20:11, LongHairLuke wrote: > Hi, l l am trying to make a simple guess program. This is my script: > > def main(): > print ("Guess a letter between a and e") > randomNumber = b > > userGuess = input("Your guess: ") > > if userGuess == randomNumber: > print("You

Re: trying to make a simple program help please :)

2016-10-14 Thread LongHairLuke
Den fredag 14 oktober 2016 kl. 20:30:20 UTC+2 skrev MRAB: > On 2016-10-14 19:11, LongHairLuke wrote: > > Hi, l l am trying to make a simple guess program. This is my script: > > > > def main(): > > print ("Guess a letter between a and e") > > randomNumber = b > > > > userGuess = input("

Re: trying to make a simple program help please :)

2016-10-14 Thread Irmen de Jong
Right, another troll. plonk Irmen -- https://mail.python.org/mailman/listinfo/python-list

Re: trying to make a simple program help please :)

2016-10-14 Thread BartC
On 14/10/2016 19:53, LongHairLuke wrote: Den fredag 14 oktober 2016 kl. 20:30:20 UTC+2 skrev MRAB: On 2016-10-14 19:11, LongHairLuke wrote: Hi, l l am trying to make a simple guess program. This is my script: def main(): print ("Guess a letter between a and e") randomNumber = b us

How to sort this without 'cmp=' in python 3?

2016-10-14 Thread 380162267qq
nums=['3','30','34','32','9','5'] I need to sort the list in order to get the largest number string: '953433230' nums.sort(cmp=lambda a,b: cmp(a+b, b+a), reverse=True) But how to do this in python 3? Thank you -- https://mail.python.org/mailman/listinfo/python-list

Re: Without compilation, how to find bugs?

2016-10-14 Thread sohcahtoa82
On Friday, October 14, 2016 at 2:05:01 AM UTC-7, BartC wrote: > On 14/10/2016 01:59, sohcahto...@gmail.com wrote: > > On Thursday, October 13, 2016 at 4:06:36 PM UTC-7, pozz wrote: > > >> Are the things exactly how I understood, or do I miss something in Python? > > > > As others have said, user a

Re: Without compilation, how to find bugs?

2016-10-14 Thread sohcahtoa82
On Friday, October 14, 2016 at 5:46:14 AM UTC-7, Steve D'Aprano wrote: > On Fri, 14 Oct 2016 08:04 pm, BartC wrote: > > > On 14/10/2016 01:59, sohcahto...@gmail.com wrote: > >> On Thursday, October 13, 2016 at 4:06:36 PM UTC-7, pozz wrote: > > > >>> Are the things exactly how I understood, or do

Re: How to sort this without 'cmp=' in python 3?

2016-10-14 Thread Robin Koch
Am 15.10.2016 um 01:33 schrieb 38016226...@gmail.com: nums=['3','30','34','32','9','5'] I need to sort the list in order to get the largest number string: '953433230' nums.sort(cmp=lambda a,b: cmp(a+b, b+a), reverse=True) But how to do this in python 3? https://docs.python.org/3/library/funct

Re: How to sort this without 'cmp=' in python 3?

2016-10-14 Thread sohcahtoa82
On Friday, October 14, 2016 at 4:35:08 PM UTC-7, 38016...@gmail.com wrote: > nums=['3','30','34','32','9','5'] > I need to sort the list in order to get the largest number string: '953433230' > > nums.sort(cmp=lambda a,b: cmp(a+b, b+a), reverse=True) > > But how to do this in python 3? > > Thank

Re: How to sort this without 'cmp=' in python 3?

2016-10-14 Thread Ben Finney
38016226...@gmail.com writes: > nums=['3','30','34','32','9','5'] > I need to sort the list in order to get the largest number string: '953433230' > nums.sort(cmp=lambda a,b: cmp(a+b, b+a), reverse=True) For demonstration, I'll re-write this such that the names and output make more sense:: $

Re: How to sort this without 'cmp=' in python 3?

2016-10-14 Thread Ned Batchelder
On Friday, October 14, 2016 at 7:49:33 PM UTC-4, Robin Koch wrote: > Am 15.10.2016 um 01:33 schrieb 38016226...@gmail.com: > > nums=['3','30','34','32','9','5'] > > I need to sort the list in order to get the largest number string: > > '953433230' > > > > nums.sort(cmp=lambda a,b: cmp(a+b, b+a), r

Re: How to sort this without 'cmp=' in python 3?

2016-10-14 Thread breamoreboy
On Saturday, October 15, 2016 at 12:53:48 AM UTC+1, sohca...@gmail.com wrote: > On Friday, October 14, 2016 at 4:35:08 PM UTC-7, 38016...@gmail.com wrote: > > nums=['3','30','34','32','9','5'] > > I need to sort the list in order to get the largest number string: > > '953433230' > > > > nums.sort