[Tutor] socket timeout

2009-11-26 Thread Stefan Lesicnik
Hi guys, Maybe someone can point me in the right direction, since i'm not sure why i cant get the timeout to work. Admittedly i don't know much about socket programming. Im using the below code... s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #s.setdefaulttimeout(1) s.connect((pro

Re: [Tutor] python time

2009-11-26 Thread Kent Johnson
On Thu, Nov 26, 2009 at 9:28 PM, Modulok wrote: > Doesn't time.time return a float? time.time() > 1259288538.576565 > > Right? Yes. I'm not at all sure I understand the original question, but one plausible interpretation is, "How does python get the time to high accuracy? I want to do that

Re: [Tutor] python time

2009-11-26 Thread Modulok
Doesn't time.time return a float? >>> import time >>> help(time.time) Help on built-in function time in module time: time(...) time() -> floating point number Return the current time in seconds since the Epoch. Fractions of a second may be present if the system clock provides them.

Re: [Tutor] unicode mapping doesn't work

2009-11-26 Thread Alan Gauld
Huh?! Was this to the right place? It doesn't seem to be related to the previous posts in the thread? Confused Alan G. "Lie Ryan" wrote in message news:hen7am$4r...@ger.gmane.org... On 11/27/2009 10:43 AM, The Music Guy wrote: > Next thing is, I can't see logically how the path of the di

Re: [Tutor] unicode mapping doesn't work

2009-11-26 Thread Lie Ryan
On 11/27/2009 10:43 AM, The Music Guy wrote: > Next thing is, I can't see logically how the path of the discussion of > the proposal lead to the proposal being rejected. It looked like a lot > of people really liked the idea--including Guido himself--and several > examples were given about how it

Re: [Tutor] unicode mapping doesn't work

2009-11-26 Thread Albert-Jan Roskam
Thank you! Quite frankly, I didn't know about ordinals *blushes*. Also, I thought that d.update({k: v}) was equivalent to d[k] = v, but apparently it's not. So thank you twice! Cheers!! Albert-Jan ~~ In the face of ambiguit

Re: [Tutor] quick question

2009-11-26 Thread Alan Gauld
"Travis Murphy" wrote i am a first year student taking a python developers course. i wanted to know if from time to time in the future, is there somebody there i can speak to for support? Yes, a whole mailinglist of people. The only caveat is that, as a matter of policy, we do not do home

Re: [Tutor] unicode mapping doesn't work

2009-11-26 Thread Lie Ryan
Albert-Jan Roskam wrote: Hi, I want to substitute some letters with accents with theire non-accented equivalents. It should be easy, but it doesn't work. What am I doing wrong? trans = {} funnychars = u"éèêëóòôöáàâäÉÈÊËÓÒÔÖÁÀÂÄ" asciichars = "" for f, a in zip(funnycha

[Tutor] unicode mapping doesn't work

2009-11-26 Thread Albert-Jan Roskam
Hi, I want to substitute some letters with accents with theire non-accented equivalents. It should be easy, but it doesn't work. What am I doing wrong? trans = {} funnychars = u"éèêëóòôöáàâäÉÈÊËÓÒÔÖÁÀÂÄ" asciichars = "" for f, a in zip(funnychars, asciichars):     trans.u

Re: [Tutor] python time

2009-11-26 Thread Kent Johnson
On Wed, Nov 25, 2009 at 11:11 AM, spir wrote: > Hello, > > How does python get the time in microseconds? (In other words, how would I > get it if python (like some other languages) would provide time in whole > seconds only?) Use the source...in particular, see floattime() in timemodule.c: http

Re: [Tutor] quick question

2009-11-26 Thread OkaMthembo
By the way, when asking a question or answering, you only ever need to send the message to tutor@python.org :) On Thu, Nov 26, 2009 at 3:29 PM, OkaMthembo wrote: > Hi Travis, > > Welcome to the python mailing list. You have come to the right place for > support and advice pertaining to python; i

Re: [Tutor] quick question

2009-11-26 Thread OkaMthembo
Hi Travis, Welcome to the python mailing list. You have come to the right place for support and advice pertaining to python; it is what this list is about. On Thu, Nov 26, 2009 at 12:49 PM, Travis Murphy wrote: > i am a first year student taking a python developers course. i wanted to > know

[Tutor] quick question

2009-11-26 Thread Travis Murphy
i am a first year student taking a python developers course. i wanted to know if from time to time in the future, is there somebody there i can speak to for support? ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] UnicodeEncodeError

2009-11-26 Thread Albert-Jan Roskam
OK, thanks a lot Spir and Kent for your replies. I converted element.text to str because some of the element.text were integers and these caused TypeErrors later on in the program. I don't have the program here (it's in the office) so I can't tell you the exact details. It's a search-and-replace

Re: [Tutor] python time

2009-11-26 Thread Dave Angel
spir wrote: Hello, How does python get the time in microseconds? (In other words, how would I get it if python (like some other languages) would provide time in whole seconds only?) Thank you, Denis la vita e estrany http://spir.wikidot.com/ You need to