[RELEASED] Python 3.3.0 beta 1

2012-06-27 Thread Georg Brandl
On behalf of the Python development team, I'm happy to announce the first beta release of Python 3.3.0. This is a preview release, and its use is not recommended in production settings. Python 3.3 includes a range of improvements of the 3.x series, as well as easier porting between 2.x and 3.x.

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Adam
John Nagle na...@animats.com wrote in message news:jse604$1cq$1...@dont-email.me... On 6/26/2012 9:12 PM, Adam wrote: Host OS:Ubuntu 10.04 LTS Guest OS:Windows XP Pro SP3 I am able to open port COM4 with Terminal emulator. So, what can cause PySerial to generate the following

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Christian Tismer
On 26.06.12 08:34, Stefan Behnel wrote: Devin Jeanpierre, 26.06.2012 08:15: On Mon, Jun 25, 2012 at 11:35 PM, Steven D'Aprano Making print a statement in the first place was a mistake, but fortunately it was a simple enough mistake to rectify once the need for backward compatibility was

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Chris Angelico
On Wed, Jun 27, 2012 at 8:25 PM, Christian Tismer tis...@stackless.com wrote: I think, for the small importance of the print statement in code, it would have made the transition easier, if python 3 was as flexible as python 2.7, with a symmetric from __past__ import print_statement construct.

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Stefan Behnel
Chris Angelico, 27.06.2012 13:02: On Wed, Jun 27, 2012 at 8:25 PM, Christian Tismer wrote: I think, for the small importance of the print statement in code, it would have made the transition easier, if python 3 was as flexible as python 2.7, with a symmetric from __past__ import

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Devin Jeanpierre
On Wed, Jun 27, 2012 at 7:02 AM, Chris Angelico ros...@gmail.com wrote: Much easier to simply say no. It's also easier to cease developing Python at all. By which I mean: just because something is hard doesn't mean it shouldn't be done. Lots of things Python does are hard, but they make users'

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Roy Smith
In article mailman.1503.1340677684.4697.python-l...@python.org, rantingrickjohn...@gmail.com wrote: On Monday, June 25, 2012 5:10:47 AM UTC-5, Michiel Overtoom wrote: It has not. Python2 and Python3 are very similar. It's not like if you learn Python using version 2, you have to relearn the

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Chris Angelico
On Wed, Jun 27, 2012 at 9:24 PM, Devin Jeanpierre jeanpierr...@gmail.com wrote: On Wed, Jun 27, 2012 at 7:02 AM, Chris Angelico ros...@gmail.com wrote: Much easier to simply say no. It's also easier to cease developing Python at all. By which I mean: just because something is hard doesn't

[newbie] problem with data (different behaviour between batch and interactive use)

2012-06-27 Thread Jean Dupont
I have some data which is presented in the following format to me: +3.874693E-01,+9.999889E-03,+9.91E+37,+1.876595E+04,+3.994000E+04 I'm only interested in the first two fields i.e. +3.874693E-01,+9.999889E-03 If I start python interactively I can separate the fields as follows:

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Paul
Adam wrote: John Nagle na...@animats.com wrote in message news:jse604$1cq$1...@dont-email.me... On 6/26/2012 9:12 PM, Adam wrote: Host OS:Ubuntu 10.04 LTS Guest OS:Windows XP Pro SP3 I am able to open port COM4 with Terminal emulator. So, what can cause PySerial to generate the

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread David H. Lipman
From: Adam adam@no_thanks.com John Nagle na...@animats.com wrote in message news:jse604$1cq$1...@dont-email.me... On 6/26/2012 9:12 PM, Adam wrote: Host OS:Ubuntu 10.04 LTS Guest OS:Windows XP Pro SP3 I am able to open port COM4 with Terminal emulator. So, what can cause PySerial

json.loads() should return a more specific error

2012-06-27 Thread Roy Smith
Before I go open an enhancement request, what do people think of the idea that json.load() should return something more specific than ValueError? I've got some code that looks like try: response = requests.get(url) except RequestException as ex: logger.exception(ex)

Re: [newbie] problem with data (different behaviour between batch and interactive use)

2012-06-27 Thread Jussi Piitulainen
Jean Dupont writes: If I start python interactively I can separate the fields as follows: measurement=+3.874693E01,+9.999889E03,+9.91E+37,+1.876[...] print measurement[0] 0.3874693 [...] The script does this: measurement=serkeith.readline().replace('\x11','').replace([...] print

cmd i/o stream module

2012-06-27 Thread prakash jp
Hi All, I am interested to interact with the command prompt, is there a module to control the input/output stream. Thanks in advance for the pointers Thanks Prakash -- http://mail.python.org/mailman/listinfo/python-list

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Christian Tismer
On 27.06.12 13:02, Chris Angelico wrote: On Wed, Jun 27, 2012 at 8:25 PM, Christian Tismer tis...@stackless.com wrote: I think, for the small importance of the print statement in code, it would have made the transition easier, if python 3 was as flexible as python 2.7, with a symmetric from

Re: tiffany 0.6 released

2012-06-27 Thread Christian Tismer
... Thanks for the adjustment. Now I'm feeling fine and will move on to other targets ;-) By the way: Our conversation seems to have a real effect on downloads. :-) It has been quite a boost since 20 hours from some 25-40 to now over 200. cheers -- chris -- Christian Tismer :^)

Re: [newbie] problem with data (different behaviour between batch and interactive use)

2012-06-27 Thread Cousin Stanley
Jean Dupont wrote: I have some data which is presented in the following format to me : +3.874693E-01,+9.999889E-03,+9.91E+37,+1.876595E+04,+3.994000E+04 I'm only interested in the first two fields i.e. +3.874693E-01,+9.999889E-03 The following program will read lines of

Re: tiffany 0.6 released

2012-06-27 Thread Christian Tismer
On 27.06.12 15:24, Christian Tismer wrote: ... Thanks for the adjustment. Now I'm feeling fine and will move on to other targets ;-) By the way: Our conversation seems to have a real effect on downloads. :-) It has been quite a boost since 20 hours from some 25-40 to now over 200. but it

Re: Python and Facebook

2012-06-27 Thread Jerry Rocteur
(Among our points are such diverse elements as... wrong Pythons, but whatever.) There's no official Python-Facebook module (afaik!!), but a quick web search for 'python facebook' should get you to the couple that I saw, and possibly others. The next question is, do you trust any

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Chris Angelico
On Wed, Jun 27, 2012 at 11:15 PM, Christian Tismer tis...@stackless.com wrote: So what I would have done is to let it work in an imperfect way. People then have the chance to rewrite with the print function, where it makes sense. But old packages which need to be changed, only because they

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Stefan Behnel
Christian Tismer, 27.06.2012 15:15: print, function or not, is not important enough to enforce a rewrite everywhere because of syntax error. That hides the real semantic changes which _are_ important. So what I would have done is to let it work in an imperfect way. People then have the

Re: [newbie] problem with data (different behaviour between batch and interactive use)

2012-06-27 Thread Justin Barber
When you are reading it in measurement is a string. The indicies of the string are going to be returned in your print statements. Similar to having done this in the interpreter: In [17]: measurement = '+3.874693E01,+9.999889E03,+9.91E+37,+1.876595E+04,+3.994000E+04' In [18]:

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Christian Tismer
On 27.06.12 15:44, Stefan Behnel wrote: Christian Tismer, 27.06.2012 15:15: print, function or not, is not important enough to enforce a rewrite everywhere because of syntax error. That hides the real semantic changes which _are_ important. So what I would have done is to let it work in an

2to6 ?

2012-06-27 Thread Thomas Heller
Is there a tool, similar to 2to3, which converts python2 code to code using six.py, so that it runs unchanged with python2 *and* python 3? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Grant Edwards
On 2012-06-27, David H. Lipman DLipman~nospam~@Verizon.Net wrote: From: Adam adam@no_thanks.com John Nagle na...@animats.com wrote in message news:jse604$1cq$1...@dont-email.me... On 6/26/2012 9:12 PM, Adam wrote: Host OS:Ubuntu 10.04 LTS Guest OS:Windows XP Pro SP3 I am able to

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Adam
Paul nos...@needed.com wrote in message news:jseu9c$sp3$1...@dont-email.me... Adam wrote: John Nagle na...@animats.com wrote in message news:jse604$1cq$1...@dont-email.me... On 6/26/2012 9:12 PM, Adam wrote: Host OS:Ubuntu 10.04 LTS Guest OS:Windows XP Pro SP3 I am able to open

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Paul
Adam wrote: Paul nos...@needed.com wrote in message news:jseu9c$sp3$1...@dont-email.me... Adam wrote: John Nagle na...@animats.com wrote in message news:jse604$1cq$1...@dont-email.me... On 6/26/2012 9:12 PM, Adam wrote: Host OS:Ubuntu 10.04 LTS Guest OS:Windows XP Pro SP3 I am able

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-27 Thread David Thomas
On Tuesday, June 26, 2012 10:48:22 PM UTC+1, Hans Mulder wrote: On 26/06/12 22:41:59, Dave Angel wrote: On 06/26/2012 03:16 PM, Hans Mulder wrote: SNIP Python is an executable, and is typically located in a bin directory. To find out where it is, type type python at the

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Adam
Paul nos...@needed.com wrote in message news:jsfatv$djt$1...@dont-email.me... Adam wrote: Paul nos...@needed.com wrote in message news:jseu9c$sp3$1...@dont-email.me... Adam wrote: John Nagle na...@animats.com wrote in message news:jse604$1cq$1...@dont-email.me... On 6/26/2012 9:12 PM,

Slow output

2012-06-27 Thread subhabangalore
Dear Group, I am Sri Subhabrata Banerjee writing from India. I am running a small program which exploits around 12 1 to 2 KB .txt files. I am using MS Windows XP Service Pack 3 and Python 2.6 where IDLE is GUI. The text is plain ASCII text. The RAM of the machine is around 2 GB. To run the

Re: json.loads() should return a more specific error

2012-06-27 Thread Terry Reedy
On 6/27/2012 8:45 AM, Roy Smith wrote: Before I go open an enhancement request, what do people think of the idea that json.load() should return something more specific than ValueError? I do not know of any written policy about when to create custom error classes in the stdlib. I know there

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Paul
Adam wrote: This is a tough one. Try handle -a allhand.txt Then open the allhand.txt with Notepad and look for interesting entries. *** I tested right now, and first opened a session in HyperTerminal with one of my USB to serial adapters. The second serial adapter, is connect to

Re: Slow output

2012-06-27 Thread MRAB
On 27/06/2012 18:33, subhabangal...@gmail.com wrote: Dear Group, I am Sri Subhabrata Banerjee writing from India. I am running a small program which exploits around 12 1 to 2 KB .txt files. I am using MS Windows XP Service Pack 3 and Python 2.6 where IDLE is GUI. The text is plain ASCII text.

Re: 2to6 ?

2012-06-27 Thread Terry Reedy
On 6/27/2012 10:36 AM, Thomas Heller wrote: Is there a tool, similar to 2to3, which converts python2 code to code using six.py, so that it runs unchanged with python2 *and* python 3? Others have expressed a similar wish, but I do not know that anyone has actually revised 2to3 to make a 2to6,

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-27 Thread Hans Mulder
On 27/06/12 19:05:44, David Thomas wrote: Is this why I keep getting an error using launcher? No. Yesterday your problem was that you tried this: input(\n\nPress the enter key to exit) That works fine in Pyhton3, but you are using python2 and in python2, the you must do this instead:

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Serhiy Storchaka
On 27.06.12 17:34, Christian Tismer wrote: That's why I was unhappy with py3's missing flexibility. Excessive flexibility is amorphism. -- http://mail.python.org/mailman/listinfo/python-list

Re: Slow output

2012-06-27 Thread Jean-Michel Pichavant
MRAB wrote: On 27/06/2012 18:33, subhabangal...@gmail.com wrote: Dear Group, I am Sri Subhabrata Banerjee writing from India. I am running a small program which exploits around 12 1 to 2 KB .txt files. I am using MS Windows XP Service Pack 3 and Python 2.6 where IDLE is GUI. The text is plain

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Serhiy Storchaka
On 27.06.12 14:22, Stefan Behnel wrote: For comparison, the revival of the u string prefix in Py3.3 is a simple change in the parser grammar that's easy to maintain but that has a huge impact on the Py3 compatibility of code that accepts to drop support for Py2.5 and earlier (as well as

Re: cmd i/o stream module

2012-06-27 Thread Temia Eszteri
[Default] On Wed, 27 Jun 2012 18:37:52 +0530, prakash jp prakash.st...@gmail.com wrote: Hi All, I am interested to interact with the command prompt, is there a module to control the input/output stream. Thanks in advance for the pointers Thanks Prakash Well, from the start, the sys module

ANN: psutil 0.5.0 released

2012-06-27 Thread Giampaolo Rodolà
Hi folks, I'm pleased to announce the 0.5.0 release of psutil: http://code.google.com/p/psutil/ === Major new features === - system users - (Linux, Windows) process CPU affinity (get and set) - (POSIX) process number of opened file descriptors. - (Windows) process number of opened handles. -

Py330b1, un café crème sucré

2012-06-27 Thread wxjmfauth
# -*- coding: cp1252 -*- # café.py import sys print(sys.version) sys.path.append('d:\\crème') import crème import sucré s = ' '.join(['un', 'café', crème.tag, sucré.tag]) print(s) input(':') #-- # .\sucré.py: # -*- coding: cp1252 -*- #tag = 'sucré' #-- # d:\crème\crème.py # -*-

Re: Slow output

2012-06-27 Thread Steven D'Aprano
On Wed, 27 Jun 2012 19:06:08 +0100, MRAB wrote: On 27/06/2012 18:33, subhabangal...@gmail.com wrote: Dear Group, I am Sri Subhabrata Banerjee writing from India. I am running a small program which exploits around 12 1 to 2 KB .txt files. I am using MS Windows XP Service Pack 3 and Python 2.6

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Adam
Paul nos...@needed.com wrote in message news:jsfhv2$ta9$1...@dont-email.me... Adam wrote: This is a tough one. Try handle -a allhand.txt Then open the allhand.txt with Notepad and look for interesting entries. *** I tested right now, and first opened a session in

Re: Py330b1, un café crème sucré

2012-06-27 Thread Karim
Euhhh, j'ai pas tout suivi. C'est quoi la feinte? Cheers Karim Le 27/06/2012 21:49, wxjmfa...@gmail.com a écrit : # -*- coding: cp1252 -*- # café.py import sys print(sys.version) sys.path.append('d:\\crème') import crème import sucré s = ' '.join(['un', 'café', crème.tag, sucré.tag])

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-27 Thread David Thomas
Thank you ever so much raw_input works fine. Do you think I should stick with Python 2 before I go to 3? I have a text book which is using 3 but I've been using an online tutorial which has been helping me lots, which uses version 2. I found by just typing python then having a space and

question about numpy, subclassing, and a DeprecationWarning

2012-06-27 Thread Jason Swails
Hello, I'm running into an unexpected issue in a program I'm writing, and I was hoping someone could provide some clarification for me. I'm trying to subclass numpy.ndarray (basically create a class to handle a 3D grid). When I instantiate a numpy.ndarray, everything works as expected. When I

Recommend decent Computer Science books

2012-06-27 Thread David Thomas
Hi I know that this is a group about Python. But I am just wondering if anybody can recommend any introductory/good books on Conputer Science. Kind regards -- http://mail.python.org/mailman/listinfo/python-list

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Terry Reedy
On 6/27/2012 3:08 PM, Serhiy Storchaka wrote: On 27.06.12 14:22, Stefan Behnel wrote: For comparison, the revival of the u string prefix in Py3.3 is a simple change in the parser grammar that's easy to maintain And even this simple change has caused unexpected issues (see issues #15054 and

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Grant Edwards
On 2012-06-27, Adam adam@no_thanks.com wrote: The Python script needed a call to ser.close() before ser.open() in order to work. IOW, the port opened OK, but when you tried to open it a second time without closing it first, _that's_ when the .open() call failed. That's a restriction built in

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-27 Thread Hans Mulder
On 27/06/12 22:45:47, David Thomas wrote: Thank you ever so much raw_input works fine. Do you think I should stick with Python 2 before I go to 3? I think so. The differences are not that big, but big enough to confuse a beginner. Once you know pyhton2, read

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Adam
Grant Edwards invalid@invalid.invalid wrote in message news:jsftah$bb5$1...@reader1.panix.com... On 2012-06-27, Adam adam@no_thanks.com wrote: The Python script needed a call to ser.close() before ser.open() in order to work. IOW, the port opened OK, but when you tried to open it a second

Re: question about numpy, subclassing, and a DeprecationWarning

2012-06-27 Thread Robert Kern
On 6/27/12 10:02 PM, Jason Swails wrote: Hello, I'm running into an unexpected issue in a program I'm writing, and I was hoping someone could provide some clarification for me. I'm trying to subclass numpy.ndarray (basically create a class to handle a 3D grid). When I instantiate a

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Grant Edwards
On 2012-06-27, Adam adam@no_thanks.com wrote: Grant Edwards invalid@invalid.invalid wrote: On 2012-06-27, Adam adam@no_thanks.com wrote: The Python script needed a call to ser.close() before ser.open() in order to work. IOW, the port opened OK, but when you tried to open it a second time

Re: XPlatform ToolKit

2012-06-27 Thread Mark Lawrence
On 27/06/2012 20:12, php...@gmail.com wrote: EnTK (batteries included) http://stk.phpyjs.com/ntk.zip EsTK (pilas incluidas) http://stk.phpyjs.com/stk.zip Reverse Engineer This sihT -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Christian Tismer
On 6/27/12 8:58 PM, Serhiy Storchaka wrote: On 27.06.12 17:34, Christian Tismer wrote: That's why I was unhappy with py3's missing flexibility. Excessive flexibility is amorphism. Random notes without context and reasoning are no better than spam. My answer as well, of course, so let's

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Grant Edwards
On 2012-06-27, Grant Edwards invalid@invalid.invalid wrote: On 2012-06-27, Adam adam@no_thanks.com wrote: Grant Edwards invalid@invalid.invalid wrote: Why do you need to open it a second time? As far as I can tell, the wireless hardware connected to the USB-to-serial converter is receiving

Question:Programming a game grid ...

2012-06-27 Thread iconoclast011
Fairly new to Python ... Is there a way to efficiently (different from my brute force code shown below) to set up a game grid of buttons (ie with pygame) responding to mouse clicks ? I would want to vary the size of the grid ... Thanks Brute force code: from Tkinter import * root =

Re: XPlatform ToolKit

2012-06-27 Thread Temia Eszteri
On Wed, 27 Jun 2012 23:14:13 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: On 27/06/2012 20:12, php...@gmail.com wrote: EnTK (batteries included) http://stk.phpyjs.com/ntk.zip EsTK (pilas incluidas) http://stk.phpyjs.com/stk.zip Reverse Engineer This sihT No no no, clearly it's sihT

Re: Py330b1, un café crème sucré

2012-06-27 Thread gst
On 27 juin, 22:48, Karim kliat...@gmail.com wrote: Euhhh, j'ai pas tout suivi. C'est quoi la feinte? Perso je suis pas sûr qu'il y en ait une. Je dirais que l'OP a peut-être eu un grand besoin de café crème sucré et a voulu partager son plaisir avec d'autres, why not ;) regards, gst.

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Temia Eszteri
On Wed, 27 Jun 2012 22:18:59 + (UTC), Grant Edwards invalid@invalid.invalid wrote: Can you post a small example showing what you're doing? The best way to get help is to write as small a program as possible that demonstrates the problem, and post it. I'll help you get started... Does this

Re: Recommend decent Computer Science books

2012-06-27 Thread Chris Angelico
On Thu, Jun 28, 2012 at 7:00 AM, David Thomas dthoma...@me.com wrote: Hi I know that this is a group about Python.  But I am just wondering if anybody can recommend any introductory/good books on Conputer Science. Well, there are books about Python specifically. They get discussed periodically

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Adam
Temia Eszteri lamial...@cleverpun.com wrote in message news:ra2nu7h75720i75ijhabg12dngrab75...@4ax.com... On Wed, 27 Jun 2012 22:18:59 + (UTC), Grant Edwards invalid@invalid.invalid wrote: Can you post a small example showing what you're doing? The best way to get help is to write as

Re: Getting lazy with decorators

2012-06-27 Thread Josh English
On Monday, June 25, 2012 11:57:39 PM UTC-7, Peter Otten wrote: There is nothing in the documentation (that I have found) that points to this solution. That's because I invented it. Oh bother. The lines I completely overlooked were in your __getattr__ override. Boy is my face red.

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Grant Edwards
On 2012-06-27, Adam adam@no_thanks.com wrote: Actually, I believe someone in an earlier thread in the newsgroup or elsewhere pointed out that serial ports automatically open under Windows. I'd have to look it back up when I have the time, which I don't have at the moment, unfortunately. What

Re: Question:Programming a game grid ...

2012-06-27 Thread David
First, you should be getting an error on vars()[var] = Button(f3, text = 00, bg = white) as vars() has not been declared and it does not appear to be valid Python syntax. I don't see a reason to store a reference to the button since you won't be modifying them. Also, you can not mix pack() and

Re: Question:Programming a game grid ...

2012-06-27 Thread Chris Angelico
On Thu, Jun 28, 2012 at 9:24 AM, David dwb...@gmail.com wrote: First, you should be getting an error on vars()[var] = Button(f3, text = 00, bg = white) as vars() has not been declared and it does not appear to be valid Python syntax. It's valid syntax, but highly inadvisable. What it does is

Re: Question:Programming a game grid ...

2012-06-27 Thread Chris Angelico
On Thu, Jun 28, 2012 at 9:35 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Jun 28, 2012 at 9:24 AM, David dwb...@gmail.com wrote: First, you should be getting an error on vars()[var] = Button(f3, text = 00, bg = white) as vars() has not been declared and it does not appear to be valid

Re: Question:Programming a game grid ...

2012-06-27 Thread MRAB
On 27/06/2012 23:21, iconoclast011 wrote: Fairly new to Python ... Is there a way to efficiently (different from my brute force code shown below) to set up a game grid of buttons (ie with pygame) responding to mouse clicks ? I would want to vary the size of the grid ... [code snipped]

Re: exception problem

2012-06-27 Thread Charles Hixson
On 06/25/2012 12:48 AM, Steven D'Aprano wrote: On Sun, 24 Jun 2012 16:16:25 -0700, Charles Hixson wrote: But what I wanted was to catch any exception. Be careful of what you ask for, since you might get it. Catch any exception is almost certainly the wrong thing to do, almost

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Adam
Grant Edwards invalid@invalid.invalid wrote in message news:jsg4o8$o4p$1...@reader1.panix.com... On 2012-06-27, Adam adam@no_thanks.com wrote: Actually, I believe someone in an earlier thread in the newsgroup or elsewhere pointed out that serial ports automatically open under Windows. I'd

Re: Question:Programming a game grid ...

2012-06-27 Thread Steven D'Aprano
On Wed, 27 Jun 2012 16:24:30 -0700, David wrote: First, you should be getting an error on vars()[var] = Button(f3, text = 00, bg = white) as vars() has not been declared The Fine Manual says differently: Python 2: http://docs.python.org/library/functions.html#vars Python 3:

Re: Question:Programming a game grid ...

2012-06-27 Thread alex23
On Jun 28, 8:21 am, iconoclast011 iconoclast...@gmail.com wrote: Fairly new to Python ... Is there a way to efficiently (different from my brute force code shown below) to set up a game grid of buttons (ie with pygame) responding to mouse clicks ?   I would want to vary the size of the grid

Re: exception problem

2012-06-27 Thread alex23
On Jun 28, 10:13 am, Charles Hixson charleshi...@earthlink.net wrote: On 06/25/2012 12:48 AM, Steven D'Aprano wrote: Catch any exception is almost certainly the wrong thing to do, almost always. This time it was the right thing, as I suspected that *SOME* exception was being thrown, but

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread alex23
On Jun 28, 8:11 am, Christian Tismer tis...@stackless.com wrote: Random notes without context and reasoning are no better than spam. My answer as well, of course, so let's stop here. It's more that all of this has been discussed at length. Repeatedly. It's very easy to criticise the current

Is there any way to decode String using unknown codec?

2012-06-27 Thread howmuchistoday
Hi I'm a Korean and when I use modules like sys, os, c, sometimes the interpreter show me broken strings like '\x13\xb3\x12\xc8'. It mustbe the Korean alphabet but I can't decode it to the rightway. I tried to decode it using codecs like cp949,mbcs,utf-8 but It failed. The only way I found is

Re: Slow output

2012-06-27 Thread alex23
On Jun 28, 3:33 am, subhabangal...@gmail.com wrote: May any one suggest me what may be the likely issue? In situations like this, it always helps to see your code, especially if you can reduce it down to only the part doing the loading. One thing that can help reduce memory usage is to replace

Re: Question:Programming a game grid ...

2012-06-27 Thread woooee
On Wednesday, June 27, 2012 5:15:09 PM UTC-7, Steven D#39;Aprano wrote: On Wed, 27 Jun 2012 16:24:30 -0700, David wrote: First, you should be getting an error on vars()[var] = Button(f3, text = 00, bg = white) as vars() has not been declared The Fine Manual says differently: Python

Re: Is there any way to decode String using unknown codec?

2012-06-27 Thread Benjamin Kaplan
On Wed, Jun 27, 2012 at 6:14 PM, howmuchisto...@gmail.com wrote: Hi I'm a Korean and when I use modules like sys, os, c, sometimes the interpreter show me broken strings like '\x13\xb3\x12\xc8'. It mustbe the Korean alphabet but I can't decode it to the rightway. I tried to decode it using

Re: Question:Programming a game grid ...

2012-06-27 Thread alex23
On Jun 28, 12:15 pm, woo...@gmail.com wrote: You assume too much IMHO.  Vars() was not declared in the code provided and I do not think that we should be assuming that it is a function returning a dictionary instead of an error. http://docs.python.org/library/functions.html#vars Do you have

Re: Question:Programming a game grid ...

2012-06-27 Thread iconoclast011
In reply to alex23 who wrote the following: On Jun 28, 12:15=A0pm, woo...@gmail.com wrote: You assume too much IMHO. =A0Vars() was not declared in the code provided and I do not think that we should be assuming that it is a function returning a dictionary instead of an error.

Re: Question:Programming a game grid ...

2012-06-27 Thread Temia Eszteri
On Wed, 27 Jun 2012 19:43:07 -0700 (PDT), alex23 wuwe...@gmail.com wrote: There are two ways to help people: by trying to understand what they're doing, or by submitting them to endless pedantry. Only one of those is actually helpful. Is it alright if I use that as a quote? Properly attributed,

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread rantingrickjohnson
On Monday, June 25, 2012 10:35:14 PM UTC-5, Steven D#39;Aprano wrote: (Rick, don't make me regret communicating with you again.) Well unfortunately Steven i am not sure what causes you to stop communicating with me for these seeming random periods of time -- although i can deduce from past

Re: Recommend decent Computer Science books

2012-06-27 Thread Greg
On Wednesday, June 27, 2012 2:00:03 PM UTC-7, David Thomas wrote: Hi I know that this is a group about Python. But I am just wondering if anybody can recommend any introductory/good books on Conputer Science. Kind regards I recommend Python Programming: An Introduction to Computer Science

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread rantingrickjohnson
On Tuesday, June 26, 2012 1:24:43 AM UTC-5, Stefan Behnel wrote: Maybe we should add a remote error reporting mode to Python that sends all syntax error messages not only to the local screen but also directly to the PSF so that they can fund developers who are able to delete that error

Re: exception problem

2012-06-27 Thread Steven D'Aprano
On Wed, 27 Jun 2012 17:13:00 -0700, Charles Hixson wrote: On 06/25/2012 12:48 AM, Steven D'Aprano wrote: On Sun, 24 Jun 2012 16:16:25 -0700, Charles Hixson wrote: But what I wanted was to catch any exception. Be careful of what you ask for, since you might get it. Catch any

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread rantingrickjohnson
On Tuesday, June 26, 2012 1:34:03 AM UTC-5, Stefan Behnel wrote: First of all, the statement has a rather special syntax that is not obvious and practically non-extensible. It also has hidden semantics that are hard to explain and mixes formatting with output - soft-space, anyone? The

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread alex23
Rick, fix your mail reader/sender, your lines aren't wrapping properly. On Jun 28, 1:53 pm, rantingrickjohn...@gmail.com wrote: Unfortunately, even though print is supposedly only used by the neophytes, the python3.0 stdlib is full of print statements. For instance, out of 3173 files, 986

Re: Question:Programming a game grid ...

2012-06-27 Thread Rick Johnson
On Jun 27, 5:21 pm, iconoclast011 iconoclast...@gmail.com wrote: Fairly new to Python ... Is there a way to efficiently (different from my brute force code shown below) to set up a game grid of buttons (ie with pygame) responding to mouse clicks ?   I would want to vary the size of the grid

Re: Recommend decent Computer Science books

2012-06-27 Thread rusi
On Jun 28, 2:00 am, David Thomas dthoma...@me.com wrote: Hi I know that this is a group about Python.  But I am just wondering if anybody can recommend any introductory/good books on Conputer Science. Kind regards This is like asking: How do I live my life? or make money (or love)? etc Not

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Ian Kelly
On Jun 27, 2012 9:57 PM, rantingrickjohn...@gmail.com wrote: [1] of course that is when using `filestr.count(print)` -- I assume that the word print is not used excessively in comments or docstrings. Someone else can do a less naive search if they like. Or as part of a longer name, e.g. the

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Steven D'Aprano
On Wed, 27 Jun 2012 17:44:23 -0700, alex23 wrote: If you believe providing a complementary __past__ namespace will work - even though I believe Guido has explicitly stated it will never happen - then the onus is on you to come up with an implementation. Guido speaks only for CPython. Other

Re: Question:Programming a game grid ...

2012-06-27 Thread Steven D'Aprano
On Wed, 27 Jun 2012 19:15:54 -0700, woooee wrote: as vars() has not been declared and it does not appear to be valid Python syntax You assume too much IMHO. Vars() was not declared in the code provided and I do not think that we should be assuming that it is a function returning a

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Serhiy Storchaka
On 28.06.12 00:14, Terry Reedy wrote: Another prediction: people who code Python without reading the manual, at least not for new features, will learn about 'u' somehow (such as by reading this list) and may do either of the following, both of which are bad. 1. They will confuse themselves by

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Stefan Behnel
Serhiy Storchaka, 28.06.2012 07:36: On 28.06.12 00:14, Terry Reedy wrote: Another prediction: people who code Python without reading the manual, at least not for new features, will learn about 'u' somehow (such as by reading this list) and may do either of the following, both of which are

[issue15030] PyPycLoader can't read cached .pyc files

2012-06-27 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Patch looks innocent enough; would be nice to fix this for 3.3. -- nosy: +georg.brandl priority: normal - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15030

[issue15030] PyPycLoader can't read cached .pyc files

2012-06-27 Thread Marc Abramowitz
Marc Abramowitz msabr...@gmail.com added the comment: Similar issue in distribute: https://bitbucket.org/tarek/distribute/issue/283/bdist_egg-issues-with-python-330ax -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15030

[issue12605] Enhancements to gdb 7 debugging hooks

2012-06-27 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Agreed with Martin, can't say I'm +1 on 3.3 either. But I've just reviewed the patch, and it looks correct to me, so go ahead and I'll take the blame. -- ___ Python tracker rep...@bugs.python.org

[issue13876] Sporadic failure in test_socket

2012-06-27 Thread Nadeem Vawda
Nadeem Vawda nadeem.va...@gmail.com added the comment: Merging nosy list from duplicate issue 15155. -- nosy: +giampaolo.rodola, neologix, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13876

[issue15199] Default mimetype for javascript should be application/javascript

2012-06-27 Thread Bohuslav Slavek Kabrda
New submission from Bohuslav Slavek Kabrda bkab...@redhat.com: Hi, when using Python's Lib/mimetypes.py and none of the default files is present, there are some defaults used. For javascript, the default is application/x-javascript. However, according to IANA specification [1], this is not a

[issue15200] Faster os.walk

2012-06-27 Thread Serhiy Storchaka
New submission from Serhiy Storchaka storch...@gmail.com: Using os.fwalk (if it is available) we can make os.walk more fast. Microbenchmark: ./python -m timeit -s from os import walk for x in walk('Lib'): pass Results: Vanilla: 112 msec Patched: 90.5 msec -- components: Library (Lib)

  1   2   3   >