Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread Gregory Ewing
On Mon, 3 Oct 2016 10:57:27 -0700 (PDT), sohcahto...@gmail.com declaimed the following: > My car is similar, but the R is actually to the left of 1. It looks like this: R 1 3 5 +-+-+-+ 2 4 6 Mine is actually like that too, but it feels like you're doing the same thing in both cases -- push l

Re: PyQt5, OpenGL, where to start, minimal example code?

2016-10-03 Thread John Ladasky
On Monday, October 3, 2016 at 1:30:29 AM UTC-7, Phil Thompson wrote: > On 3 Oct 2016, at 4:29 am, John Ladasky wrote: > > And as you can see: trying to call versionFunctions() is exactly where my > > program failed. > > Try passing a QOpenGLVersionProfile object to versionFunctions() that has a

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread Michael Torrie
On 10/03/2016 08:21 PM, Steve D'Aprano wrote: > On Tue, 4 Oct 2016 05:48 am, Michael Torrie wrote: > >> There is that old, but false, saying that the only intuitive interface >> is the nipple. Turns out everything, even that, is learned > > Citation required. Sure, just ask a nursing woman. >

Re: Assignment versus binding [was Re: unintuitive for-loop behavior]

2016-10-03 Thread Rustom Mody
On Tuesday, October 4, 2016 at 8:11:41 AM UTC+5:30, Steve D'Aprano wrote: > On Mon, 3 Oct 2016 04:15 pm, Jussi Piitulainen wrote: > > > Steve D'Aprano writes: > >> Why shouldn't people say that binding and assignment are the same > >> thing in Python? What's the difference? > > > > Outside Python

Re: working with ctypes and complex data structures

2016-10-03 Thread eryk sun
On Mon, Oct 3, 2016 at 9:27 PM, Michael Felt wrote: > > int perfstat_subsystem_total( >perfstat_id_t *name, >perfstat_subsystem_total_t *userbuff, >int sizeof_struct, >int desired_number); > ... >+79 class cpu_total: >+80 def __init__(self): >+81 __perfst

Assignment versus binding [was Re: unintuitive for-loop behavior]

2016-10-03 Thread Steve D'Aprano
On Mon, 3 Oct 2016 04:15 pm, Jussi Piitulainen wrote: > Steve D'Aprano writes: >> Why shouldn't people say that binding and assignment are the same >> thing in Python? What's the difference? > > Outside Python, (lambda x : f(x)) is said to "bind" x. It's different > from assigning a new value to

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread Steve D'Aprano
On Tue, 4 Oct 2016 05:48 am, Michael Torrie wrote: > There is that old, but false, saying that the only intuitive interface > is the nipple.  Turns out everything, even that, is learned Citation required. Of course many things are intuitive/instinctive, e.g. breathing, but as far as *interfaces*

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread Gregory Ewing
BartC wrote: On 03/10/2016 12:53, Marko Rauhamaa wrote: Well, it could be worse. This layout is pretty traditional: 1 3 5 | | | +--+--+ | | | 2 4 R Yes, you get a funny grinding sound when attempting to change from 5th to '6th' at 70mph/110kph. Fortunately it doe

Re: Create a map for data to flow through

2016-10-03 Thread Gregory Ewing
Sayth Renshaw wrote: Is there a standard library feature that allows you to define a declarative map or statement that defines the data and its objects to be parsed and output format? Not really. Just wondering as for loops are good but when i end up 3-4 for loops deep and want multiple match

Re: working with ctypes and complex data structures

2016-10-03 Thread Michael Felt
On 02-Oct-16 19:50, Michael Felt wrote: class perfstat_cpu_total_t(Structure): """ typedef struct { /* global cpu information */ int ncpus;/* number of active logical processors */ int ncpus_cfg; /* number of configured processors */ cha

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread Michael Torrie
On 10/03/2016 11:57 AM, sohcahto...@gmail.com wrote: > Surprisingly, despite driving that previous car for 13 years, the switch was > incredibly easy. I've never accidentally gone to sixth gear instead of > reverse, or forgotten to shift into sixth on the highway. Also, accidentally > going in

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread Michael Torrie
On 10/03/2016 03:10 AM, Gregory Ewing wrote: > Rustom Mody wrote: >> My new car goes in reverse when I put it in first gear but only on full-moon >> nights with the tank on reserve when the left light is blinking > > OT aside: When I went to take my current car (a manual) > for a test drive, I ha

Re: working with ctypes and complex data structures

2016-10-03 Thread Michael Felt
On 03-Oct-16 16:35, Michael Felt wrote: I'd alias the type instead of defining a struct, e.g. `time_t = c_long`. This preserves automatic conversion of the simple type. The reason for the not using alias is because a) I was trying to be more inline with the text of the include file. I will hav

Re: python (scipy) TypeError

2016-10-03 Thread chrischris201444
Τη Δευτέρα, 3 Οκτωβρίου 2016 - 7:17:03 μ.μ. UTC+3, ο χρήστης chrischr...@gmail.com έγραψε: > hello > > > i try to follow some tutorial but i have that error : > > Traceback (most recent call last): > File "C:\Python27\test\test\earth.py", line 42, in > slope_array = np.ones_like(data_arr

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread sohcahtoa82
On Monday, October 3, 2016 at 2:11:12 AM UTC-7, Gregory Ewing wrote: > Rustom Mody wrote: > > My new car goes in reverse when I put it in first gear but only on > > full-moon > > nights with the tank on reserve when the left light is blinking > > OT aside: When I went to take my current car (a m

Re: python (scipy) TypeError

2016-10-03 Thread MRAB
On 2016-10-03 17:48, chrischris201...@gmail.com wrote: Τη Δευτέρα, 3 Οκτωβρίου 2016 - 7:17:03 μ.μ. UTC+3, ο χρήστης chrischr...@gmail.com έγραψε: hello i try to follow some tutorial but i have that error : Traceback (most recent call last): File "C:\Python27\test\test\earth.py", line 42, i

Re: Copying a compiled Python from one system to another

2016-10-03 Thread Paul Rubin
Steve D'Aprano writes: > The dependencies needed to build 4.8 aren't available for my system. And > there's no supported upgrade path. If you're system runs 4.4 it should be able to build 4.8 I'd hope. I have Debian 7 which comes with 4.7, and I was able to download and build 6.1 with any signif

Re: print to previous line in console

2016-10-03 Thread Adam M
On Monday, October 3, 2016 at 12:46:41 PM UTC-4, Skip Montanaro wrote: > On Mon, Oct 3, 2016 at 10:23 AM, udhay prakash pethakamsetty > > Hi skip, > > > > I am unable to even install that curses package > > > > > > C:\>pip install curses > > Collecting curses > > Could not find a version that sat

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread breamoreboy
On Monday, October 3, 2016 at 5:41:23 PM UTC+1, BartC wrote: > On 03/10/2016 16:03, wrote: > > On Monday, October 3, 2016 at 12:53:55 PM UTC+1, Marko Rauhamaa wrote: > >> Gregory Ewing: > >> > >>> Turns out the only difference between first and reverse on that model > >>> is whether you lift up a l

Re: python (scipy) TypeError

2016-10-03 Thread chrischris201444
Τη Δευτέρα, 3 Οκτωβρίου 2016 - 7:17:03 μ.μ. UTC+3, ο χρήστης chrischr...@gmail.com έγραψε: > hello > > > i try to follow some tutorial but i have that error : > > Traceback (most recent call last): > File "C:\Python27\test\test\earth.py", line 42, in > slope_array = np.ones_like(data_arr

Re: python (scipy) TypeError

2016-10-03 Thread MRAB
On 2016-10-03 17:14, chrischris201...@gmail.com wrote: hello i try to follow some tutorial but i have that error : Traceback (most recent call last): File "C:\Python27\test\test\earth.py", line 42, in slope_array = np.ones_like(data_array) * nodataval TypeError: unsupported operand type

Re: print to previous line in console

2016-10-03 Thread Skip Montanaro
On Mon, Oct 3, 2016 at 10:23 AM, udhay prakash pethakamsetty wrote: > Hi skip, > > I am unable to even install that curses package > > > C:\>pip install curses > Collecting curses > Could not find a version that satisfies the requirement curses (from > versions: ) > No matching distribution foun

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread BartC
On 03/10/2016 16:03, breamore...@gmail.com wrote: On Monday, October 3, 2016 at 12:53:55 PM UTC+1, Marko Rauhamaa wrote: Gregory Ewing: Turns out the only difference between first and reverse on that model is whether you lift up a little ring on the shaft of the gear lever prior to engagement.

Re: python (scipy) TypeError

2016-10-03 Thread Peter Pearson
On Mon, 3 Oct 2016 09:14:23 -0700 (PDT), chrischris201...@gmail.com wrote: [snip] > > i try to follow some tutorial but i have that error : > > Traceback (most recent call last): > File "C:\Python27\test\test\earth.py", line 42, in > slope_array = np.ones_like(data_array) * nodataval > TypeE

python (scipy) TypeError

2016-10-03 Thread chrischris201444
hello i try to follow some tutorial but i have that error : Traceback (most recent call last): File "C:\Python27\test\test\earth.py", line 42, in slope_array = np.ones_like(data_array) * nodataval TypeError: unsupported operand type(s) for *: 'int' and 'NoneType' first i define that lin

Re: working with ctypes and complex data structures

2016-10-03 Thread eryk sun
On Mon, Oct 3, 2016 at 2:35 PM, Michael Felt wrote: > On 02-Oct-16 23:44, eryk sun wrote: >> On Sun, Oct 2, 2016 at 5:50 PM, Michael Felt >> wrote: >> >>> b) what I am not understanding - as the basic documentation shows >>> FOO.value as the way to set/get the value of a _field_ >> >> You may b

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread breamoreboy
On Monday, October 3, 2016 at 12:53:55 PM UTC+1, Marko Rauhamaa wrote: > Gregory Ewing: > > > Turns out the only difference between first and reverse on that model > > is whether you lift up a little ring on the shaft of the gear lever > > prior to engagement. > > > > Who came up with *that* brill

Re: print to previous line in console

2016-10-03 Thread Skip Montanaro
> When we are printing to the console, is there a way to display to the > previous line in the console. Check out the curses module: https://docs.python.org/3.6/library/curses.html Skip -- https://mail.python.org/mailman/listinfo/python-list

print to previous line in console

2016-10-03 Thread udhay prakash pethakamsetty
Hi, \t is for tab(forward) space; and \r is for carriage return (back space) When we are printing to the console, is there a way to display to the previous line in the console. We can achive that easily in file operations, But I want a solution in displaying on Console. regards Udhay Pr

Re: Copying a compiled Python from one system to another

2016-10-03 Thread Chris Angelico
On Tue, Oct 4, 2016 at 1:06 AM, Steve D'Aprano wrote: > On Sun, 2 Oct 2016 04:45 pm, Paul Rubin wrote: > >> Steve D'Aprano writes: >>> Yes, this. You need gcc 4.8 or better to build CPython 3.6, and the most >>> recent any of my systems support is 4.4. >> >> Building gcc takes a while but it's re

Re: Need help for the print() function with a better order

2016-10-03 Thread breamoreboy
On Sunday, October 2, 2016 at 2:12:39 AM UTC+1, 38016...@gmail.com wrote: > I am trying to print a simple decision tree for my homework. > The answer must keep in this format: > > Top 7,4,0.95 > career gain = 100 > 1.Management 2, 3, 0.9709505944546686 > 2.Service 5, 1, 0.6500224216483

Re: working with ctypes and complex data structures

2016-10-03 Thread Michael Felt
On 02-Oct-16 23:44, eryk sun wrote: On Sun, Oct 2, 2016 at 5:50 PM, Michael Felt wrote: a) where is documentation on "CField"'s? It's undocumented. So I do not feel so bad about not finding anything :) A CField is a data descriptor that accesses a struct field with the given type, size,

Re: Copying a compiled Python from one system to another

2016-10-03 Thread Steve D'Aprano
On Sun, 2 Oct 2016 04:45 pm, Paul Rubin wrote: > Steve D'Aprano writes: >> Yes, this. You need gcc 4.8 or better to build CPython 3.6, and the most >> recent any of my systems support is 4.4. > > Building gcc takes a while but it's reasonably simple. Just start it > going and read a book for a

Re: announcing fython

2016-10-03 Thread nicolasessisbreton
>Have you looked at f2py? >There is also fortran magic for Jupyter notebooks >f90wrap extends f2py to support modern Fortran f2py and others are great to use static Fortran code, like LAPACK or BLAS. By static, I mean that no change is necessary to the Fortran code. Fython can do that too, and als

Re: Python 3.5 amd64 and win32service

2016-10-03 Thread eryk sun
On Mon, Oct 3, 2016 at 1:26 PM, Nagy László Zsolt wrote: > > Is it possible to write a win32 service with 64 bit python 3.5? The > pywin32 package does exist on 3.5 64bit, but missing some modules: Try pip installing the "pypiwin32" package. -- https://mail.python.org/mailman/listinfo/python-lis

Python 3.5 amd64 and win32service

2016-10-03 Thread Nagy László Zsolt
Hello, Is it possible to write a win32 service with 64 bit python 3.5? The pywin32 package does exist on 3.5 64bit, but missing some modules: >>> import win32service Traceback (most recent call last): File "", line 1, in ImportError: DLL load failed:The specified module could not be found.

ANN: parsita 1.0.0, a new parser combinator library

2016-10-03 Thread David Hagen
Parsita is a parser combinator library for Python. I wrote it because I missed the intuitive parser combinator library in Scala while trying to parse custom model file formats in Python. Parsita is focused on a clean grammar-like syntax, defining operators like `|` and `&` and functions like `o

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread BartC
On 03/10/2016 12:53, Marko Rauhamaa wrote: Gregory Ewing : Turns out the only difference between first and reverse on that model is whether you lift up a little ring on the shaft of the gear lever prior to engagement. Who came up with *that* brilliant piece of user interface design I don't kno

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread alister
On Mon, 03 Oct 2016 22:10:52 +1300, Gregory Ewing wrote: > Rustom Mody wrote: >> My new car goes in reverse when I put it in first gear but only on >> full-moon nights with the tank on reserve when the left light is >> blinking > > OT aside: When I went to take my current car (a manual) for a tes

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread Marko Rauhamaa
Gregory Ewing : > Turns out the only difference between first and reverse on that model > is whether you lift up a little ring on the shaft of the gear lever > prior to engagement. > > Who came up with *that* brilliant piece of user interface design I > don't know. It seems specifically designed t

Re: working with ctypes and complex data structures

2016-10-03 Thread Michael Felt
On 02-Oct-16 23:44, eryk sun wrote: On Sun, Oct 2, 2016 at 5:50 PM, Michael Felt wrote: > >a) where is documentation on "CField"'s? I will reply more later - just a quick thanks. Not using maxsize will be good, also in a different patch - also specific to AIX. This "thing" I am working

Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread Gregory Ewing
Rustom Mody wrote: My new car goes in reverse when I put it in first gear but only on full-moon nights with the tank on reserve when the left light is blinking OT aside: When I went to take my current car (a manual) for a test drive, I had to stop and ask the dealer how to put it into reverse.

Re: unintuitive for-loop behavior

2016-10-03 Thread Gregory Ewing
Steve D'Aprano wrote: x = str = 1 assert x == 1 and str == 1 del x, str assert str # succeeds assert x # NameError x = str = 2 # create new bindings, or update existing ones? Is it our conclusion that therefore Python creates a new binding for str but not for x? Or that the evidence for x is

Re: unintuitive for-loop behavior

2016-10-03 Thread Jussi Piitulainen
Antoon Pardon writes: > Op 02-10-16 om 07:59 schreef Rustom Mody: >> >> You are explaining the mechanism behind the bug. Thanks. The bug >> remains. My new car goes in reverse when I put it in first gear but >> only on full-moon nights with the tank on reserve when the left light >> is blinking T

Re: PyQt5, OpenGL, where to start, minimal example code?

2016-10-03 Thread Phil Thompson
On 3 Oct 2016, at 4:29 am, John Ladasky wrote: > > On Sunday, October 2, 2016 at 7:21:15 PM UTC-7, blue wrote: >> You have here a PyQt5 Reference Guide >> http://pyqt.sourceforge.net/Docs/PyQt5/index.html >> Some example can be found here 4 and 5 >> http://codeprogress.com/python/libraries/pyqt

Re: unintuitive for-loop behavior

2016-10-03 Thread Antoon Pardon
Op 02-10-16 om 07:59 schreef Rustom Mody: > > You are explaining the mechanism behind the bug. Thanks. The bug remains. > My new car goes in reverse when I put it in first gear but only on full-moon > nights with the tank on reserve when the left light is blinking > The engineer explains the inter

Re: unintuitive for-loop behavior

2016-10-03 Thread Gregory Ewing
Chris Angelico wrote: The only way to prove that something is a new binding is to demonstrate that, when this binding is removed, a previous one becomes visible. Or capture them both with closures and show that each closure sees a different version of the binding. -- Greg -- https://mail.pytho

Re: unintuitive for-loop behavior

2016-10-03 Thread Gregory Ewing
Steve D'Aprano wrote: No it doesn't mean that at all. The result you see is compatible with *both* the "update existing slot" behaviour and "create a new slot" behavior. We're getting sidetracked talking about slots here. It's not really relevant. The point is that there is only *one* binding f