Marko Rauhamaa writes:
> Paul Rudin wrote:
>> Talk of pointers is potentially confusing, because it carries baggage
>> from other languages which doesn't necessary map precisely onto the
>> python execution model.
>
> Unfortunately, virtually every word is overloaded and full of
> preconceived not
On Friday, June 10, 2016 at 9:13:13 AM UTC+8, Michael Torrie wrote:
> On 06/09/2016 06:58 PM, meInvent bbird wrote:
> >
>
> Do you have a question for the list? If so, please state what it is, and
> describe what you are doing and what isn't working. If you can boil it
> down to a dozen lines of
On 06/09/2016 06:58 PM, meInvent bbird wrote:
>
Do you have a question for the list? If so, please state what it is, and
describe what you are doing and what isn't working. If you can boil it
down to a dozen lines of run-able, self-contained code that illustrates
the problem, that is helpful too
input are these six operators, output is finding full column of 27 elements add
together is 54
i got memory error when searching this,
i have difficulty in understanding map reduce and transforming my program into
map reduce problem
M1 = {}
M2 = {}
M3 = {}
M4 = {}
M5 = {}
V6 = {}
M1['00']=0
M
https://drive.google.com/file/d/0Bxs_ao6uuBDULVNsRjZSVjdPYlE/view?usp=sharing
M1 = {}
M2 = {}
M3 = {}
M4 = {}
M5 = {}
V6 = {}
M1['00']=0
M1['01']=2
M1['02']=1
M1['10']=1
M1['11']=1
M1['12']=1
M1['20']=1
M1['21']=1
M1['22']=2
M2['00']=0
M2['01']=1
M2['02']=1
M2['10']=1
M2['11']=1
M2['12']=1
M2['20'
On Wed, Jun 8, 2016 at 10:24 PM, Michael Selik
wrote:
> By the way, why choose to write, import, and delete modules? I'd think
> exec'ing code would be sufficient.
>
>
In order to test my own framework for web application.
It loads controller classes lazily. In other words, it loads python module
I like using Yelp's mrjob module (https://github.com/Yelp/mrjob) to run
Python on Hadoop.
On Thu, Jun 9, 2016 at 2:56 AM Ho Yeung Lee
wrote:
> [... a bunch of code ...]
If you want to describe a map-reduce problem, start with the data. What
does a record of your input data look like?
Then thi
On Thu, Jun 9, 2016 at 9:10 AM justin walters
wrote:
> It looks like you might be looking for an ORM. Have you checked out
> sqlalchemy?
>
An ORM might be overkill. If you just want a persistent dictionary, just
use the shelve module. https://docs.python.org/3/library/shelve.html
--
https://mai
On Thu, Jun 9, 2016 at 5:07 AM Nagy László Zsolt
wrote:
> I would like to create a collections.UserList subclass that can notify
> others when the list is mutated.
>
Why not subclass MutableSequence instead? The ABC will tell you which
methods to override (the abstract ones). The mixin methods r
There were many good talks and presentations at PyCon 2016, but if you
can only watch one, this is the one to watch:
https://www.youtube.com/watch?v=bSfe5M_zG2s
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
Paul Rudin :
> Marko Rauhamaa writes:
>> The spec (https://docs.python.org/3/reference/datamodel.html>)
>> uses the terms *identity* and *reference*, which are one-to-one.
>
> identity isn't the same thing as a name, identity is an inherent
> property of an object - many names may refer to the sa
On 2016-06-09 19:58, Peter Otten wrote:
Nev wrote:
Thank you for your reply. I tried something like this in python code:
from subprocess import call
call(["ffmpeg -framerate 4/1 -start_number 1 -i
C:\\Projects\\data2\\img_%05d.png -c:v libx264 -r 30 -pix_fmt yuv420p
C:\\Projects\\data2\\movie.
Nev wrote:
> Thank you for your reply. I tried something like this in python code:
>
> from subprocess import call
> call(["ffmpeg -framerate 4/1 -start_number 1 -i
> C:\\Projects\\data2\\img_%05d.png -c:v libx264 -r 30 -pix_fmt yuv420p
> C:\\Projects\\data2\\movie.mp4"])
>
> But it did not work
On Thu, Jun 9, 2016, at 03:30, Antoon Pardon wrote:
> Then you think wrong. Python has no pointers, that is an implementation
> detail.
Nonsense. A binary number referring to a memory address is an
implementation detail. A pointer/reference/arrow-thingy-on-a-diagram is
the thing it is an implement
In <35cd5920-1fbb-441f-9fc6-2f3f2e5f8...@googlegroups.com> Ho Yeung Lee
writes:
> i write a program, it is like forever loop
> but i only restrict it to run 2 level recursively,
I don't think the restriction is working. There is "if deep > 0:"
at the top of the function, but the recursive cal
> [Looks like you made progress while I struggled to come up with the
> following. I'll post it anyway.]
Your version is much better. Thanks! :-)
--
https://mail.python.org/mailman/listinfo/python-list
Paul Rudin writes:
> Marko Rauhamaa writes:
>> So your "names" are *variables*.
>
> Informally yes, but "variable" has no meaning in the language reference.
>
... err sorry, actually not correct - but irrelevant to the point under
discussion.
--
https://mail.python.org/mailman/listinfo/pyt
Marko Rauhamaa writes:
> Paul Rudin :
>
>> Marko Rauhamaa writes:
>>> The object is only an intermediate result; what is returned is a
>>> pointer (to an object), without an exception. That's not a matter of
>>> implementation. It's an essential part of Python's data model.
>>
>> Well - the lang
Thank you for your reply. I tried something like this in python code:
from subprocess import call
call(["ffmpeg -framerate 4/1 -start_number 1 -i
C:\\Projects\\data2\\img_%05d.png -c:v libx264 -r 30 -pix_fmt yuv420p
C:\\Projects\\data2\\movie.mp4"])
But it did not work. I get FileNotFoundError:
Paul Rudin :
> Marko Rauhamaa writes:
>> The object is only an intermediate result; what is returned is a
>> pointer (to an object), without an exception. That's not a matter of
>> implementation. It's an essential part of Python's data model.
>
> Well - the language has no explicit notion of "po
On Wednesday, June 8, 2016 at 10:39:00 PM UTC+12, rocky wrote:
> In addition to the example programs which give the classic arithmetic
> expression evaluator, I now include the beginnings of a full Python 2.6
> language.
Does anybody bother with LR(k) parsers any more?
--
https://mail.python.org
Marko Rauhamaa writes:
> Paul Rudin :
>
>> Marko Rauhamaa writes:
>>> What is different is that in Python, every expression evaluates to a
>>> pointer. Thus, you can only assign pointers to variables.
>>
>> I don't think that's really right - every expression evaluates to an
>> object.
>
> The o
We are pleased to announce our keynote schedule for EuroPython 2016:
* Monday: Rachel Willmer & Nicholas Tollervey
* Tuesday: Paul Hildebrandt
* Wednesday: Jameson Rollins
* Thursday: Naomi Ceder
* Friday: Gaël Varoquaux
More information about our keynoters is available on the keynote
schedu
Nagy László Zsolt wrote:
>
>> Using the built-in list or dict is problematic because sometimes the
>> subclass methods are ignored when the internal data is accessed (sorry, I
>> don't have an example).
> Are you suggesting that I should use UserList and UserDict instead of
> list and dict? What
> I am planning design an encrypted time-limited API on both Client and Server
> sides,
If you want client/server communitation in an encypted way you can use the ssl
module.
This email is confidential and may be subject to privilege. If you are not the
intended recipient, please do not copy or
> @wrap_notify('remove', 'clear', 'append', 'insert', 'sort'):
> class ObservableList(ObservableCollection, list):
> pass
>
> I just can't find out the right syntax.
>
>
All right, this is working.
from contextlib import contextmanager
class ObservableCollection:
@contextmanager
def
On 2016-06-09 07:02, meInvent bbird wrote:
when i run code in window has an error not a valid win32 dll
then i install scipy first in this site, then install numpy-mkl
all python 2.7 and win32
http://www.lfd.uci.edu/~gohlke/pythonlibs/
then i run code below, got error , and captured screen in
> Using the built-in list or dict is problematic because sometimes the
> subclass methods are ignored when the internal data is accessed (sorry, I
> don't have an example).
Are you suggesting that I should use UserList and UserDict instead of
list and dict? What is the truth? Was UserDict left i
Intel has released Beta Update 1 of its Python distribution:
"What's New!
Jupyter* notebook interface
Neural network APIs support for pyDAAL
Optimized random number generation features for numpy.random package"
--
https://mail.python.org/mailman/listinfo/python-list
Antoon Pardon :
> Op 09-06-16 om 11:19 schreef Marko Rauhamaa:
>> The difference is not in the variables but in the expressions. In
>> Python,
>>
>> 1
>>
>> evaluates to a pointer; in C, it evaluates to an int. Furthermore, in
>> Python,
>>
>> A
>>
>> evaluates to a pointer; in C, it evalu
It looks like you might be looking for an ORM. Have you checked out
sqlalchemy?
--
https://mail.python.org/mailman/listinfo/python-list
Paul Rudin :
> Marko Rauhamaa writes:
>> What is different is that in Python, every expression evaluates to a
>> pointer. Thus, you can only assign pointers to variables.
>
> I don't think that's really right - every expression evaluates to an
> object.
The object is only an intermediate result;
Op 09-06-16 om 14:17 schreef BartC:
> On 09/06/2016 12:19, Antoon Pardon wrote:
>> Op 09-06-16 om 12:53 schreef BartC:
>>> On 09/06/2016 10:46, Antoon Pardon wrote:
Op 09-06-16 om 09:36 schreef Steven D'Aprano:
>>>
> Your example demonstrates object mutation, not assignment.
Gene
Nagy László Zsolt wrote:
>
>>> Is there a way to easily find out which methods of are mutating the
>>> collection? Other than going over the source and checking all (normal
>>> and inherited) methods?
>> How about
>>
>> set(dir(collections.UserList)) - set(dir(collections.Sequence))
> Thanks. It
On 2016年05月19日 11時02分, Ian Kelly wrote:
"else" makes sense from a certain point of view, but I think that
logic may not be communicated well. At the start of each loop
iteration, the loop construct makes a test for whether the loop should
continue or not. If that test ever fails (i.e. if the cond
Op 09-06-16 om 14:25 schreef BartC:
> On 09/06/2016 12:08, Antoon Pardon wrote:
>> Op 09-06-16 om 12:48 schreef BartC:
>>>
>>> What does it matter?
>>>
>>> If swap() can be implemented via such a function, then it means that
>>> the language has such capability, which can be useful in different
>>>
how do connect my google sheet and my GAE application made in python so that i
can read , update and delete cells , any step by instruction for newbie?
--
https://mail.python.org/mailman/listinfo/python-list
Op 09-06-16 om 13:46 schreef Julien Salort:
> Antoon Pardon wrote:
>
>> A.x = 1;
>> A.y = 2;
>>
>> B = A;
>>
>> B.x = 3;
>> B.y = 4;
>>
>>
>> In C the variable A will still be x:1, y:2.
>> In Python the variable A will be x:3, y:4.
> But it would, if you had written instead:
>
> A->x =
In Perl there exists the tie mechanism for key/value type databases like
Berkeley db. Are there any python modules that can do the same for
a column of a mysql table?
Given the following table users:
(
username char(16) not null unique,
email char(128),
fullname char(64)
)
What I would like is if
On 09/06/2016 12:08, Antoon Pardon wrote:
Op 09-06-16 om 12:48 schreef BartC:
What does it matter?
If swap() can be implemented via such a function, then it means that
the language has such capability, which can be useful in different
scenarios.
If it can't, then the language hasn't.
Python
On 09/06/2016 12:19, Antoon Pardon wrote:
Op 09-06-16 om 12:53 schreef BartC:
On 09/06/2016 10:46, Antoon Pardon wrote:
Op 09-06-16 om 09:36 schreef Steven D'Aprano:
Your example demonstrates object mutation, not assignment.
Generally assignment and mutation don't contradict each other.
So
Antoon Pardon wrote:
> A.x = 1;
> A.y = 2;
>
> B = A;
>
> B.x = 3;
> B.y = 4;
>
>
> In C the variable A will still be x:1, y:2.
> In Python the variable A will be x:3, y:4.
But it would, if you had written instead:
A->x = 1;
A->y = 2;
B = A;
B->x = 3;
B->y = 4;
which backs ind
Op 09-06-16 om 12:53 schreef BartC:
> On 09/06/2016 10:46, Antoon Pardon wrote:
>> Op 09-06-16 om 09:36 schreef Steven D'Aprano:
>
>>> Your example demonstrates object mutation, not assignment.
>>
>> Generally assignment and mutation don't contradict each other.
>> So IMO the cause is the same, a m
Op 09-06-16 om 12:48 schreef BartC:
>
> What does it matter?
>
> If swap() can be implemented via such a function, then it means that
> the language has such capability, which can be useful in different
> scenarios.
>
> If it can't, then the language hasn't.
>
> Python doesn't have it so it can't i
BartC writes:
> On 09/06/2016 10:46, Antoon Pardon wrote:
>> Op 09-06-16 om 09:36 schreef Steven D'Aprano:
>
>>> Your example demonstrates object mutation, not assignment.
>>
>> Generally assignment and mutation don't contradict each other.
>> So IMO the cause is the same, a mutation. In some lang
i write a program, it is like forever loop
but i only restrict it to run 2 level recursively,
why it is slow, where is the problem?
M1 = {}
M2 = {}
M3 = {}
M4 = {}
M5 = {}
V6 = {}
M1['00']=0
M1['01']=1
M1['02']=1
M1['10']=2
M1['11']=2
M1['12']=1
M1['20']=1
M1['21']=2
M1['22']=1
M2['00']=0
M2['0
On 09/06/2016 10:46, Antoon Pardon wrote:
Op 09-06-16 om 09:36 schreef Steven D'Aprano:
Your example demonstrates object mutation, not assignment.
Generally assignment and mutation don't contradict each other.
So IMO the cause is the same, a mutation. In some languages you
can mutate your va
On 09/06/2016 10:55, Antoon Pardon wrote:
Op 09-06-16 om 11:10 schreef BartC:
On 09/06/2016 08:50, Antoon Pardon wrote:
Op 08-06-16 om 19:29 schreef BartC:
I don't see why we should determine what a /proper/ reference
can do, based on what it does in one specific language.
Because there are
On 09/06/2016 11:03, Marko Rauhamaa wrote:
Antoon Pardon :
Your challenge, shows that you don't fully understand what reference
variables are. The behaviour you see in Pascal, doesn't depend (alone)
on the parameter being a reference parameter. It also depends on the
fact that the assignment in
>> Is there a way to easily find out which methods of are mutating the
>> collection? Other than going over the source and checking all (normal
>> and inherited) methods?
> How about
>
> set(dir(collections.UserList)) - set(dir(collections.Sequence))
Thanks. It narrows down the list of possible me
Op 09-06-16 om 11:19 schreef Marko Rauhamaa:
>
>> In a rather straight forward environment with classes/structs that
>> have an x and y attribute, the following lines behave differently
>> in C and Python.
>>
>> A.x = 1;
>> A.y = 2;
>>
>> B = A;
>>
>> B.x = 3;
>> B.y = 4;
>>
>> In C the v
Marko Rauhamaa writes:
> Antoon Pardon :
>
>> You can do something like that in simula, but only because
>> simula has two kinds of assignments. One kind that is
>> simular to python and one that is similar to C.
>> The one that is similar that python is the reference assignment.
>
> I see Python
On Friday, May 20, 2016 at 7:15:38 AM UTC+2, silve...@gmail.com wrote:
> On Wednesday, May 18, 2016 at 2:25:16 PM UTC+2, Peter Otten wrote:
> > Chris Angelico wrote:
> >
> > > On Wed, May 18, 2016 at 7:28 PM, Peter Otten <__pete...@web.de> wrote:
> > >> I don't see an official way to pass a custom
Antoon Pardon :
> Your challenge, shows that you don't fully understand what reference
> variables are. The behaviour you see in Pascal, doesn't depend (alone)
> on the parameter being a reference parameter. It also depends on the
> fact that the assignment in pascal mutates the variable that is
>
Op 09-06-16 om 11:10 schreef BartC:
> On 09/06/2016 08:50, Antoon Pardon wrote:
>> Op 08-06-16 om 19:29 schreef BartC:
>>> I don't see why we should determine what a /proper/ reference
can do, based on what it does in one specific language.
>>>
>>> Because there are some things that such refer
Nagy László Zsolt wrote:
>
>>> Yes, and more. That property will also have a get method! Is it
>>> intentional?
>> It's a logical effect of how the setter() method works. The above is
>> syntactic sugar for
>>
>> def set_parent(...):
>>...
>> set_parent = parent.setter(set_parent)
>>
>> and p
Op 09-06-16 om 09:36 schreef Steven D'Aprano:
> On Wednesday 08 June 2016 19:41, Antoon Pardon wrote:
>
>>> What you seem to be describing is similar to reference parameter semantics
>>> from Pascal. Assignment doesn't work that way in C, or Python.
>> I disagree. In python the assignment does work
Nagy László Zsolt wrote:
> I would like to create a collections.UserList subclass that can notify
> others when the list is mutated. I'm not sure which methods I need to
> override. I have checked the sources, and it seems difficult to figure
> out which methods needs to be overriden. For example,
Antoon Pardon :
> Op 08-06-16 om 18:37 schreef Marko Rauhamaa:
>> I see Python as doing the exact same thing with variables as C.
>>
>> What is different is that in Python, every expression evaluates to a
>> pointer. Thus, you can only assign pointers to variables.
>
> Then you think wrong. Python
>> Yes, and more. That property will also have a get method! Is it
>> intentional?
> It's a logical effect of how the setter() method works. The above is
> syntactic sugar for
>
> def set_parent(...):
>...
> set_parent = parent.setter(set_parent)
>
> and parent.setter() creates a new property
On 09/06/2016 08:50, Antoon Pardon wrote:
Op 08-06-16 om 19:29 schreef BartC:
I don't see why we should determine what a /proper/ reference
can do, based on what it does in one specific language.
Because there are some things that such references can do that Python
can't do with its object re
Hi,
I would like to create a collections.UserList subclass that can notify
others when the list is mutated. I'm not sure which methods I need to
override. I have checked the sources, and it seems difficult to figure
out which methods needs to be overriden. For example,
MutableSequence.extend i
Nagy László Zsolt wrote:
>
>>> @parent.setter
>>> def set_parent(self, new_parent):
>>> self._parent = new_parent
>> This creates a settable property with the name "set_parent" and leaves
>> the read-only property "parent" alone.
> Yes, and more. That property will also have a ge
>> @parent.setter
>> def set_parent(self, new_parent):
>> self._parent = new_parent
> This creates a settable property with the name "set_parent" and leaves the
> read-only property "parent" alone.
Yes, and more. That property will also have a get method! Is it intentional?
--
h
On Thursday 09 June 2016 10:34, Lawrence D’Oliveiro wrote:
> In my undergraduate Comp Sci classes, we used to discuss arbitrary rules like
> limiting functions to n lines. With real-world experience, it soon became
> clear that such rules were a waste of time. A function should be just as big
> as
Nagy László Zsolt wrote:
> class Test:
> def __init__(self):
> self._parent = None
>
> @property
> def parent(self):
> return self._parent
>
> @parent.setter
> def set_parent(self, new_parent):
> self._parent = new_parent
>
>
> p, c = Test(), Test()
On Thursday 09 June 2016 17:28, Nagy László Zsolt wrote:
> class Test:
Are you using Python 3 or 2? In Python 2, property doesn't work correctly with
classes unless they inherit from object (directly or indirectly).
> def __init__(self):
> self._parent = None
>
> @property
>
Op 08-06-16 om 19:29 schreef BartC:
> I don't see why we should determine what a /proper/ reference
>> can do, based on what it does in one specific language.
>
> Because there are some things that such references can do that Python
> can't do with its object reference model, not without some diffi
On Thursday, June 9, 2016 at 8:28:47 AM UTC+1, Nagy László Zsolt wrote:
> class Test:
> def __init__(self):
> self._parent = None
>
> @property
> def parent(self):
> return self._parent
>
> @parent.setter
> def set_parent(self, new_parent):
> self._pare
On Wednesday 08 June 2016 19:41, Antoon Pardon wrote:
>> What you seem to be describing is similar to reference parameter semantics
>> from Pascal. Assignment doesn't work that way in C, or Python.
>
> I disagree. In python the assignment does work similar to the reference
> parameter semantics i
Op 08-06-16 om 18:37 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> You can do something like that in simula, but only because
>> simula has two kinds of assignments. One kind that is
>> simular to python and one that is similar to C.
>> The one that is similar that python is the reference assignme
class Test:
def __init__(self):
self._parent = None
@property
def parent(self):
return self._parent
@parent.setter
def set_parent(self, new_parent):
self._parent = new_parent
p, c = Test(), Test()
c.parent = p
>py -3 test.py
Traceback (most recent c
iMath writes:
> ?I am planning design an encrypted time-limited API on both Client and Server
> sides, the server side is written in Django, the client side is a GUI program
> which call the API by
> import requests
> c = requests.post("http://127.0.0.1:8000/VideoParser/";, data={'videoUrl':
>
73 matches
Mail list logo