Been using emacs for over 20 years and teaching python for 10.
And getting fed up that my audience looks at me like Rip van Winkle
each time I start up emacs...
So trying out Idle...
Some specific and some general questions:
My audience consists of people having linux and windows and macbooks.
Do
I am using zero-mq for IPC between two machines.
My zmq function is given below
def recieve_messages(self):
string = self.sub_socket.recv(flags=zmq.NOBLOCK)
print('flow mod messages recieved {}'.format(string))
When I run the program however I get the following err
On Thu, Oct 9, 2014 at 4:39 PM, Rustom Mody wrote:
> On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote:
>> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote:
>
>> Color.Red
>> print (Color.Red)
>> > Color.Red
>> > # Not sure what to make of that distinction...
On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote:
> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote:
> Color.Red
> print (Color.Red)
> > Color.Red
> > # Not sure what to make of that distinction...
> That's because the interactive interpreter displays the r
On Oct 8, 2014, at 9:57 PM, Gregory Ewing wrote:
> Seymore4Head wrote:
>> I want to toggle between color="Red" and color="Blue"
Don’t forget polymorphic dispatch…
class Red(object):
def toggle(self):
return Blue()
class Blue(object):
def toggle(self):
return Red()
B
Seymore4Head wrote:
I want to toggle between color="Red" and color="Blue"
toggle = {"Red": "Blue", "Blue": "Red"}
color = toggle[color]
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote:
Color.Red
>
print (Color.Red)
> Color.Red
>
> # Not sure what to make of that distinction...
That's because the interactive interpreter displays the repr() of objects
(except for None, which it suppresses), while print outputs th
On Thu, Oct 9, 2014 at 2:54 PM, wrote:
> On Wed, Oct 8, 2014, at 23:02, Mark Lawrence wrote:
>> When I first read this I was extremely jealous of the originator but
>> having used it umpteen times I'm still extremely jealous of the
>> originator!!! Why doesn't my mind work like his? :)
>
> You c
On Wed, Oct 8, 2014, at 23:02, Mark Lawrence wrote:
> When I first read this I was extremely jealous of the originator but
> having used it umpteen times I'm still extremely jealous of the
> originator!!! Why doesn't my mind work like his? :)
You could also keep the ints in two variables and do
On 09/10/2014 02:25, Mark Lawrence wrote:
On 09/10/2014 01:11, Seymore4Head wrote:
I want to toggle between color="Red" and color="Blue"
Here is one:
if color == "Red":
color = "Blue"
else:
color = "Red"
Here is two:
if x = "True" color = "Red"
else:
color="Blue"
x= n
On Thursday, October 9, 2014 7:12:41 AM UTC+5:30, Ben Finney wrote:
> Seymore4Head writes:
> > I want to toggle between color="Red" and color="Blue"
> It's good to cultivate ongoing familiarity with the standard library
And language. In recent python3:
>>> class Color(Enum):
... Red = 0
...
Seymore4Head writes:
> I want to toggle between color="Red" and color="Blue"
It's good to cultivate ongoing familiarity with the standard library
https://docs.python.org/3/library/itertools.html#itertools.cycle>
so that you can make use of wheels already invented and maintained::
import ite
On 10/8/14 5:49 PM, Ethan Furman wrote:
[redirecting back to the list]
On 10/08/2014 02:23 PM, random...@fastmail.us wrote:
On Wed, Oct 8, 2014, at 15:53, Ethan Furman wrote:
On 10/08/2014 12:49 PM, random...@fastmail.us wrote:
On Wed, Oct 8, 2014, at 15:38, Ethan Furman wrote:
LOL, no kidd
Seymore4Head wrote:
> I want to toggle between color="Red" and color="Blue"
> Here is one:
> if color == "Red":
> color = "Blue"
> else:
> color = "Red"
Apart from the horrible spelling of colour :-) that seems fine to me. You
might wish to include a comment:
# Assumes th
On 09/10/2014 01:11, Seymore4Head wrote:
I want to toggle between color="Red" and color="Blue"
Here is one:
if color == "Red":
color = "Blue"
else:
color = "Red"
Here is two:
if x = "True" color = "Red"
else:
color="Blue"
x= not x
Others?
Here http://stackoverflow.
Seymore4Head Wrote in message:
> I want to toggle between color="Red" and color="Blue"
> Here is one:
> if color == "Red":
> color = "Blue"
> else:
> color = "Red"
> Here is two:
> if x = "True" color = "Red"
> else:
> color="Blue"
> x= not x
>
> Others?
>
One looks like
I want to toggle between color="Red" and color="Blue"
Here is one:
if color == "Red":
color = "Blue"
else:
color = "Red"
Here is two:
if x = "True" color = "Red"
else:
color="Blue"
x= not x
Others?
--
https://mail.python.org/mailman/listinfo/python-list
On 10/08/2014 03:46 PM, Terry Reedy wrote:
On 10/8/2014 5:49 PM, Ethan Furman wrote:
[redirecting back to the list]
I'm not sure what situation you would have to type them (as opposed to
simply a + b) that the operator module would help with.
unittest springs to mind:
self.assertRaises
On 10/8/2014 5:49 PM, Ethan Furman wrote:
[redirecting back to the list]
I'm not sure what situation you would have to type them (as opposed to
simply a + b) that the operator module would help with.
unittest springs to mind:
self.assertRaises(TypeError, op.add, obj1, obj2)
Er, my poi
On Wed, Oct 8, 2014 at 4:53 AM, Gelonida N wrote:
> Hi,
>
>
> I just read about sys.meta_path, which allows to install custom importers
> *BEFORE* the default importers.
>
> However I have a use case where I would like to add a custom importer
> *AFTER* all other import methods have failed.
>
> Do
On Wed, Oct 8, 2014 at 3:30 PM, Chris Angelico wrote:
> >
> >
> > That doesn't always seem to have been the case, however.
> > In Python 2.7 and 3.3, I get
> >
> operator.add is operator.__add__
> > False
>
> Huh. So it is.
>
> rosuav@sikorsky:~$ python3
> Python 3.5.0a0 (default:301b9a58021
On Thu, Oct 9, 2014 at 8:37 AM, Gregory Ewing
wrote:
> Chris Angelico wrote:
>
> operator.add is operator.__add__
>>
>> True
>
>
> That doesn't always seem to have been the case, however.
> In Python 2.7 and 3.3, I get
>
operator.add is operator.__add__
> False
Huh. So it is.
rosuav@sik
virtualenv has the switch
--system-site-packages (including all system site pacgaes)
and the switch
--no-site-packages (to expclude all site packages)
Does anyone know an easy way to include just a few site-packages?
for example (PySide, but not PyQt)
The reason I'm asking is following.
Some si
random...@fastmail.us writes:
> On Wed, Oct 8, 2014, at 15:38, Ethan Furman wrote:
> > The main reason I bother using the operator module is for the
> > readability of not seeing the dunders, and the writability of not
> > having to type them.
>
> I'm not sure what situation you would have to type
On Wed, Oct 8, 2014 at 2:05 PM, Gelonida N wrote:
> On 10/8/2014 9:09 PM, Terry Reedy wrote:
>
>> On 10/8/2014 6:57 AM, Steven D'Aprano wrote:
>>
>> According to the documentation, operator.__add__ is the "official"
>>> function,
>>> and operator.add is just there for convenience.
>>>
>>
>> You
[redirecting back to the list]
On 10/08/2014 02:23 PM, random...@fastmail.us wrote:
On Wed, Oct 8, 2014, at 15:53, Ethan Furman wrote:
On 10/08/2014 12:49 PM, random...@fastmail.us wrote:
On Wed, Oct 8, 2014, at 15:38, Ethan Furman wrote:
LOL, no kidding! The main reason I bother using the
Chris Angelico wrote:
operator.add is operator.__add__
True
That doesn't always seem to have been the case, however.
In Python 2.7 and 3.3, I get
>>> operator.add is operator.__add__
False
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
jonathan.slend...@gmail.com wrote:
For each non-accepting state, determine whether it has
any transitions that lead in one or more steps to an accepting state.
Modify the FSM so that each such state is also an accepting state.
Thanks, I'll make every state of the FSM an accepting state.
Not
On Wed, Oct 8, 2014 at 3:05 PM, Gelonida N wrote:
> On 10/8/2014 9:09 PM, Terry Reedy wrote:
>>
>> On 10/8/2014 6:57 AM, Steven D'Aprano wrote:
>>
>>> According to the documentation, operator.__add__ is the "official"
>>> function,
>>> and operator.add is just there for convenience.
>>
>>
>> You a
On 10/8/2014 9:09 PM, Terry Reedy wrote:
On 10/8/2014 6:57 AM, Steven D'Aprano wrote:
According to the documentation, operator.__add__ is the "official"
function,
and operator.add is just there for convenience.
You are paraphrasing "The function names are those used for special
class methods;
On Wed, Oct 8, 2014, at 15:38, Ethan Furman wrote:
> LOL, no kidding! The main reason I bother using the operator module is
> for the readability of not seeing the dunders,
> and the writability of not having to type them.
I'm not sure what situation you would have to type them (as opposed to
On 10/08/2014 12:09 PM, Terry Reedy wrote:
On 10/8/2014 6:57 AM, Steven D'Aprano wrote:
According to the documentation, operator.__add__ is the "official" function,
and operator.add is just there for convenience.
You are paraphrasing "The function names are those used for special class
metho
On Wed, Oct 8, 2014 at 10:29 AM, George Trojan wrote:
> This does not look right:
>
> dilbert@gtrojan> python3.4
> Python 3.4.1 (default, Jul 7 2014, 15:47:25)
> [GCC 4.8.3 20140624 (Red Hat 4.8.3-1)] on linux
> Type "help", "copyright", "credits" or "license" for more information.
import nu
This does not look right:
dilbert@gtrojan> python3.4
Python 3.4.1 (default, Jul 7 2014, 15:47:25)
[GCC 4.8.3 20140624 (Red Hat 4.8.3-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> a=np.ma.array([0, 1], dtype=np.int8, mask=[1, 0])
>>
On 10/8/2014 6:57 AM, Steven D'Aprano wrote:
According to the documentation, operator.__add__ is the "official" function,
and operator.add is just there for convenience.
You are paraphrasing "The function names are those used for special
class methods; variants without leading and trailing __
Chris Angelico wrote:
> Sure, and that's all well and good. But what I just cited there *is* a
> shipping product. That's a live server that runs a game that I'm admin
> of. So it's possible to do without the resource safety net of periodic
> restarts.
Nice that the non-Python server you administe
On Wednesday, October 8, 2014 9:58:11 PM UTC+5:30, Skip Montanaro wrote:
> On Wed, Oct 8, 2014 at 11:14 AM, Rustom Mody wrote:
> > So pushing beginners away from print can push them up the learning
> > curve more quickly
> Or more quickly discourage them. I still use print for all sorts of
> thin
On Wed, Oct 8, 2014 at 11:14 AM, Rustom Mody wrote:
> So pushing beginners away from print can push them up the learning
> curve more quickly
Or more quickly discourage them. I still use print for all sorts of
things. In my opinion, there is often no need for fancy loggers,
str.format, or the wri
On Thu, Oct 9, 2014 at 3:14 AM, Rustom Mody wrote:
> The issue is not only that print is bad but that the interpreter is
> good for learning and trying out.
>
> Are these two really unconnected. Lets see... One can
>
> - use print without the interpreter
> - use the interpreter without print
> - u
On Tuesday, October 7, 2014 2:19:39 AM UTC+5:30, Steven D'Aprano wrote:
> I have fewer issues with your conclusion and analogy than I do with the
> basic premise that there is a connection between Seymore's problem here
> and the use, or non-use, of print in the interactive interpreter. I don't
On 2014-10-07, Seymore4Head wrote:
> I never really cared enough to ask anyone, but something like my cable
> bill is 98$ a month. Do companies (in general) consider a month every
> 30 days or every time the 14th comes around?
Either/both.
My pre-pay T-Mobile account is every $30 every 30 day
marco.naw...@colosso.nl wrote:
> For me it makes sense. operator.add should be used in a "global" context
> (I don't know how to express it otherwise). So you provide it with the
> two values that you want to add. The .__add__ variants are bound to a
> particular instance and you provide it with a
Hi,
I just read about sys.meta_path, which allows to install custom
importers *BEFORE* the default importers.
However I have a use case where I would like to add a custom importer
*AFTER* all other import methods have failed.
Does anybody know how to do this.
One way of implementing this
On 10/7/2014 1:01 PM, Ned Batchelder wrote:
On 10/7/14 2:10 AM, Gelonida N wrote:
Disadvantage of itertools.product() is, that it makes a copy in memory.
Reason ist, that itertools also makes products of generators (meaning of
objects, that one can't iterate several times through)
There are t
The end result of a confusing sentence with no
>
> context is that I have no idea what you are trying to say. Could you try
>
> explaining again please?
>
>
> Steven
No problem my reply from phone at work a little confusing.
So trying to determine what this does.
def ins_var
@ins_var ||
Here's another quick one -- under 30 secs. -- and then I'll revert to lurker
status. It's one of my favorites: "Veritas" wine & liquor search. (Teetotalers,
avert your eyes.)
http://youtu.be/jDtm4z7kqyI
Pal A.
--
https://mail.python.org/mailman/listinfo/python-list
random832 wrote on Tue Oct 7 22:33:23 CEST 2014
>On Tue, Oct 7, 2014, at 16:27, Michael Torrie wrote:
>>That's really interesting. I looked briefly at the page. How does your
python extension work with xywrite? Does it manipulate xywrite >>documents
>>or does it tie in at runtime with Xyw
(You didn't include any context in your post. Please quote as much
text as would be helpful; it's the easiest way to show what you're
talking about.)
On Wed, Oct 8, 2014 at 7:46 PM, wrote:
> For me it makes sense. operator.add should be used in a "global" context
> (I don't know how to express i
On behalf of the Python development community and the Python 3.4 release
team, I'm pleased to announce the availability of Python 3.4.2. Python
3.4.2 has many bugfixes and other small improvements over 3.4.1. One
new feature for Mac OS X users: the OS X installers are now distributed
as sig
For me it makes sense. operator.add should be used in a "global" context
(I don't know how to express it otherwise). So you provide it with the
two values that you want to add. The .__add__ variants are bound to a
particular instance and you provide it with a single value that you want
to add.
Y
Le mercredi 8 octobre 2014 01:40:11 UTC+2, MRAB a écrit :
> If you're not interested in generating an actual regex, but only in
>
> matching the prefix, then it sounds like you want "partial matching".
>
>
>
> The regex module supports that:
>
>
>
> https://pypi.python.org/pypi/regex
Wow, t
Peter Otten <__pete...@web.de> writes:
> >>> pattern = re.compile("(\d+)$")
> >>> match = pattern.search( "LINE: 235 : Primary Shelf Number (attempt 1): 1")
> >>> match.group()
> '1'
An alternative way to accomplish the above using the ‘match’ method::
>>> import re
>>> pattern = re.comp
52 matches
Mail list logo