On Sat, Nov 14, 2015 at 8:26 PM, Zachary Ware
wrote:
>
> "#!python" is a valid shebang for the Python Launcher for Windows.
> It's also a not-too-terrible placeholder for a Unix shebang meaning
> "whichever Python you want it to be". The better choice for use with
> both platforms would be "#!/us
On 15/11/15 10:18, Chris Angelico wrote:
> On Sun, Nov 15, 2015 at 1:13 PM, fl wrote:
>> Excuse me. Below is copied from the .py file:
>>
>> #!python
>> from numpy import *
>> from numpy.random import *
>>
> Then someone doesn't know how to use a shebang (or is deliberately
> abusing it), and you
Zachary Ware writes:
> I've noticed you sending a lot of questions in the past day or two,
> many at a fairly basic level. I think you would be well-served to
> read through the tutorial at https://docs.python.org/3/tutorial.
Better than merely reading through it: Anyone who wants to learn Pyth
Hi,
On Sat, Nov 14, 2015 at 8:23 PM, fl wrote:
> Hi,
>
> When I read the below code, I cannot make the last line (with ##) out.
>
>
>
> def res(weights):
> n = len(weights)
> indices = []
> C = [0.] + [sum(weights[:i+1]) for i in range(n)]
> u0, j = random(), 0 ##
>
>
> If I run
On Sun, Nov 15, 2015 at 1:37 PM, fl wrote:
> Or are there some high relevant tutorial on this?
>
Start here:
https://docs.python.org/3/tutorial/index.html
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
I have read a couple of tutorial on yield. The following code snippet still
gives me a shock. I am told yield is a little like return. I only see one
yield in the tutorial examples. Here it has two yields. And there are three
variables following keyword yield.
I have not tried debug function t
On Sat, Nov 14, 2015 at 7:58 PM, Chris Angelico wrote:
> On Sun, Nov 15, 2015 at 12:54 PM, fl wrote:
>> I see an example Python code has such a line at the file beginning:
>>
>> #!python
>>
>>
>> Is there some meaning about it?
>
> It probably didn't look exactly like that. Please, when you're as
On 11/14/2015 06:54 PM, fl wrote:
> Hi,
>
> I see an example Python code has such a line at the file beginning:
>
> #!python
>
>
> Is there some meaning about it?
Supposed to be, yes, but the line you've pasted there wouldn't work on
any system I know of.
https://en.wikipedia.org/wiki/Shebang
Hi,
When I read the below code, I cannot make the last line (with ##) out.
def res(weights):
n = len(weights)
indices = []
C = [0.] + [sum(weights[:i+1]) for i in range(n)]
u0, j = random(), 0 ##
If I run below code on console, it will say an error.
uu, 0.1, 0
What differe
On Sun, Nov 15, 2015 at 1:08 PM, Steven D'Aprano wrote:
> number = +raw_input("enter a number: ")
>
> versus:
>
> text = raw_input("enter a number: ")
> try:
> number = float(text)
> except ValueError:
> number = int(text)
What kinds of strings can float() not handle but int() can, and in
On Sun, Nov 15, 2015 at 1:13 PM, fl wrote:
> Excuse me. Below is copied from the .py file:
>
> #!python
> from numpy import *
> from numpy.random import *
>
Then someone doesn't know how to use a shebang (or is deliberately
abusing it), and you can ignore it. It starts with a hash, ergo it's a
co
On Saturday, November 14, 2015 at 8:58:57 PM UTC-5, Chris Angelico wrote:
> On Sun, Nov 15, 2015 at 12:54 PM, fl wrote:
> > I see an example Python code has such a line at the file beginning:
> >
> > #!python
> >
> >
> > Is there some meaning about it?
>
> It probably didn't look exactly like tha
On Sun, 15 Nov 2015 02:43 am, Ian Kelly wrote:
> On Fri, Nov 13, 2015 at 10:40 PM, Steven D'Aprano
> wrote:
>> Python has operator overloading, so it can be anything you want it to be.
>> E.g. you might have a DSL where +feature turns something on and -feature
>> turns it off.
>
> By that argume
On Sun, Nov 15, 2015 at 12:54 PM, fl wrote:
> I see an example Python code has such a line at the file beginning:
>
> #!python
>
>
> Is there some meaning about it?
It probably didn't look exactly like that. Please, when you're asking
questions, COPY AND PASTE rather than retyping some approximat
Hi,
I see an example Python code has such a line at the file beginning:
#!python
Is there some meaning about it?
Thanks,
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 15 Nov 2015 04:34 am, Cai Gengyang wrote:
> I want to write a program in Python that does this
>
> "Write a program that prints the numbers from 1 to 100. But for multiples
> of three print "Fizz" instead of the number and for the multiples of five
> print "Buzz". For numbers which a
On Sun, 15 Nov 2015 11:35 am, vjp2...@at.biostrategist.dot.dot.com wrote:
> Jython is python in java at jython.org.
>
> I tried clicking and double clicking.
Hi Vanos,
I am perfectly aware of what Jython is, what I don't know is what you
are "clicking and double-clicking".
While we are very sm
On Sun, 15 Nov 2015 09:53 am, Random832 wrote:
> Marko Rauhamaa writes:
>> Actually, the real question is, is the unary - *really* so useful that
>> it merits existence or is it just something that was mindlessly copied
>> into programming languages from elementary school arithmetics?
>
> The al
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
import pygtk
pygtk.require('2.0')
import gtk
class Base:
def __init__(self):
self.window
On 2015-11-14 22:53, Random832 wrote:
Marko Rauhamaa writes:
Actually, the real question is, is the unary - *really* so useful that
it merits existence or is it just something that was mindlessly copied
into programming languages from elementary school arithmetics?
The alternative, if you wan
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'm trying to run RDKIT, an app written for jython.
THen I realised jython wasn't working at all.
I've had same problem with some java jars.
I only k
Random832 :
> Marko Rauhamaa writes:
>> Actually, the real question is, is the unary - *really* so useful
>> that it merits existence or is it just something that was mindlessly
>> copied into programming languages from elementary school arithmetics?
>
> The alternative, if you want to be able to
Marko Rauhamaa writes:
> Actually, the real question is, is the unary - *really* so useful that
> it merits existence or is it just something that was mindlessly copied
> into programming languages from elementary school arithmetics?
The alternative, if you want to be able to specify negative num
Am 14.11.15 um 21:00 schrieb fl:
from numpy import *
dt = 0.1
# Initialization of state matrices
X = array([[0.0], [0.0], [0.1], [0.1]])
# Measurement matrices
Y = array([[X[0,0] + abs(randn(1)[0])], [X[1,0] + abs(randn(1)[0])]])
When the above content is inside a .py document and running, ther
Ian Kelly :
> On Nov 14, 2015 9:56 AM, "Marko Rauhamaa" wrote:
>>r = //(//r1 + //r2 + //r3)
>
> Unary integer division seems pretty silly since the only possible
> results would be 0, 1 or -1.
Yep, mixed them up.
Marko
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
I want to use a code snippet found on-line. It has such content:
from numpy import *
dt = 0.1
# Initialization of state matrices
X = array([[0.0], [0.0], [0.1], [0.1]])
# Measurement matrices
Y = array([[X[0,0] + abs(randn(1)[0])], [X[1,0] + abs(randn(1)[0])]])
When the above content is i
On 14/11/2015 17:34, Cai Gengyang wrote:
I want to write a program in Python that does this
"Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead
of the number and for the multiples of five print "Buzz". For numbers which are multiples of b
On 14/11/2015 17:34, Cai Gengyang wrote:
I want to write a program in Python that does this
"Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead
of the number and for the multiples of five print "Buzz". For numbers which are multiples of b
On Sat, Nov 14, 2015 at 12:34 PM, Cai Gengyang
wrote:
> I want to write a program in Python that does this
>
> "Write a program that prints the numbers from 1 to 100. But for multiples
> of three print "Fizz" instead of the number and for the multiples of five
> print "Buzz". For numbers whi
I want to write a program in Python that does this
"Write a program that prints the numbers from 1 to 100. But for multiples of
three print "Fizz" instead of the number and for the multiples of five print
"Buzz". For numbers which are multiples of both three and five print
"FizzBuzz"."
Ho
On Saturday, November 14, 2015 at 12:23:50 PM UTC-5, fl wrote:
> Hi,
>
> I follow a tutorial to learn decorator:
>
> http://simeonfranklin.com/blog/2012/jul/1/python-decorators-in-12-steps/
>
> I use Enthought Canopy to run the following code.
> It is really strange that the wrapper does not tak
Hi,
I follow a tutorial to learn decorator:
http://simeonfranklin.com/blog/2012/jul/1/python-decorators-in-12-steps/
I use Enthought Canopy to run the following code.
It is really strange that the wrapper does not take effect.
In fact, I go back to the basic way (not with @):
wrapper(sub(two,
On Nov 14, 2015 10:10 AM, "Chris Angelico" wrote:
>
> On Sun, Nov 15, 2015 at 4:04 AM, Ian Kelly wrote:
> > Unary integer division seems pretty silly since the only possible
results
> > would be 0, 1 or -1.
>
> 1, -1, or ZeroDivisionError. The zero's on the other side. But yes.
// 42 == 1 // 42
On Nov 14, 2015 9:56 AM, "Marko Rauhamaa" wrote:
>
> Ian Kelly :
>
> > For somebody reading one of these uses of unary plus in real code, I
> > imagine it would be a bit of a WTF moment if it's the first time
> > they've encountered it. I don't recall ever seeing any code that
> > actually used th
On Sun, Nov 15, 2015 at 3:52 AM, Marko Rauhamaa wrote:
> What I don't understand is why there is a unary + but no unary /:
>
>-x ≡ 0 - x
>+x ≡ 0 + x
>/x ≡ 1 / x
>//x ≡ 1 // x
>*x ≡ 1 * x
>
> You could write:
>
>r = //(//r1 + //r2 + //r3)
>
> for
>
>r = 1 // (1//r1 + 1//
On Sun, Nov 15, 2015 at 2:43 AM, Ian Kelly wrote:
> On Fri, Nov 13, 2015 at 10:40 PM, Steven D'Aprano wrote:
>> Python has operator overloading, so it can be anything you want it to be.
>> E.g. you might have a DSL where +feature turns something on and -feature
>> turns it off.
>
> By that argume
Ian Kelly :
> For somebody reading one of these uses of unary plus in real code, I
> imagine it would be a bit of a WTF moment if it's the first time
> they've encountered it. I don't recall ever seeing any code that
> actually used this, though.
What I don't understand is why there is a unary +
Le 14/11/2015 16:39, Dennis Lee Bieber a écrit :
On Sat, 14 Nov 2015 07:02:41 -0800 (PST), John Zhao
declaimed the following:
I found a solution. replace bDict.clear() with bDict = {}
Which is creating a second, empty, dictionary and binding the name
"bDict" to that new one.
On Sat, Nov 14, 2015 at 7:46 AM, fl wrote:
> A following problem now is about the args in class decorate. I do not see
> args and kwargs are transferred by get_fullname(self).
>
>
> If I change
>
> return "{0}".format(func(*args, **kwargs))
>
> to
>
> return "{0}".format(func(*args))
>
> The outpu
On Fri, Nov 13, 2015 at 10:40 PM, Steven D'Aprano wrote:
> Python has operator overloading, so it can be anything you want it to be.
> E.g. you might have a DSL where +feature turns something on and -feature
> turns it off.
By that argument we should also have operators ~, !, $, \, ? because
some
On 11/14/2015 04:51 AM, Cecil Westerhof wrote:
> I tried to install v1.8.0 with:
> pip3 install -I kivy==1.8.0
Why are you trying to install the non-current version of kivy?
Did you install pygame successfully?
--
https://mail.python.org/mailman/listinfo/python-list
I found a solution. replace bDict.clear() with bDict = {}
thanks,
John
--
https://mail.python.org/mailman/listinfo/python-list
Op 14-11-15 om 04:11 schreef Michael Torrie:
> On 11/10/2015 03:03 AM, Antoon Pardon wrote:
>> Op 10-11-15 om 00:29 schreef Ben Finney:
>>>
>>> Who is doing what to whom? The user of the library isn't doing anything
>>> to the library author, so what is it the library author would consent
>>> to? I
On Saturday, November 14, 2015 at 7:38:09 AM UTC-5, Chris Warrick wrote:
> On 14 November 2015 at 13:13, fl wrote:
> > On Saturday, November 14, 2015 at 7:11:11 AM UTC-5, fl wrote:
> >> Hi,
> >>
> >> I am learning decorator following this link:
> >>
> >> http://thecodeship.com/patterns/guide-to-py
I am new to Python, and just learned that Python list is just a container of
object reference.
In the example below, bDict needs to be just a temporary object, constructed
at run time and then be added to aList. At the end, aList will contain n
objects.
Is there a clean way to do
Le 14 nov. 2015 13:00, "Cecil Westerhof" a écrit :
>
> On Friday 13 Nov 2015 21:10 CET, Cecil Westerhof wrote:
>
> > On Friday 13 Nov 2015 20:53 CET, Michael Torrie wrote:
> >
> >> On 11/13/2015 11:30 AM, Cecil Westerhof wrote:
> >>> On Friday 13 Nov 2015 18:21 CET, Michael Torrie wrote:
> >>>
> >
On 14 November 2015 at 13:13, fl wrote:
> On Saturday, November 14, 2015 at 7:11:11 AM UTC-5, fl wrote:
>> Hi,
>>
>> I am learning decorator following this link:
>>
>> http://thecodeship.com/patterns/guide-to-python-function-decorators/
>>
>> When I read decorator on class, I don't see decorator t
On Saturday, November 14, 2015 at 7:11:11 AM UTC-5, fl wrote:
> Hi,
>
> I am learning decorator following this link:
>
> http://thecodeship.com/patterns/guide-to-python-function-decorators/
>
> When I read decorator on class, I don't see decorator taking in effect.
> In the following code snippe
Hi,
I am learning decorator following this link:
http://thecodeship.com/patterns/guide-to-python-function-decorators/
When I read decorator on class, I don't see decorator taking in effect.
In the following code snippet, there is the same print out if I comment out
two lines 'def p_decorate(func
On Friday 13 Nov 2015 21:10 CET, Cecil Westerhof wrote:
> On Friday 13 Nov 2015 20:53 CET, Michael Torrie wrote:
>
>> On 11/13/2015 11:30 AM, Cecil Westerhof wrote:
>>> On Friday 13 Nov 2015 18:21 CET, Michael Torrie wrote:
>>>
On 11/13/2015 09:33 AM, Cecil Westerhof wrote:
> I tried to i
On 14Nov2015 08:37, Laura Creighton wrote:
In a message of Sat, 14 Nov 2015 00:38:41 -0500, Terry Reedy writes:
On 11/13/2015 10:58 PM, Ian Kelly wrote:
On Nov 9, 2015 7:41 PM, "Heather Piwowar" wrote:
4. http://depsy.org/tag/scientific%252Fengineering
FYI, the depsy.org site is completely
fl wrote:
>I read the following code snippet. A question is here about '@'.
>I don't find the answer online yet.
I recommend this:
"Understanding Python Decorators in 12 Easy Steps!"
http://simeonfranklin.com/blog/2012/jul/1/python-decorators-in-12-steps/
--
https://mail.python.org/mailman/li
Am 13.11.15 um 23:10 schrieb Tim Daneliuk:
On 11/13/2015 03:30 PM, Christian Gollwitzer wrote:
Am 13.11.15 um 20:14 schrieb Tim Daneliuk:
On 11/13/2015 12:32 AM, Christian Gollwitzer wrote:
Apfelkiste:Sources chris$
Well, I get window and when I do this:
pack [button .b -text Hello -command
53 matches
Mail list logo