Re: code review

2012-06-28 Thread alex23
On Jun 29, 12:57 pm, "Littlefield, Tyler" wrote: > I was curious if someone wouldn't mind poking at some code. > The project page is at:http://code.google.com/p/pymud > Any information is greatly appreciated. I couldn't find any actual code at that site, the git repository is currently empty. --

code review

2012-06-28 Thread Littlefield, Tyler
Hello all: I was curious if someone wouldn't mind poking at some code. I have an idea for a game I want to write (and if this works I want to use this as a framework for another project), but I'd like to make sure I'm doing things correctly/there's not a better way to do things. My concern is I

Re: Seeking Python Programmer - San Jose, CA

2012-06-28 Thread Ben Finney
Flexton Inc writes: > Do you love coding and Interested in exploring Python? OR Expert in > Python, we have a requirement on Contract to Hire position […] Please do not use this forum for recruiting. Instead, use the Python Job Board http://www.python.org/community/jobs/> for that purpose. --

Seeking Python Programmer - San Jose, CA

2012-06-28 Thread Flexton Inc
Hi, Do you love coding and Interested in exploring Python? OR Expert in Python, we have a requirement on Contract to Hire position with a well known client in Bay Area, CA Location: San Jose, CA Duration: 6-12 months Someone who loves coding with Python coding experience, UNIX background (solving

Seeking Python Programmer - San Jose, CA

2012-06-28 Thread Flexton Inc
Hi, Do you love coding and Interested in exploring Python? OR Expert in Python, we have a requirement on Contract to Hire position with a well known client in Bay Area, CA Location: San Jose, CA Duration: 6-12 months Someone who loves coding with Python coding experience, UNIX background (solving

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

2012-06-28 Thread Adam
"Roel Schroeven" wrote in message news:mailman.1618.1340910525.4697.python-l...@python.org... > Temia Eszteri schreef: >> 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

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

2012-06-28 Thread howmuchistoday
T 2012년 6월 28일 목요일 오전 11시 20분 28초 UTC+9, Benjamin Kaplan 님의 말: > On Wed, Jun 27, 2012 at 6:14 PM, 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 ca

Re: retry many times decorator

2012-06-28 Thread Andrea Crotti
On 06/28/2012 06:43 PM, Steven D'Aprano wrote: On Thu, 28 Jun 2012 17:26:36 +0100, andrea crotti wrote: I disagree. If you make a coding error in your function, why do you think it is useful to retry that buggy code over and over again? It's never going to get less buggy unless you see the exce

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

2012-06-28 Thread Adam
"Grant Edwards" wrote in message news:jshotj$s55$1...@reader1.panix.com... > On 2012-06-28, Adam wrote: > >> Obviously pySerial considers the serial port open > > Because it's already been opened by the Python program. > >> and will not open an already open serial port. > > Pyserial will happil

Re: Slow output

2012-06-28 Thread Roel Schroeven
subhabangal...@gmail.com schreef: 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

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

2012-06-28 Thread Roel Schroeven
Temia Eszteri schreef: 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. That doesn't have anything to

Re: Following syntax error in Mac OX10.7 Terminal

2012-06-28 Thread David Thomas
Thank you very much I didn't realise that the indentation was important. The IDE indents automatically whilst terminal doesn't. Thanks for pointing it out. -- http://mail.python.org/mailman/listinfo/python-list

Re: moving methods from class to instance of other class

2012-06-28 Thread Terry Reedy
On 6/28/2012 2:59 AM, lars van gemerden wrote: class A(object): def __init__(self): self.name = 'a' def do(self): print 'A.do: self.name =', self.name class B(object): def __init__(self): self.name = 'b' The question is: How do i move the 'do' method f

Re: retry many times decorator

2012-06-28 Thread Steven D'Aprano
On Thu, 28 Jun 2012 17:26:36 +0100, andrea crotti wrote: >> Returning a boolean isn't very Pythonic. It would be better, IMHO, if >> it could swallow a specified exception (or specified exceptions?) >> raised when an attempt failed, up to the maximum permitted number of >> attempts. If the final a

Re: TKinter Frame Size automatic

2012-06-28 Thread Terry Reedy
On 6/28/2012 9:07 AM, hkara...@gmail.com wrote: I have a question about the frame size. I want to create Tabbed window. There will be one Window and tabs in this window. The page will be displayed whenever the user press the corresponding tab. This is simple NoteBook behaviour from Tkinter. I do

Re: Following syntax error in Mac OX10.7 Terminal

2012-06-28 Thread Andrew Berg
On 6/28/2012 12:11 PM, David Thomas wrote: > Hi, > I have the following error regarding a loop tutorial found on > http://www.sthurlow.com/python/lesson04/ > a=0 while a<10: > ... a=a+1 > File "", line 2 > a=a+1 > ^ > IndentationError: expected an indented block You indented

Re Following syntax error in Mac OX10.7 Terminal

2012-06-28 Thread Sergi Pasoev
You just have to consider that indentation matters in Python, so you have to type the code in Python interpreter as you have written it below, that is, press Tab before each line when you are inside the 'while (or any other like for, if, with, etc.) block. a=0 while a<10: a=a+1 print a I

Re: how can I implement "cd" like shell in Python?

2012-06-28 Thread Laurent Pointal
Sergi Pasoev wrote: > Do you mean to implement the cd command ? To what extent do you want to > implement it ? if what you want is just to have a script to change the > current working directory, it is as easy as this: > > > import sys > import os > os.chdir(sys.argv[1]) > > plus you could add

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

2012-06-28 Thread Dieter Maurer
howmuchisto...@gmail.com writes: > 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

Following syntax error in Mac OX10.7 Terminal

2012-06-28 Thread David Thomas
Hi, I have the following error regarding a loop tutorial found on http://www.sthurlow.com/python/lesson04/ >>> a=0 >>> while a<10: ... a=a+1 File "", line 2 a=a+1 ^ IndentationError: expected an indented block When I run Python IDE it seems to work fine. The following code is: a=0 w

Re: retry many times decorator

2012-06-28 Thread andrea crotti
> Returning a boolean isn't very Pythonic. It would be better, IMHO, if > it could swallow a specified exception (or specified exceptions?) > raised when an attempt failed, up to the maximum permitted number of > attempts. If the final attempt fails, propagate the exception. > -- > http://mail.pyth

Re: retry many times decorator

2012-06-28 Thread MRAB
On 28/06/2012 16:28, andrea crotti wrote: Hi everyone, I'm replacing a perl system that has to work a lot with databases and perforce (and a few other things). This script have to run completely unsupervisioned, so it's important that it doesn't just quit at the first attempt waiting for human i

Re: SSL handshake hanging, despite bugfix in stdlib

2012-06-28 Thread Michael Gundlach
On Mon, Jun 25, 2012 at 4:19 PM, Terry Reedy wrote: > Issue x ended with the message that the patch to issue y presumably fixed > issue x as well. I see two choices. (WHere I forget x and y, but they were > defined in previous posts.) > > 1. Post to issue x something like > Thanks for your advic

Re: 回复: how can I implement "cd" like shell in Python?

2012-06-28 Thread Alister
On Thu, 28 Jun 2012 20:28:40 +0800, Alex chen wrote: > I just want to write a python program,it can be called in the linux > terminal like the command "cd" to change the directory of the shell > terminal > > > That would not only be needlesly re-inventing the wheel but making it square in the

retry many times decorator

2012-06-28 Thread andrea crotti
Hi everyone, I'm replacing a perl system that has to work a lot with databases and perforce (and a few other things). This script have to run completely unsupervisioned, so it's important that it doesn't just quit at the first attempt waiting for human intervent.. They say that the network someti

Re: Recommend decent Computer Science books

2012-06-28 Thread David Thomas
Thanks everyone for the feedback really appreciate it especially the above post cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: Þ how can I implement "cd" like shell in Python?

2012-06-28 Thread Evan Driscoll
On 6/28/2012 7:28, Alex chen wrote: > I just want to write a python program,it can be called in the linux > terminal like the command "cd" to change the directory of the shell terminal You "can't" do this; a program the shell runs cannot affect the shell's execution. What you have to do is have s

Re: how can I implement "cd" like shell in Python?

2012-06-28 Thread Alex chen
OK,I see! Thank you everyone. -- Original -- From: "Evan Driscoll"; Date: Thu, Jun 28, 2012 10:27 PM To: "Alex chen"; Cc: "d"; "python-list"; Subject: Re: how can I implement "cd" like shell in Python? On 6/28/2012 7:28, Alex chen wrote: > I jus

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

2012-06-28 Thread Grant Edwards
On 2012-06-28, Adam wrote: > Obviously pySerial considers the serial port open Because it's already been opened by the Python program. > and will not open an already open serial port. Pyserial will happily try if you call the open() of a port that's already open, but Windows will return an err

Re: Slow output

2012-06-28 Thread subhabangalore
On Wednesday, June 27, 2012 11:03:44 PM UTC+5:30, (unknown) 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

Re: 回复: how can I implement "cd" like shell in Python?

2012-06-28 Thread Kushal Kumaran
Alex chen wrote: >I just want to write a python program,it can be called in the linux >terminal like the command "cd" to change the directory of the shell >terminal > This cannot be done. Shells implement cd as a builtin, rather than a command such as /usr/bin/cd because there is no way to cha

TKinter Frame Size automatic

2012-06-28 Thread hkaratoy
I have a question about the frame size. I want to create Tabbed window. There will be one Window and tabs in this window. The page will be displayed whenever the user press the corresponding tab. This is simple NoteBook behaviour from Tkinter. I do not want to set the master window size but I wa

Re: exception problem

2012-06-28 Thread Ethan Furman
Charles Hixson 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 No, it wasn't. If you hadn't caught it, Python would have printed it out for you, along with the full tra

?????? how can I implement "cd" like shell in Python?

2012-06-28 Thread Alex chen
I just want to write a python program,it can be called in the linux terminal like the command "cd" to change the directory of the shell terminal -- -- ??: "Dave Angel"; : 2012??6??28??(??) 8:12 ??: "Alex Chen"; : "python-li

Re: how can I implement "cd" like shell in Python?

2012-06-28 Thread Dave Angel
On 06/28/2012 05:30 AM, 梦幻草 wrote: > how can I implement "cd" like shell in Python? > import os os.chdir("newdirectory") But the more important question is why you want to. Inside a Python program, many people find that changing directory causes unexpected difficulties, and they simply keep tra

??????Re:how can I implement "cd" like shell in Python?

2012-06-28 Thread ??????
thanks !But this method can not change the directory of the main process.For example: the current directory is "/home/work/local/scripts",this directory have a python script file "cd.py" after executing the script cd.py by "python cd.py ..",the current work directory has no changes,the path is s

Re: how can I implement "cd" like shell in Python?

2012-06-28 Thread Christian Heimes
Am 28.06.2012 13:09, schrieb Sergi Pasoev: > Do you mean to implement the cd command ? To what extent do you want to > implement it ? if what you want is just to have a script to change the > current working directory, it is as easy as this: Please note that you can't change the working directory

Re: how can I implement "cd" like shell in Python?

2012-06-28 Thread Hans Mulder
On 28/06/12 13:09:14, Sergi Pasoev wrote: > Do you mean to implement the cd command ? To what extent do you want to > implement it ? if what you want is just to have a script to change the > current working directory, it is as easy as this: > > > import sys > import os > os.chdir(sys.argv[1]) >

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

2012-06-28 Thread MRAB
On 28/06/2012 02:14, 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 codecs like cp9

how can I implement "cd" like shell in Python?

2012-06-28 Thread Sergi Pasoev
Do you mean to implement the cd command ? To what extent do you want to implement it ? if what you want is just to have a script to change the current working directory, it is as easy as this: import sys import os os.chdir(sys.argv[1]) plus you could add some error-handling code. -- http://mail

how can I implement "cd" like shell in Python?

2012-06-28 Thread ??????
how can I implement "cd" like shell in Python?-- 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-28 Thread Chris Angelico
On Thu, Jun 28, 2012 at 7:34 PM, wrote: > On the other side, one can argue this (elegancy): > > b'a series of bytes' > u'a unicode, a series of code points' Alas, not perfectly so. A 'bytes' object and a 'unicode' object can be described that way (with 'str' an alias for one or t'other), but lit

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

2012-06-28 Thread wxjmfauth
On Thursday, June 28, 2012 7:47:24 AM UTC+2, Stefan Behnel wrote: > 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

Re: moving methods from class to instance of other class

2012-06-28 Thread lars van gemerden
On Jun 28, 9:22 am, Benjamin Kaplan wrote: > On Wed, Jun 27, 2012 at 11:59 PM, lars van gemerden > > > > > > > > > > wrote: > > Hi all, > > > I have some trouble with the following question: Let say i have the > > following classes: > > > class A(object): > >    def __init__(self): > >        sel

Learning python by reading

2012-06-28 Thread Sergi Pasoev
Hello Do you know some python programs that make good reading to learn the language by studying and modifying the source code ? I often try to understand things in the standard library, and apart from doing this kind of search myself, I would be glad to hear some ideas from more experienced progra

Re: moving methods from class to instance of other class

2012-06-28 Thread Benjamin Kaplan
On Wed, Jun 27, 2012 at 11:59 PM, lars van gemerden wrote: > Hi all, > > I have some trouble with the following question: Let say i have the > following classes: > > class A(object): >    def __init__(self): >        self.name = 'a' >    def do(self): >        print 'A.do: self.name =', self.name

moving methods from class to instance of other class

2012-06-28 Thread lars van gemerden
Hi all, I have some trouble with the following question: Let say i have the following classes: class A(object): def __init__(self): self.name = 'a' def do(self): print 'A.do: self.name =', self.name class B(object): def __init__(self): self.name = 'b' The q