Re: What is wrong this wrapper (decorator)?

2015-11-15 Thread Gregory Ewing
fl wrote: wrapper(sub(two, one)) Out[38]: This doesn't do what you probably meant it to do. It first calls sub() with arguments one and two, and then passes the result of that (a Coordinate, if sub is working properly) to wrapper(). Since wrapper() expects a function, not a Coordinate, that wo

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-15 Thread Gregory Ewing
Chris Angelico wrote: Small problem: Since we have / and // operators, it's impossible to have a unary / operator: No, it's not -- '//' is already recognised as a single token distinct from '/ /'. You would just have to leave a space or use parens in some cases. -- Greg -- https://mail.python.

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-15 Thread Gregory Ewing
Ian Kelly wrote: Unary integer division seems pretty silly since the only possible results would be 0, 1 or -1. Ints are not the only thing that // can be applied to: >>> 1.0//0.01 99.0 -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-15 Thread Gregory Ewing
Dennis Lee Bieber wrote: And we'd be left looking for a symbol for bitwise inversion. Who needs negation when you have bitwise inversion? minusx = ~x + 1 I know, it doesn't work for floats, but that's just a simple matter of defining ~ on floats appropriately... -- Greg -- https://ma

Re: What meaning is of '#!python'?

2015-11-15 Thread paul.hermeneutic
The installer of some applications will replace the shebang to refer to a specific version of Python. By doing so, it avoids problems when someone upgrades the default Python version in the PATH. On Nov 14, 2015 11:00 PM, "eryksun" wrote: > On Sat, Nov 14, 2015 at 8:26 PM, Zachary Ware > wrote:

Re: What meaning is 'a[0:10:2]'?

2015-11-15 Thread Tim Chase
On 2015-11-15 16:27, fl wrote: > When I learn slice, I have a new question on the help file. If I > set: > > pp=a[0:10:2] > > pp is array([1, 3]) > > I don't know how a[0:10:2] gives array([1, 3]). > > I know matlab a lot, but here it seems quite different. Could you > tell me what meaning a[0:

Re: What meaning is 'a[0:10:2]'?

2015-11-15 Thread Ben Finney
(Please set a “From” address that has a name for you as an individual; “fl” is rather anonymous and doesn't help us to identify you in these conversations.) fl writes: > When I learn slice Are you working through the Python tutorial https://docs.python.org/3/tutorial/>? These are Python concept

What meaning is 'a[0:10:2]'?

2015-11-15 Thread fl
hi, When I learn slice, I have a new question on the help file. If I set: pp=a[0:10:2] pp is array([1, 3]) I don't know how a[0:10:2] gives array([1, 3]). I know matlab a lot, but here it seems quite different. Could you tell me what meaning a[0:10:2] is? Thanks, class slice(object) | s

Re: Why won't this run?

2015-11-15 Thread Tim Chase
On 2015-11-15 12:38, jbak36 wrote: > Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC > v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or > "license()" for more information. > >>> #this program says hello and asks for my name > >>> print:('Hello world!') > Hello world! W

Why won't this run?

2015-11-15 Thread jbak36
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> #this program says hello and asks for my name >>> print:('Hello world!') Hello world! >>> print:('What is your name?') #ask for their

Re: Format numbers

2015-11-15 Thread Seymore4Head
On Sun, 15 Nov 2015 19:00:42 +, MRAB wrote: >On 2015-11-15 17:30, Seymore4Head wrote: >> Just screwing around making up practice problems. I can't get the >> format right. I am trying to learn how to get a output line to line >> up neatly. >> >> import random >> lo=1 >> hi=1 # I am addi

Re: Format numbers

2015-11-15 Thread MRAB
On 2015-11-15 17:30, Seymore4Head wrote: Just screwing around making up practice problems. I can't get the format right. I am trying to learn how to get a output line to line up neatly. import random lo=1 hi=1 # I am adding or subtracting 0s from this input number fm=len(str(hi)) # This co

Format numbers

2015-11-15 Thread Seymore4Head
Just screwing around making up practice problems. I can't get the format right. I am trying to learn how to get a output line to line up neatly. import random lo=1 hi=1 # I am adding or subtracting 0s from this input number fm=len(str(hi)) # This counts the digits of the input number print f

Re: pygtk beginner script not working

2015-11-15 Thread kent nyberg
On Sat, Nov 14, 2015 at 05:00:59PM -0800, ja...@imagewebdesign.co.uk wrote: > Hi guys > > I'm new to Python so please bare with me :) > > I'm using python 2.7.10 as advised (more tools apparently over 3.x) > > Trying to use this script > > [CODE] > #!/usr/bin/env python > > # example base.py

Re: Jython standalone

2015-11-15 Thread Christian Gollwitzer
Am 15.11.15 um 01:35 schrieb vjp2...@at.biostrategist.dot.dot.com: Jython is python in java at jython.org. I tried clicking and double clicking. I does a wait cycle (rotating arrow) then returns to attention. I think you are describing the Windows mouse cursor that displays a rotating wheel