The book Learn Python Quickly is FREE today March 18th

2013-03-18 Thread John Rowland
It's free today (only) to download from Amazon. Please go to www.learnpythonquickly.com for more info. -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/

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

2013-03-18 Thread Steven D'Aprano
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 manipulated from within a Python program as the variable sys.path. Instead

Re: Message passing syntax for objects

2013-03-18 Thread Tim Harig
On 2013-03-18, Mark Janssen dreamingforw...@gmail.com 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

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

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 fr...@chagford.com 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

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 pengyu...@gmail.com 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.

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 fr...@chagford.com 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

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 fr...@chagford.com 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

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 fr...@chagford.com 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

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

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

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

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

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 laxmikant.gene...@gmail.com wrote: moduleName = 'mymodule'#These two variables are read from conf file. methodName = 'mymethod' import operator myModule = __import__('mymodule') myMethod = operator.methodcaller('mymethod') val =

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 steve+comp.lang.pyt...@pearwood.info 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

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 ros...@gmail.com wrote: On Tue, Mar 19, 2013 at 12:30 AM, Laxmikant Chitare laxmikant.gene...@gmail.com wrote: moduleName = 'mymodule'

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 conf file.

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 jeanmic...@sequans.com 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

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 laxmikant.gene...@gmail.com 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

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

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

2013-03-18 Thread Jussi Piitulainen
Santosh Kumar sntshkm...@gmail.com 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

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 sntshkm...@gmail.com 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

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 sntshkm...@gmail.com 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

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 two

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 == came_on:

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: return 'time not in

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 steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 18 Mar 2013 19:00:15

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

2013-03-18 Thread Duncan Booth
Jussi Piitulainen jpiit...@ling.helsinki.fi 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

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 mshro...@awaredigital.com 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

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): ... I'd still prefer to

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

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' elif

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 steve+comp.lang.pyt...@pearwood.info 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

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. --

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 da...@davea.name 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,

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 st...@pearwood.info 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

[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 stdin, line 1, in module File /usr/local/lib/python3.3/tkinter/__init__.py, line 40, in module

[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 dreamingforw...@gmail.com 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*

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 dreamingforw...@gmail.com wrote: Ian Cordasco wrote: On Sun, Mar 17, 2013 at 11:53 PM, Mark Janssen dreamingforw...@gmail.com wrote: Hello, I just posted an answers on quora.com about OOP (http://qr.ae/TM1Vb) and wanted to engage the python

Re: Excel column 256 limit

2013-03-18 Thread Michael Ross
On Mon, 18 Mar 2013 16:50:21 +0100, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

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 yoursurrogate...@gmail.comwrote: Hi. I'm having a problem trying to get this to work well. Basically, whenever I try to import tkinter, this is

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 st...@pearwood.info 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

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

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

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

2013-03-18 Thread Lele Gaifax
Yves S. Garret yoursurrogate...@gmail.com 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

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

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 yoursurrogate...@gmail.com 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,

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

2013-03-18 Thread Lele Gaifax
8 Dihedral dihedral88...@googlemail.com 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.

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 g.bra...@gmx.net 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

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 dreamingforw...@gmail.com wrote: On Mon, Mar 18, 2013 at 12:06 PM, Georg Brandl g.bra...@gmx.net 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

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

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

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 pengyu...@gmail.com 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

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 corresponding .py file as

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 as the

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 abarn...@yahoo.com 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

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 r...@panix.com 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

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 yo@gmail.com 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

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

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 upload it

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 nickzachara...@gmail.com 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

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 dreamingforw...@gmail.com Sent: Monday, March 18, 2013 4:41 PM On Mon, Mar 18, 2013 at 2:51 PM, Andrew Barnert abarn...@yahoo.com wrote: Have you even looked at a message-passing language? A Smalltalk message is a selector and a sequence of arguments. That's what

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

[issue17445] Return the type you accept

2013-03-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: Changing behavior that already matches the docs is an enhancement, not a bugfix, and one that will almost certainly break code. It is therefore one that would normally require a deprecation period. I think the most you should ask for is to skip the

[issue17452] ftplib raises exception if ssl module is not available

2013-03-18 Thread Russell Kackley
New submission from Russell Kackley: On a system with no ssl module the following test failure occurs: == ERROR: test_dir (test.test_ftplib.TestFTPClass) --

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-18 Thread Illia Polosukhin
Illia Polosukhin added the comment: I've worked on this with Dave Malcolm @PyCon2013 sprints. This patch is work in progress to make Py_XDECREF() and Py_XINCREF() expands their arguments once instead of multiple times. Because patch is work in progress, it contains old version for ease of

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-18 Thread Illia Polosukhin
Illia Polosukhin added the comment: Additionally, in macros Py_XINCREF and Py_XDECREF we've took an opportunity to increase readability by changing expression: if (item == NULL) ; else action(item); to more natural inverted condition: if (item != NULL) action(item); There is a chance that

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-18 Thread Illia Polosukhin
Illia Polosukhin added the comment: Benchmark run on Clang Mac OS X 10.7 attached of comparison with and without patch 17206.diff. -- Added file: http://bugs.python.org/file29440/perf.log ___ Python tracker rep...@bugs.python.org

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-18 Thread Illia Polosukhin
Illia Polosukhin added the comment: Command used for benchmarking was: python perf.py -b 2n3 -f ../cpython/baseline-clang/python.exe ../cpython/experiment-clang/python.exe | tee perf.log -- ___ Python tracker rep...@bugs.python.org

[issue3840] if TESTFN == /tmp/@test, some tests fail

2013-03-18 Thread R. David Murray
R. David Murray added the comment: To clarify Colin's comment (we worked on this at the sprints), in 2.7 and later regrtest no longer will generate a TESTFN that starts with /tmp in any circumstance, so that includes cygwin. (Instead regrtest creates a temporary directory in which the tests

[issue17453] logging.config.fileConfig error

2013-03-18 Thread Hervé Coatanhay
New submission from Hervé Coatanhay: In python 2.7 this code works: import logging.config import StringIO a=[loggers] ... keys = root ... [logger_root] ... handlers = ... [formatters] ... keys = ... [handlers] ... keys = ... logging.config.fileConfig(StringIO.StringIO(a)) whereas in

[issue17450] Failed to build _sqlite3

2013-03-18 Thread Ezio Melotti
Ezio Melotti added the comment: The module is not needed (unless you are planning to use sqlite), so you can simply ignore the warning. See also http://docs.python.org/devguide/setup.html#build-dependencies. -- nosy: +ezio.melotti resolution: - invalid stage: - committed/rejected

[issue17454] ld_so_aix not used when linking c++ (scipy)

2013-03-18 Thread alef
New submission from alef: error: Command xlC_r xlC_r -bI:/pathp/to/lib/python2.7/config/python.exp unixccompiler.py at line 251 override linker[0] with self.compiler_cxx[0]. This is not true for AIX that uses the script ld_so_aix, and not xlC_r. -- assignee: eric.araujo

[issue17445] Return the type you accept

2013-03-18 Thread Nick Coghlan
Nick Coghlan added the comment: At a glance, this just looks like a bug in difflib - it should use different literals when handling bytes. (Given that difflib newline processing assumes ASCII compatibility, a latin-1 based decode/encode solution may also be viable). --

[issue2786] Names in traceback should have class names, if they're methods

2013-03-18 Thread Illia Polosukhin
Illia Polosukhin added the comment: Talked with David Murray (r.david.murray) at @pycon2013 sprints - will try to address this. -- nosy: +ilblackdragon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2786

[issue17452] ftplib raises exception if ssl module is not available

2013-03-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0842c5411ed6 by Giampaolo Rodola' in branch 'default': (issue 17452 / ftplib) fix TypeError occurring in case ssl module is not installed http://hg.python.org/cpython/rev/0842c5411ed6 -- nosy: +python-dev

[issue17452] ftplib raises exception if ssl module is not available

2013-03-18 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Fixed, thanks. -- assignee: - giampaolo.rodola resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17452

[issue17299] Test cPickle with real files

2013-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, yes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17299 ___ ___ Python-bugs-list mailing list

[issue17299] Test cPickle with real files

2013-03-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file29433/test_cpickle_fileio.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17299 ___

[issue17455] ImportError (xml.dom.minidom) in /usr/lib/python2.7/dist-packages/apport/report.py

2013-03-18 Thread Felix Matenaar
New submission from Felix Matenaar: We're getting the following exception in a custom testing framework using sqlalchemy. Our process is running several days and the exception seems to occurs unproducably during runtime, sometimes after a day and sometimes after a couple of hours. The same

[issue17310] Ctypes callbacks shows problem on Windows Python (64bit)

2013-03-18 Thread Matt Clarke
Matt Clarke added the comment: Hi Amaury. I have tried removing pack and using /Zp1, but it makes no difference. The size of callback_t and the one in C are 8 bytes. Thanks, Matt On 13 March 2013 13:19, Amaury Forgeot d'Arc rep...@bugs.python.org wrote: Amaury Forgeot d'Arc added the

[issue17397] ttk::themes missing from ttk.py

2013-03-18 Thread klappnase
klappnase added the comment: I am not familiar with python's test unit, but I tried my best. As far as I see there are three possibilities to invoke the function: * without pattern - return tuple with all themes * with pattern that matches one or more themes * with pattern that matches no

[issue17456] os.py (unexpected character)

2013-03-18 Thread Corto Nexus
New submission from Corto Nexus: In Python 3.3 (Windows 32bits) the lib os.py start with an uncommented letter 'r'. -- messages: 184446 nosy: corto.nexus priority: normal severity: normal status: open title: os.py (unexpected character) type: enhancement versions: Python 3.3

[issue17299] Test cPickle with real files

2013-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Benjamin has fixed this in the changeset 6aab72424063. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17299

[issue17456] os.py (unexpected character)

2013-03-18 Thread Ezio Melotti
Ezio Melotti added the comment: os.py starts with: rOS routines for Mac, NT, or Posix depending on what system we're on. [...] Do you see only the 'r'? -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org

[issue17456] os.py (unexpected character)

2013-03-18 Thread Anuj Gupta
Anuj Gupta added the comment: http://docs.python.org/3/tutorial/introduction.html#strings This seems like a good opportunity for you to learn about raw strings. :) -- nosy: +anuj ___ Python tracker rep...@bugs.python.org

  1   2   3   >