On 2013-03-18, Mark Janssen wrote:
> Alan Kay's idea of message-passing in Smalltalk are interesting, and
> like the questioner says, never took off. My answer was that Alan
> Kay's abstraction of "Everything is an object" fails because you can't
> have message-passing, an I/O task, working in th
Hi all
I know that you cannot rely on the order of keys in a dictionary, and I
am not attempting to do so.
Nevertheless, the following surprised me. A program creates a dictionary
with a known set of keys. I would have thought that multiple runs of the
program would return the keys in the sa
On Mon, Mar 18, 2013 at 6:26 PM, Frank Millman wrote:
> Hi all
>
> I know that you cannot rely on the order of keys in a dictionary, and I am
> not attempting to do so.
>
> Nevertheless, the following surprised me. A program creates a dictionary
> with a known set of keys. I would have thought tha
On Mar 18, 8:56 am, Peng Yu wrote:
> Hi,
>
> man python says "If a script argument is given, the directory
> containing the script is inserted in the path in front of $PYTHONPATH.
> The search path can be manipulated from within a Python program as
> the variable sys.path." Instead I want to
On 18/03/2013 09:31, Chris Angelico wrote:
On Mon, Mar 18, 2013 at 6:26 PM, Frank Millman wrote:
Hi all
I know that you cannot rely on the order of keys in a dictionary, and I am
not attempting to do so.
Nevertheless, the following surprised me. A program creates a dictionary
with a known set
Chris Angelico wrote:
> On Mon, Mar 18, 2013 at 6:26 PM, Frank Millman wrote:
>> Hi all
>>
>> I know that you cannot rely on the order of keys in a dictionary, and I
>> am not attempting to do so.
>>
>> Nevertheless, the following surprised me. A program creates a dictionary
>> with a known set o
On Mon, 18 Mar 2013 18:31:33 +1100, Chris Angelico wrote:
> On Mon, Mar 18, 2013 at 6:26 PM, Frank Millman
> wrote:
>> Hi all
>>
>> I know that you cannot rely on the order of keys in a dictionary, and I
>> am not attempting to do so.
>>
>> Nevertheless, the following surprised me. A program crea
So, by introducing this collaboration mechanism with a syntax that defines it
as sending and receiving things that are *not* arbitrary objects, the language
would naturally reinforce a more thoroughly decoupled architecture?
Sent from my iPad
On Mar 17, 2013, at 8:53 PM, Mark Janssen wrote:
File have China Made
中國 製
http://www.fileformat.info/info/unicode/char/4e2d/index.htm
UTF-16 (hex)0x4E2D (4e2d)
UTF-8 (hex) 0xE4 0xB8 0xAD (e4b8ad)
Read by od -cx utf_a.text
000 中 ** ** 國 ** ** 製 ** ** \n
e4b8ade59c8be8a3bd0a
012
Read by py
moonhkt wrote:
> How to display
> e4b8ad for 中 in python ?
Python 2
>>> print u"中".encode("utf-8").encode("hex")
e4b8ad
Python 3
>>> print(binascii.b2a_hex("中".encode("utf-8")).decode("ascii"))
e4b8ad
--
http://mail.python.org/mailman/listinfo/python-list
On 03/17/2013 11:56 PM, Peng Yu wrote:
Hi,
man python says "If a script argument is given, the directory
containing the script is inserted in the path in front of $PYTHONPATH.
The search path can be manipulated from within a Python program as
the variable sys.path." Instead I want to have t
On 03/17/2013 10:14 PM, Yves S. Garret wrote:
I don't get why it's posting what I said twice...
Because you're using googlegroups, and haven't unchecked some poorly
defined default setting. You're posting both to python-list and to
comp.lang.python, each of which is mirrored to the other.
For just today, the book "Learn Python Quickly" is free to download from Amazon.
Also, go to www.learnpythonquickly.com for more information.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I have a program that picks module and method name from a
configuration file and executes the method. I have found two ways to
achieve this.
Apporach 1:
---
moduleName = 'mymodule'#These two variables are read from conf file.
methodName = 'mymethod'
import operato
On Tue, Mar 19, 2013 at 12:30 AM, Laxmikant Chitare
wrote:
> moduleName = 'mymodule'#These two variables are read from conf file.
> methodName = 'mymethod'
>
> import operator
> myModule = __import__('mymodule')
> myMethod = operator.methodcaller('mymethod')
> val = myMethod(myModule)
> print
On Mon, Mar 18, 2013 at 1:54 AM, Steven D'Aprano
wrote:
> On Sun, 17 Mar 2013 22:56:07 -0500, Peng Yu wrote:
>
>> Hi,
>>
>> man python says "If a script argument is given, the directory
>> containing the script is inserted in the path in front of $PYTHONPATH.
>> The search path can be manipula
Aha, that was smart Chris. Thank you.
But this raises another question in my mind. What is the use case for
operator.methodcaller ?
On 3/18/13, Chris Angelico wrote:
> On Tue, Mar 19, 2013 at 12:30 AM, Laxmikant Chitare
> wrote:
>> moduleName = 'mymodule'#These two variables are read from c
- Original Message -
> Hi,
>
> I have a program that picks module and method name from a
> configuration file and executes the method. I have found two ways to
> achieve this.
>
> Apporach 1:
> ---
> moduleName = 'mymodule'#These two variables are read from con
On Tue, Mar 19, 2013 at 12:58 AM, Jean-Michel Pichavant
wrote:
> myFunc = getattr(myModule, methodName)
Doh! Thanks. I knew there was a shorter way of spelling it, rather
than digging with dunder methods. That's the way I would recommend -
slight tweak from the __getattribute__ version.
ChrisA
-
On Tue, Mar 19, 2013 at 12:58 AM, Laxmikant Chitare
wrote:
> Aha, that was smart Chris. Thank you.
>
> But this raises another question in my mind. What is the use case for
> operator.methodcaller ?
Most of the operator module is functional versions of what can be done
elsewhere with operators. T
Am 17.03.2013 16:50, schrieb rusi:
About your python I cant say, but your English looks/sounds as good as
a native's.
So dont waste your time getting that right; its good enough!
Thank you. Flowers go to Dorothy L. Sayers, most of them. As far as Dabo
is concerned, at the moment I just have to
Santosh Kumar writes:
> This simple script is about a public transport, here is the code:
>
> def report_status(should_be_on, came_on):
> if should_be_on < 0.0 or should_be_on > 24.0 or came_on < 0.0 or
> came_on > 24.0:
> return 'time not in range'
> elif should_be_on == came_on
On Tue, Mar 19, 2013 at 12:56 AM, Santosh Kumar wrote:
> This simple script is about a public transport, here is the code:
>
> def report_status(should_be_on, came_on):
> if should_be_on < 0.0 or should_be_on > 24.0 or came_on < 0.0 or
> came_on > 24.0:
> return 'time not in range'
>
What about this one:
if 0.0 < should_be_on > 24.0 or 0.0 < came_on > 24.0:
Regards,
Laxmikant
On 3/18/13, Santosh Kumar wrote:
> This simple script is about a public transport, here is the code:
>
> def report_status(should_be_on, came_on):
> if should_be_on < 0.0 or should_be_on > 24.0 or c
On Mon, 18 Mar 2013 19:28:37 +0530, Laxmikant Chitare wrote:
> Aha, that was smart Chris. Thank you.
>
> But this raises another question in my mind. What is the use case for
> operator.methodcaller ?
The use-case is mostly to allow people to write code in a functional
style, if they so choose
On Mon, 18 Mar 2013 19:00:15 +0530, Laxmikant Chitare wrote:
> Hi,
>
> I have a program that picks module and method name from a configuration
> file and executes the method. I have found two ways to achieve this.
>
> Apporach 1:
> ---
> moduleName = 'mymodule'#These
- Original Message -
> This simple script is about a public transport, here is the code:
>
> def report_status(should_be_on, came_on):
> if should_be_on < 0.0 or should_be_on > 24.0 or came_on < 0.0 or
> came_on > 24.0:
> return 'time not in range'
> elif should_be_on == ca
On Monday, March 18, 2013 9:56:16 AM UTC-4, Santosh Kumar wrote:
> This simple script is about a public transport, here is the code:
>
>
>
> def report_status(should_be_on, came_on):
>
> if should_be_on < 0.0 or should_be_on > 24.0 or came_on < 0.0 or
>
> came_on > 24.0:
>
> retur
Thank you Chris, Michel and Steven for your feedback.
Steven, yes I realised that the examples are faulty. I intended to use
variables instead of string literals. I will be careful next time.
On 3/18/13, Steven D'Aprano wrote:
> On Mon, 18 Mar 2013 19:00:15 +0530, Laxmikant Chitare wrote:
>
>> H
Jussi Piitulainen wrote:
>> Any tips are welcome.
>
> A double tip:
>
> if (not (0.0 <= should_be_on <= 24.0) or
> not (0.0 <= came_on <= 24.0)):
>...
>
Or even:
if not (0.0 <= should_be_on <= 24.0 and 0.0 <= came_on <= 24.0):
...
> You might want to raise an exception fr
On Sun, Mar 17, 2013 at 1:23 AM, Mark Shroyer wrote:
> I realize this isn't yet precisely what you're asking for, but look at the
> inspect and ast modules:
>
> import ast, inspect
>
> def indent_level():
> lineno = inspect.currentframe().f_back.f_lineno
>
> with open(__fi
Duncan Booth writes:
> Jussi Piitulainen wrote:
>
> >> Any tips are welcome.
> >
> > A double tip:
> >
> > if (not (0.0 <= should_be_on <= 24.0) or
> > not (0.0 <= came_on <= 24.0)):
> >...
> >
> Or even:
>
> if not (0.0 <= should_be_on <= 24.0 and 0.0 <= came_on <= 24.0):
>
On Mon, 18 Mar 2013 15:32:03 +0100, Jean-Michel Pichavant wrote:
> You can remove the 'if' line, report_status asks for hours, the caller
> is supposed to provide valid hours. What if the caller gives you
> strings, integer, floats ? This is a never ending story.
I see you haven't been a program
On Mon, 18 Mar 2013 19:26:16 +0530, Santosh Kumar wrote:
> This simple script is about a public transport, here is the code:
>
> def report_status(should_be_on, came_on):
> if should_be_on < 0.0 or should_be_on > 24.0 or came_on < 0.0 or
> came_on > 24.0:
> return 'time not in range'
On Tue, Mar 19, 2013 at 2:10 AM, Steven D'Aprano
wrote:
> A third weakness is that you can't allow for arrivals more than 12 hours
> early or late.
Oh, but that'll NEVER happen.
Oh wait, I've been on a service that was 12 hours late.
Is there any chance that you could do your times of arrival a
Is there some way to go around this limit? I need to import data from python to
excel and I need 1440 columns for that.
--
http://mail.python.org/mailman/listinfo/python-list
On 03/18/2013 11:28 AM, Ana Dionísio wrote:
Is there some way to go around this limit? I need to import data from python to
excel and I need 1440 columns for that.
Doesn't sound like a Python question. But one answer is Libre Office
Calc, which seems to have a 1024 column limit.
--
DaveA
On Mon, 18 Mar 2013 08:28:46 -0700, Ana Dionísio wrote:
> Is there some way to go around this limit? I need to import data from
> python to excel and I need 1440 columns for that.
That's an Excel question, it has nothing to do with Python.
Have you considered using something other than Excel? As
On 2013-03-18, Dave Angel wrote:
> On 03/18/2013 11:28 AM, Ana Dion?sio wrote:
>
>> Is there some way to go around this limit? I need to import data from
>> python to excel and I need 1440 columns for that.
>
> Doesn't sound like a Python question. But one answer is Libre Office
> Calc, which se
On Sun, Mar 17, 2013 at 11:46 PM, Steven D'Aprano wrote:
> I am very interested in this as a concept, although I must admit I'm not
> entirely sure what you mean by it. I've read your comment on the link above,
> and subsequent emails in this thread, and I'm afraid I don't understand what
> you me
Hi. I'm having a problem trying to get this to work well. Basically,
whenever I try to
import tkinter, this is the issue that I have:
>>> import tkinter
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.3/tkinter/__init__.py", line 40, in
import _tkint
> Ian Cordasco wrote:
>>
>> On Sun, Mar 17, 2013 at 11:53 PM, Mark Janssen
>> wrote:
>>
>>> Hello,
>>>
>>> I just posted an answers on quora.com about OOP (http://qr.ae/TM1Vb)
>>> and wanted to engage the python community on the subject.
>
>
> My answer to that question would be that it *did*
> ca
On Mon, Mar 18, 2013 at 10:18 AM, Mark Janssen
wrote:
>> Ian Cordasco wrote:
>>>
>>> On Sun, Mar 17, 2013 at 11:53 PM, Mark Janssen
>>> wrote:
>>>
Hello,
I just posted an answers on quora.com about OOP (http://qr.ae/TM1Vb)
and wanted to engage the python community on the subje
On Mon, 18 Mar 2013 16:50:21 +0100, Steven D'Aprano
wrote:
On Mon, 18 Mar 2013 08:28:46 -0700, Ana Dionísio wrote:
Is there some way to go around this limit? I need to import data from
python to excel and I need 1440 columns for that.
That's an Excel question, it has nothing to do with Py
Seems tkinter is missing in standard installation in ubuntu. Try:
sudo apt-get install python3-tk
On Mon, Mar 18, 2013 at 6:17 PM, Yves S. Garret
wrote:
> Hi. I'm having a problem trying to get this to work well. Basically,
> whenever I try to
> import tkinter, this is the issue that I have:
>
zipher於 2013年3月19日星期二UTC+8上午1時04分36秒寫道:
> On Sun, Mar 17, 2013 at 11:46 PM, Steven D'Aprano wrote:
>
> > I am very interested in this as a concept, although I must admit I'm not
>
> > entirely sure what you mean by it. I've read your comment on the link above,
>
> > and subsequent emails in thi
> You're dreaming of a utopia where computers just read our minds and
> know what we're thinking. So what if I can pass 42 into an object.
> What do I intend to happen with that 42? Do I want to add the element
> to a list? Access the 42nd element? Delete the 42nd element? Let the
> object pick a b
I have. This is what I did and the result that I'm seeing.
$ sudo apt-get install python3-tk
[sudo] password for ysg:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-tk is already the newest version.
python3-tk set to manually installed.
0 upgraded
"Yves S. Garret" writes:
> I have. This is what I did and the result that I'm seeing.
>
> $ sudo apt-get install python3-tk
You installed a "custom" python 3.3, didn't you? So it does not help
installing Ubuntu's python3-tk: your python3.3 interpreter won't even
look into "system" packages.
Mo
But I still get the error and I use Excel 2010.
I'm trying to export data in a list to Excel
--
http://mail.python.org/mailman/listinfo/python-list
Am 18.03.2013 16:28, schrieb Ana Dionísio:
Is there some way to go around this limit? I need to import data from python to
excel and I need 1440 columns for that.
There are many versions of Excel. The recent ones can handle more than
256 columns. If your version doesn't, then Python won't help
Am 18.03.13 20:00, schrieb Ana Dionísio:
But I still get the error and I use Excel 2010.
I'm trying to export data in a list to Excel
Unless you tell *how exactly* do you export the data into excel format,
we probably can't help you. You could try to write a .csv ASCII file,
for instance.
On Sun, Mar 17, 2013 at 2:34 AM, Yves S. Garret
wrote:
> *facepalm*
>
> Yep, I see it :) . Thanks for your help.
Glad to be of service. Welcome to a life of programming, where the
palm meets the face on a regular basis... more frequently if you use
Microsoft Windows, tar, non-eight-bit-clean tra
8 Dihedral writes:
> zipher於 2013年3月19日星期二UTC+8上午1時04分36秒寫道:
>> the key conceptual shift is that by enforcing a syntax that moves
>> away from invoking methods and move to message passing between
>> objects, you're automatically enforcing a more modular approach.
>
> Please check object pasca
On Mon, Mar 18, 2013 at 12:06 PM, Georg Brandl wrote:
> Am 18.03.2013 05:26, schrieb Mark Janssen:
>> Continuing on this thread, there would be a new bunch of behaviors to
>> be defined. Since "everything is an object", there can now be a
>> standard way to define the *next* common abstraction of
On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote:
> I am in the process of making a pong game in python using the pygame library.
> My current problem is that when I move the mouse, it turns off as soon as
> the mouse stops moving. The way I am doing this is by making the default
On Mon, Mar 18, 2013 at 1:24 PM, Mark Janssen wrote:
> On Mon, Mar 18, 2013 at 12:06 PM, Georg Brandl wrote:
>> Am 18.03.2013 05:26, schrieb Mark Janssen:
>>> Continuing on this thread, there would be a new bunch of behaviors to
>>> be defined. Since "everything is an object", there can now be a
HI,
NB: I've posted this question on Reddit as well (but didn't get many responses
from Pythonistas) - hope it's ok if I post here as well.
We currently use a collection of custom Python scripts to validate various
things in our production environment/configuration.
Many of these are simple XM
Hi,
I don't quite understand how -m option is used. And it is difficult to
search for -m in google. Could anybody provide me with an example on
how to use this option? Thanks!
-m module-name
Searches sys.path for the named module and runs the
corresponding .py file as a scrip
On Tue, Mar 19, 2013 at 8:17 AM, Peng Yu wrote:
> Hi,
>
> I don't quite understand how -m option is used. And it is difficult to
> search for -m in google. Could anybody provide me with an example on
> how to use this option? Thanks!
>
>-m module-name
> Searches sys.path for
>> Hi,
>>
>> I don't quite understand how -m option is used. And it is difficult to
>> search for -m in google. Could anybody provide me with an example on
>> how to use this option? Thanks!
>>
>>-m module-name
>> Searches sys.path for the named module and runs the
>> correspo
On Monday, March 18, 2013 3:24:57 PM UTC-5, Alex Gardner wrote:
> On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote:
>
> > I am in the process of making a pong game in python using the pygame
> > library. My current problem is that when I move the mouse, it turns off as
> > soon a
On Mon, Mar 18, 2013 at 2:51 PM, Andrew Barnert wrote:
> Have you even looked at a message-passing language?
>
> A Smalltalk "message" is a selector and a sequence of arguments. That's what
> you send around. Newer dynamic-typed message-passing OO and actor languages
> are basically the same as
Any other ideas?
--
http://mail.python.org/mailman/listinfo/python-list
On 18/03/2013 23:51, eli m wrote:
Any other ideas?
How about coming up with a new message passing syntax for objects? I
understand from recent postings that this should be fairly easy :)
--
Cheers.
Mark Lawrence
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 18, 12:33 pm, Roy Smith wrote:
> Google's motto may be "don't be evil", but they get to define what evil
> is. Apparently working and playing well with mailing list technology
> which has worked just fine for literally decades isn't part of the
> definition.
Their decision to scrap Reader
On Monday, March 18, 2013 2:39:57 PM UTC-4, Lele Gaifax wrote:
> "Yves S. Garret" writes:
>
> > I have. This is what I did and the result that I'm seeing.
> >
> > $ sudo apt-get install python3-tk
>
> You installed a "custom" python 3.3, didn't you? So it does not help
> installing Ubuntu's pyt
Hello everyone,
i am using the MMK.py example from a SimPy tutorial, which can be found here:
http://heather.cs.ucdavis.edu/~matloff/156/PLN/DESimIntro.pdf
I have made very little changes to the code and i have upload it here:
http://codeviewer.org/view/code:30d3
The problem is that i am execut
On Monday, March 18, 2013 6:57:30 PM UTC-7, NZach wrote:
> Hello everyone,
>
>
>
> i am using the MMK.py example from a SimPy tutorial, which can be found here:
> http://heather.cs.ucdavis.edu/~matloff/156/PLN/DESimIntro.pdf
>
>
>
> I have made very little changes to the code and i have uplo
Hi,
By default, setup.py will install everything in the source directory.
I want mask some directories so that they will not be installed. Is
there a way to do so in setup.py?
--
Regards,
Peng
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 19, 11:57 am, NZach wrote:
> The problem is that i am executing the main() function in lines 83 and 90,
> but
> i do not receive the same result, although the random seed is used in the G
> class.
>
> Any idea please, how can i solve it ?
The seed is used to create a Random instance at
On 3/18/2013 5:17 PM, Peng Yu wrote:
Hi,
I don't quite understand how -m option is used. And it is difficult to
search for -m in google. Could anybody provide me with an example on
how to use this option?
python -m test
at a command line runs the regression tests in the test package
python -m
On 3/18/2013 8:55 AM, John Rowland wrote:
For just today, the book "Learn Python Quickly" is free to download
from Amazon. Also, go to www.learnpythonquickly.com for more
information.
I just 'bought' this to see if it is something I would recommend. I
turned first to the IDLE section. A couple
From: Mark Janssen
Sent: Monday, March 18, 2013 4:41 PM
> On Mon, Mar 18, 2013 at 2:51 PM, Andrew Barnert
> wrote:
>> Have you even looked at a message-passing language?
>>
>> A Smalltalk "message" is a selector and a sequence of arguments.
> That's what you send around. Newer dynamic-typ
On 3/18/2013 9:52 PM, Yves S. Garret wrote:
Ok, it now seems to work. Weird. I had tk-dev installed (it seems)
and then after I re-compiled my interpreter just now, it's working.
If your previous compilation was before tk-dev was installed, it will
not have compiled _tkinter properly. On PC
75 matches
Mail list logo