Re: Message passing syntax for objects

2013-03-18 Thread Tim Harig
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

Just curious - I thought dict keys would maintain sequence

2013-03-18 Thread Frank Millman
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

Re: Just curious - I thought dict keys would maintain sequence

2013-03-18 Thread Chris Angelico
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

Re: How to add the current dir to sys.path when calling a python file?

2013-03-18 Thread rusi
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

Re: Just curious - I thought dict keys would maintain sequence

2013-03-18 Thread Frank Millman
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

Re: Just curious - I thought dict keys would maintain sequence

2013-03-18 Thread Peter Otten
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

Re: Just curious - I thought dict keys would maintain sequence

2013-03-18 Thread Steven D'Aprano
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

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread Shane Green
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:

Read utf-8 file

2013-03-18 Thread moonhkt
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

Re: Read utf-8 file

2013-03-18 Thread Peter Otten
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

Re: How to add the current dir to sys.path when calling a python file?

2013-03-18 Thread Dave Angel
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

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-18 Thread Dave Angel
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.

"Learn Python Quickly" is FREE today March 18th

2013-03-18 Thread John Rowland
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

"eval vs operator.methodcaller" - which is better?

2013-03-18 Thread Laxmikant Chitare
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

Re: "eval vs operator.methodcaller" - which is better?

2013-03-18 Thread Chris Angelico
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

Re: How to add the current dir to sys.path when calling a python file?

2013-03-18 Thread Peng Yu
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

Re: "eval vs operator.methodcaller" - which is better?

2013-03-18 Thread Laxmikant Chitare
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

Re: "eval vs operator.methodcaller" - which is better?

2013-03-18 Thread Jean-Michel Pichavant
- 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

Re: "eval vs operator.methodcaller" - which is better?

2013-03-18 Thread Chris Angelico
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 -

Re: "eval vs operator.methodcaller" - which is better?

2013-03-18 Thread Chris Angelico
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

Re: What's the easiest Python datagrid GUI (preferably with easy database hooks as well)?

2013-03-18 Thread Sibylle Koczian
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

Re: What are some other way to rewrite this if block?

2013-03-18 Thread Jussi Piitulainen
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

Re: What are some other way to rewrite this if block?

2013-03-18 Thread Chris Angelico
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' >

Re: What are some other way to rewrite this if block?

2013-03-18 Thread Laxmikant Chitare
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

Re: "eval vs operator.methodcaller" - which is better?

2013-03-18 Thread Steven D'Aprano
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

Re: "eval vs operator.methodcaller" - which is better?

2013-03-18 Thread Steven D'Aprano
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

Re: What are some other way to rewrite this if block?

2013-03-18 Thread Jean-Michel Pichavant
- 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

Re: What are some other way to rewrite this if block?

2013-03-18 Thread Yves S. Garret
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

Re: "eval vs operator.methodcaller" - which is better?

2013-03-18 Thread Laxmikant Chitare
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

Re: What are some other way to rewrite this if block?

2013-03-18 Thread Duncan Booth
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

Re: How to automatically get the indent level from code?

2013-03-18 Thread Peng Yu
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

Re: What are some other way to rewrite this if block?

2013-03-18 Thread Jussi Piitulainen
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): >

Re: What are some other way to rewrite this if block?

2013-03-18 Thread Steven D'Aprano
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

Re: What are some other way to rewrite this if block?

2013-03-18 Thread Steven D'Aprano
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'

Re: What are some other way to rewrite this if block?

2013-03-18 Thread Chris Angelico
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

Excel column 256 limit

2013-03-18 Thread 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. -- http://mail.python.org/mailman/listinfo/python-list

Re: Excel column 256 limit

2013-03-18 Thread Dave Angel
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

Re: Excel column 256 limit

2013-03-18 Thread Steven D'Aprano
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

Re: Excel column 256 limit

2013-03-18 Thread Grant Edwards
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

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread Mark Janssen
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

[Python 3.3.0] Getting tkinter to work on Python 3

2013-03-18 Thread Yves S. Garret
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

[Python-ideas] Message passing syntax for objects

2013-03-18 Thread Mark Janssen
> 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

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread Benjamin Kaplan
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

Re: Excel column 256 limit

2013-03-18 Thread Michael Ross
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

Re: [Python 3.3.0] Getting tkinter to work on Python 3

2013-03-18 Thread Ritchie Flick
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: >

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread 88888 Dihedral
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

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread Mark Janssen
> 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

Re: [Python 3.3.0] Getting tkinter to work on Python 3

2013-03-18 Thread Yves S. Garret
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

Re: [Python 3.3.0] Getting tkinter to work on Python 3

2013-03-18 Thread Lele Gaifax
"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

Re: Excel column 256 limit

2013-03-18 Thread 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 -- http://mail.python.org/mailman/listinfo/python-list

Re: Excel column 256 limit

2013-03-18 Thread Dietmar Schwertberger
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

Re: Excel column 256 limit

2013-03-18 Thread Christian Gollwitzer
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.

Re: What am I doing wrong in this simple tkinter example?

2013-03-18 Thread Chris Angelico
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

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread Lele Gaifax
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

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread Mark Janssen
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

Re: Pygame mouse cursor load/unload

2013-03-18 Thread Alex Gardner
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

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread Benjamin Kaplan
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

Writing Python framework for declarative checks?

2013-03-18 Thread Victor Hooi
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

The usage of -m option of python

2013-03-18 Thread Peng Yu
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

Re: The usage of -m option of python

2013-03-18 Thread Chris Angelico
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

Re: The usage of -m option of python

2013-03-18 Thread Modulok
>> 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

Re: Pygame mouse cursor load/unload

2013-03-18 Thread Alex Gardner
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

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread Mark Janssen
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

Re: Small program ideas

2013-03-18 Thread eli m
Any other ideas? -- http://mail.python.org/mailman/listinfo/python-list

Re: Small program ideas

2013-03-18 Thread Mark Lawrence
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

Re: What's the difference between these two uses of "for"?

2013-03-18 Thread alex23
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

Re: [Python 3.3.0] Getting tkinter to work on Python 3

2013-03-18 Thread Yves S. Garret
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

Problem this random seed()

2013-03-18 Thread NZach
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

Re: Problem this random seed()

2013-03-18 Thread eli m
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

How avoid installing directories match some pattern when using distutils.core setup?

2013-03-18 Thread Peng Yu
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

Re: Problem this random seed()

2013-03-18 Thread alex23
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

Re: The usage of -m option of python

2013-03-18 Thread Terry Reedy
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

Re: "Learn Python Quickly" is FREE today March 18th

2013-03-18 Thread Terry Reedy
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

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread Andrew Barnert
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

Re: [Python 3.3.0] Getting tkinter to work on Python 3

2013-03-18 Thread Terry Reedy
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