Python 2.6 in shared/VPS environment

2009-07-31 Thread northof40
Hi - I'd really like to have access to Python 2.6 to try something out. It needs to be on Linux/Unix machine. I don't mind paying but whichever way I turn I find Python 2.4 is the standard installation. Anyone know of anyone who offers this out of the box ? Or got any smart way of achieving it ?

Re: Confused About Python Loggin

2009-07-31 Thread Peter Otten
Jannik Sundø wrote: > Dear all, I am quite confused about the Python logging. I have read > and re-read the Python documentation for the Python logging module and > googled, but to no avail. I simply want one logger to log to a file > and another logger to log to the console. Neither should log th

problem on socket programming

2009-07-31 Thread MalC0de
hello there, I'm using Learning Python 3rd edition as my core reference, the book is great. here's some snippet for demonstrating echo-server program, but I can't interpret it in both windows / Gnu linux ... #!/usr/bin/env python from socket import * myHost = '' myPort = 50007 sockobj = socket(AF_

Re: Confessions of a Python fanboy

2009-07-31 Thread Steven D'Aprano
On Thu, 30 Jul 2009 18:06:31 -0500, Robert Kern wrote: > On 2009-07-30 16:44, r wrote: >> On Jul 30, 4:29 pm, Emmanuel Surleau wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i

How to force SAX parser to ignore encoding problems

2009-07-31 Thread Łukasz
Hi, I have a problem with my XML parser (created with libraries from xml.sax package). When parser finds a invalid character (in CDATA section) for example �, throws an exception SAXParseException. Is there any way to just ignore this kind of problem. Maybe there is a way to set up parser in less

Re: problem on socket programming

2009-07-31 Thread Xavier Ho
Whoops, posted to the wrong address yet again. I deserve some punishment. On Fri, Jul 31, 2009 at 5:33 PM, Xavier Ho wrote: > On Fri, Jul 31, 2009 at 5:25 PM, MalC0de wrote: > >> >> while true : >> >> where's the problem, > > > There. =] > (Btw, it's True, not true.) -- http://mail.python

Re: Test for Pythonwin?

2009-07-31 Thread eliasf
"steve" wrote: Is there a good way to check if a script is running inside Pythonwin? Perhaps a property or method that is exposed by that environment? I don't know how foolproof it is, but this works: 'pywin' in sys.modules -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 30 Jul 2009, at 23:52 , Jan Kaliszewski wrote: Dnia 30-07-2009 o 22:41:57 Masklinn napisał(a): On 30 Jul 2009, at 22:23 , Jan Kaliszewski wrote: 30-07-2009 o 13:36:49 Masklinn wrote: On 30 Jul 2009, at 06:04 , alex23 wrote: On Jul 30, 1:06 pm, r wrote: 2.) the .each method container.e

Re: Non-blocking read with popen subprocess

2009-07-31 Thread Piet van Oostrum
> Jonathan Gardner (JG) wrote: >JG> On Jul 30, 5:24 pm, Dhanesh wrote: >>> >>> how can I we have a non blocking read ? >JG> See http://docs.python.org/library/popen2.html#flow-control-issues >JG> Note well: In the non-blocking world, you have to use select() or poll >JG> () to get your jo

Re: problem on socket programming

2009-07-31 Thread MalC0de
problem with this code solved in win32, but I didn't test it after solved problem on gnu/linux . -- http://mail.python.org/mailman/listinfo/python-list

Re: socket send

2009-07-31 Thread Francesco Bochicchio
On Jul 30, 10:16 pm, "Jan Kaliszewski" wrote: > 30-07-2009 o 12:29:24 Francesco Bochicchio wrote: > > > On Jul 30, 5:52 am, NighterNet wrote: > >> I am trying to figure out how to send text or byte in python 3.1. I am > >> trying to send data to flash socket to get there. I am not sure how to >

Re: problem on socket programming

2009-07-31 Thread MalC0de
now I've been encountered to some errors with this snippet : import sys from socket import * serverHost = 'localhost' serverPort = 50007 message = ['Hello network world'] if len(sys.argv) > 1: serverHost = sys.argv[1] if len(sys.argv) > 2: message = sys.argv[2:] sockobj = socket(AF

Processes not exiting

2009-07-31 Thread ma3mju
Hi all, I'm having trouble with multiprocessing I'm using it to speed up some simulations, I find for large queues when the process reaches the poison pill it does not exit whereas for smaller queues it works without any problems. Has anyone else had this trouble? Can anyone tell me a way around i

Re: problem on socket programming

2009-07-31 Thread Chris Rebert
On Fri, Jul 31, 2009 at 1:02 AM, MalC0de wrote: > now I've been encountered to some errors with this snippet : And these errors are? Provide error messages and full tracebacks. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 30 Jul 2009, at 23:57 , Luis Zarrabeitia wrote: I'd like to ask, what "container.each" is, exactly? It looks like a function call (as I've learned a few posts ago), but, what are its arguments? How the looping "works"? Does it receive a "code" object that it has to execute? Is .each some

Re: Confessions of a Python fanboy

2009-07-31 Thread Steven D'Aprano
On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: > That and the fact that I couldn't stop laughing for long enough to learn > any more when I read in the Pragmatic Programmer's Guide that "Ruby, > unlike less flexible languages, lets you alter the value of a constant." > Yep, as they say "Bug"

Re: If Scheme is so good why MIT drops it?

2009-07-31 Thread Hendrik van Rooyen
On Thursday 30 July 2009 03:09:14 greg wrote: > Hendrik van Rooyen wrote: > > And if code is data, where is Pythons ALTER statement? > > class Duck: > >def quack(self): > print "Quack!" > > def moo(): >print "Moo!" > > def ALTER(obj, name, TO_PROCEED_TO): >setattr(obj, name, TO_PRO

Re: Confessions of a Python fanboy

2009-07-31 Thread Xavier Ho
On Fri, Jul 31, 2009 at 6:08 PM, Masklinn wrote: > ... but since Python doesn't have anonymous functions that usage > tends to be a bit too verbose ... > Sorry to interrupt, but wouldn't lambda in Python be considered as 'anonymous functions'? -- http://mail.python.org/mailman/listinfo/python-

Re: Confessions of a Python fanboy

2009-07-31 Thread Chris Rebert
On Fri, Jul 31, 2009 at 1:21 AM, Xavier Ho wrote: > On Fri, Jul 31, 2009 at 6:08 PM, Masklinn wrote: >> >> ... but since Python doesn't have anonymous functions that usage >> tends to be a bit too verbose ... > > Sorry to interrupt, but wouldn't lambda in Python be considered as > 'anonymous func

Re: Non-blocking read with popen subprocess

2009-07-31 Thread Javier Collado
Hello, According to my experience and from what I've read in other threads, subprocess isn't easy to use for interactive tasks. I don't really know, but maybe it wasn't even designed for that at all. On the other hand, pexpect seems to work fine for interactive use and even provides a method for

Re: Confessions of a Python fanboy

2009-07-31 Thread Xavier Ho
On Fri, Jul 31, 2009 at 6:25 PM, Chris Rebert wrote: > I believe "full" anonymous functions was intended by the author. > lambdas are limited to a single expression. "Full" anonymous functions > would be allowed to contain multiple statements. > > Cheers, but what about this: def goBig(x):

Re: Confessions of a Python fanboy

2009-07-31 Thread Chris Rebert
On Fri, Jul 31, 2009 at 1:31 AM, Xavier Ho wrote: > On Fri, Jul 31, 2009 at 6:25 PM, Chris Rebert wrote: >> >> I believe "full" anonymous functions was intended by the author. >> lambdas are limited to a single expression. "Full" anonymous functions >> would be allowed to contain multiple statemen

Re: problem on socket programming

2009-07-31 Thread MalC0de
On Jul 31, 12:07 pm, Chris Rebert wrote: > On Fri, Jul 31, 2009 at 1:02 AM, MalC0de wrote: > > now I've been encountered to some errors with this snippet : > > And these errors are? Provide error messages and full tracebacks. > > Cheers, > Chris > --http://blog.rebertia.com these are errors : Tr

Re: Confessions of a Python fanboy

2009-07-31 Thread Xavier Ho
On Fri, Jul 31, 2009 at 6:38 PM, Chris Rebert wrote: > No, because it has a name, namely "goBig"; this obviously prevents it > from being "anonymous". > > For comparison, note how the function in the following example is > never given a name, and is thus anonymous: > >>> (lambda x: x+5)(6) > 11 >

Re: Does python have the capability for driver development ?

2009-07-31 Thread Hendrik van Rooyen
On Thursday 30 July 2009 15:20:45 Dave Angel wrote: > As far as I know, nobody has yet built a microcode implementation of a > Python VM (Virtual Machine). Nor have I seen one for the Java VM. Atmel has made an ARM that has support for Java Bytecode. AT91SAM9X512 and friends (smaller versions)

Re: If Scheme is so good why MIT drops it?

2009-07-31 Thread greg
Hendrik van Rooyen wrote: The COBOL source was more obscure, as any jump could have been altered, and you could not see that until you have read further on in the program, where the ALTER statement was. Well, in Python you can pretty much replace any function with any other function, so you can

RE: Run pyc file without specifying python path ?

2009-07-31 Thread Barak, Ron
> -Original Message- > From: Dave Angel [mailto:[email protected]] > Sent: Thursday, July 30, 2009 16:03 > To: Barak, Ron > Cc: 'Dave Angel'; '[email protected]' > Subject: RE: Run pyc file without specifying python path ? > > Barak, Ron wrote: > >> -Original Message

Re: Use existing IE cookie

2009-07-31 Thread KB
Winner, winner, chicken dinner... resolved. http://wwwsearch.sourceforge.net/mechanize/doc.html import mechanize cj = mechanize.MSIECookieJar(delayload=True) cj.load_from_registry() # finds cookie index file from registry Thanks Mr Lee! -- http://mail.python.org/mailman/listinfo/python-list

Re: Processes not exiting

2009-07-31 Thread ma3mju
Sorry ###fortran call### is meant to be ###fortran call### Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: How to "gunzip-iterate" over a file?

2009-07-31 Thread kj
Robert, Paul, thanks. That was just what I was looking for. kynn -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-31 Thread Jean-Michel Pichavant
r wrote: The purpose of his thread was to get feedback on how Python and Ruby ideas could be cumulated into the best high level language. And being that i am the BDFL of the "Confessions of a Python Fanboy" thread, you have my personal permission to continue on with this subject matter..., Ch

Re: How to force SAX parser to ignore encoding problems

2009-07-31 Thread Łukasz
On 31 Lip, 09:28, Łukasz wrote: > Hi, > I have a problem with my XML parser (created with libraries from > xml.sax package). When parser finds a invalid character (in CDATA > section) for example , After sending this message I noticed that example invalid characters are not displaying on some pla

file comparison

2009-07-31 Thread learner learner
Hi all, I want to compare two text files line by line and eliminate the matching/repeated line and store the unmatched/leftout lines into a third file or overwrite into one of them. regards -- http://mail.python.org/mailman/listinfo/python-list

Re: file comparison

2009-07-31 Thread Xavier Ho
On Fri, Jul 31, 2009 at 7:25 PM, learner learner wrote: > Hi all, > > I want to compare two text files line by line and eliminate the > matching/repeated line and store the unmatched/leftout lines into a third > file or overwrite into one of them. > Sounds like homework to me. Why not look into:

Re: Python 2.6 in shared/VPS environment

2009-07-31 Thread northof40
Ignore this question. Managed to get Amazon Web Services going and have installed Python 2.6 on there. Thanks for your eyeballs time. On Jul 31, 7:09 pm, northof40 wrote: > Hi - I'd really like to have access to Python 2.6 to try something > out. It needs to be on Linux/Unix machine. I don't mind

Re: file comparison

2009-07-31 Thread Gerhard Häring
learner learner wrote: > Hi all, > > I want to compare two text files line by line and eliminate the > matching/repeated line and store the unmatched/leftout lines into a > third file or overwrite into one of them. gl & hf! -- http://mail.python.org/mailman/listinfo/python-list

Re: file comparison

2009-07-31 Thread Chris Rebert
On Fri, Jul 31, 2009 at 2:25 AM, learner learner wrote: > Hi all, > > I want to compare two text files line by line and eliminate the > matching/repeated line and store the unmatched/leftout lines into a third > file or overwrite into one of them. See the `difflib` module: http://docs.python.org/l

Re: Generators through the C API

2009-07-31 Thread Duncan Booth
Lucas P Melo wrote: > Hello, I'm a total noob about the C API. Is there any way to create a > generator function using the C API? I couldn't find anything like the > 'yield' keyword in it. > > Thanks in advance. You define a new type with tp_flags including Py_TPFLAGS_HAVE_ITER. Anything tha

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 10:25 , Chris Rebert wrote: On Fri, Jul 31, 2009 at 1:21 AM, Xavier Ho wrote: On Fri, Jul 31, 2009 at 6:08 PM, Masklinn wrote: ... but since Python doesn't have anonymous functions that usage tends to be a bit too verbose ... Sorry to interrupt, but wouldn't lambda

Re: Confessions of a Python fanboy

2009-07-31 Thread Iain King
On Jul 31, 8:28 am, Steven D'Aprano wrote: > On Thu, 30 Jul 2009 18:06:31 -0500, Robert Kern wrote: > > On 2009-07-30 16:44, r wrote: > >> On Jul 30, 4:29 pm, Emmanuel Surleau wrote: > 1.) No need to use "()" to call a function with no arguments. Python > -->  "obj.m2().m3()" --ugly > >>

Re: problem on socket programming

2009-07-31 Thread Piet van Oostrum
> MalC0de (M) wrote: >M> On Jul 31, 12:07 pm, Chris Rebert wrote: >>> On Fri, Jul 31, 2009 at 1:02 AM, MalC0de wrote: >>> > now I've been encountered to some errors with this snippet : >>> >>> And these errors are? Provide error messages and full tracebacks. >>> >>> Cheers, >>> Chris >>> -

Re: Processes not exiting

2009-07-31 Thread Piet van Oostrum
> ma3mju (m) wrote: >m> Hi all, >m> I'm having trouble with multiprocessing I'm using it to speed up some >m> simulations, I find for large queues when the process reaches the >m> poison pill it does not exit whereas for smaller queues it works >m> without any problems. Has anyone else had th

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 11:54 , Iain King wrote: On Jul 31, 8:28 am, Steven D'Aprano wrote: On Thu, 30 Jul 2009 18:06:31 -0500, Robert Kern wrote: On 2009-07-30 16:44, r wrote: On Jul 30, 4:29 pm, Emmanuel Surleau wrote: 1.) No need to use "()" to call a function with no arguments. Python -->

Re: Processes not exiting

2009-07-31 Thread MRAB
ma3mju wrote: Hi all, I'm having trouble with multiprocessing I'm using it to speed up some simulations, I find for large queues when the process reaches the poison pill it does not exit whereas for smaller queues it works without any problems. Has anyone else had this trouble? Can anyone tell m

Re: file comparison

2009-07-31 Thread Hendrik van Rooyen
On Friday 31 July 2009 11:25:17 learner learner wrote: > Hi all, > > I want to compare two text files line by line and eliminate the > matching/repeated line and store the unmatched/leftout lines into a third > file or overwrite into one of them. This is not as simple as it seems. You will probab

Re: problem on socket programming

2009-07-31 Thread Diez B. Roggisch
MalC0de schrieb: On Jul 31, 12:07 pm, Chris Rebert wrote: On Fri, Jul 31, 2009 at 1:02 AM, MalC0de wrote: now I've been encountered to some errors with this snippet : And these errors are? Provide error messages and full tracebacks. Cheers, Chris --http://blog.rebertia.com these are errors

Re: problem on socket programming

2009-07-31 Thread Diez B. Roggisch
MalC0de schrieb: On Jul 31, 12:07 pm, Chris Rebert wrote: On Fri, Jul 31, 2009 at 1:02 AM, MalC0de wrote: now I've been encountered to some errors with this snippet : And these errors are? Provide error messages and full tracebacks. Cheers, Chris --http://blog.rebertia.com these are errors

Re: Confessions of a Python fanboy

2009-07-31 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: That and the fact that I couldn't stop laughing for long enough to learn any more when I read in the Pragmatic Programmer's Guide that "Ruby, unlike less flexible languages, lets you alter the value of a constant." Ye

Re: Confused About Python Loggin

2009-07-31 Thread Jannik Sundø
Hi all. I think I fixed this problem by setting fileLogger.propagate = 0. Otherwise it will propagate up to the root logger, which outputs to stdout, as far as I can understand. On 31 Jul 2009, at 01:17, Jannik Sundø wrote: Dear all, I am quite confused about the Python logging. I have read

Re: problem on socket programming

2009-07-31 Thread MalC0de
you want to say shall i disable the firewall, there's no specific firewall or IPS/IDS system out there, this is just windows xp firewall -- http://mail.python.org/mailman/listinfo/python-list

Re: problem on socket programming

2009-07-31 Thread Diez B. Roggisch
MalC0de schrieb: you want to say shall i disable the firewall, there's no specific firewall or IPS/IDS system out there, this is just windows xp firewall Which is a firewall, don't you agree? So it could well be the reason for the problems you see. Diez -- http://mail.python.org/mailman/lis

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 13:38 , Bruno Desthuilliers wrote: Steven D'Aprano a écrit : On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: That and the fact that I couldn't stop laughing for long enough to learn any more when I read in the Pragmatic Programmer's Guide that "Ruby, unlike less flexibl

Re: Confused About Python Loggin

2009-07-31 Thread Vinay Sajip
On Jul 31, 12:41 pm, Jannik Sundø wrote: > Hi all. I think I fixed this problem by setting fileLogger.propagate =   > 0. Otherwise it will propagate up to the root logger, which outputs to   > stdout, as far as I can understand. > Only if you specifically configure it to do so - for example, call

Re: problem on socket programming

2009-07-31 Thread MalC0de
no, I disabled my firewall, no problem with even enabled firewall ... no one can help !? -- http://mail.python.org/mailman/listinfo/python-list

Re: file comparison

2009-07-31 Thread Dave Angel
Hendrik van Rooyen wrote: On Friday 31 July 2009 11:25:17 learner learner wrote: Hi all, I want to compare two text files line by line and eliminate the matching/repeated line and store the unmatched/leftout lines into a third file or overwrite into one of them. This is not as simple

Re: Confused About Python Loggin

2009-07-31 Thread Jean-Michel Pichavant
Jannik Sundø wrote: Hi all. I think I fixed this problem by setting fileLogger.propagate = 0. Otherwise it will propagate up to the root logger, which outputs to stdout, as far as I can understand. On 31 Jul 2009, at 01:17, Jannik Sundø wrote: Dear all, I am quite confused about the Python l

Re: problem on socket programming

2009-07-31 Thread MRAB
MalC0de wrote: no, I disabled my firewall, no problem with even enabled firewall ... no one can help !? I hope you disconnected your computer from the internet before disabling the firewall... -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-31 Thread Bruno Desthuilliers
Masklinn a écrit : On 31 Jul 2009, at 13:38 , Bruno Desthuilliers wrote: Steven D'Aprano a écrit : On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: That and the fact that I couldn't stop laughing for long enough to learn any more when I read in the Pragmatic Programmer's Guide that "Ruby,

Re: problem on socket programming

2009-07-31 Thread Processor-Dev1l
On Jul 31, 2:37 pm, MalC0de wrote: > no, I disabled my firewall, no problem with even enabled firewall ... > no one can help !? Connection refused... connection was refused by the listening socket, it could also be due to the settings of your service, if it accepts only from localhost to localhos

Re: Run pyc file without specifying python path ?

2009-07-31 Thread Processor-Dev1l
On Jul 30, 4:47 pm, "Barak, Ron" wrote: > > -Original Message- > > From: Dave Angel [mailto:[email protected]] > > Sent: Thursday, July 30, 2009 16:03 > > To: Barak, Ron > > Cc: 'Dave Angel'; '[email protected]' > > Subject: RE: Run pyc file without specifying python path ? > >

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 15:12 , Bruno Desthuilliers wrote: Masklinn a écrit : On 31 Jul 2009, at 13:38 , Bruno Desthuilliers wrote: Steven D'Aprano a écrit : On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: That and the fact that I couldn't stop laughing for long enough to learn any more when

Re: fast video encoding

2009-07-31 Thread Scott David Daniels
gregorth wrote: for a scientific application I need to save a video stream to disc for further post processing. My cam can deliver 8bit grayscale images with resolution 640x480 with a framerate up to 100Hz, this is a data rate of 30MB/s. Writing the data uncompressed to disc hits the data transfe

Re: problem on socket programming

2009-07-31 Thread MalC0de
none of you can't interpret it ? do you have errors like me !? -- http://mail.python.org/mailman/listinfo/python-list

supported versions policy?

2009-07-31 Thread Gary Wilson
Does Python have a formal policy on the support lifetime (bug fixes, security fixes, etc.) for major and minor versions? I did a bit of searching on the Python web site and this group, but didn't find anything. If there is a policy posted somewhere (and I just didn't dig deep enough), would someo

Re: Test for Pythonwin?

2009-07-31 Thread Roger Miller
On Jul 31, 2:09 am, "steve" wrote: > Is there a good way to check if a script is running inside Pythonwin? > Perhaps a property or method that is exposed by that environment? I've used if sys.stdin.fileno() < 0: This is not precisely a test for pythonwin, but indicates whether standard streams

Re: Confessions of a Python fanboy

2009-07-31 Thread Ethan Furman
Steven D'Aprano wrote: On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: That and the fact that I couldn't stop laughing for long enough to learn any more when I read in the Pragmatic Programmer's Guide that "Ruby, unlike less flexible languages, lets you alter the value of a constant." Yep,

Re: Regexp problem

2009-07-31 Thread Ethan Furman
MRAB wrote: Ethan Furman wrote: Marcus Wanner wrote: Wow, I really need to learn more about regexp... Any tutorials you guys can recommend? Marcus Mastering Regular Expressions Powerful Techniques for Perl and Other Tools By Jeffrey E. F. Friedl Great book! +1 I have the first edition,

Re: Confessions of a Python fanboy

2009-07-31 Thread Iain King
On Jul 31, 4:08 pm, Ethan Furman wrote: > Steven D'Aprano wrote: > > On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: > > >>That and the fact that I couldn't stop laughing for long enough to learn > >>any more when I read in the Pragmatic Programmer's Guide that "Ruby, > >>unlike less flexible

Re: Confessions of a Python fanboy

2009-07-31 Thread Benjamin Kaplan
On Fri, Jul 31, 2009 at 11:35 AM, Iain King wrote: > On Jul 31, 4:08 pm, Ethan Furman wrote: >> Steven D'Aprano wrote: >> > On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: >> >> >>That and the fact that I couldn't stop laughing for long enough to learn >> >>any more when I read in the Pragmati

Re: Confessions of a Python fanboy

2009-07-31 Thread Steven D'Aprano
On Fri, 31 Jul 2009 13:38:56 +0200, Bruno Desthuilliers wrote: >> On the other hand, we don't have to prefix names with @ and @@, > > Nope, we have to prefix them with 'self' or 'cls' (or even > 'self.__class__'). Incorrect. >>> class K: ... class_attribute = 'No @@ required.' ... >>> K().c

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 17:55 , Steven D'Aprano wrote: But seriously, while I admit that I have very little Ruby experience, and so aren't in a great position to judge, it seems to me that Ruby doesn't have anything like Python's over-riding design principles (the Zen). If there is a design prin

Re: Confessions of a Python fanboy

2009-07-31 Thread Terry Reedy
Masklinn wrote: #each is simply a method that takes a function (called blocks in ruby). One could call it a higher-order method I guess. It's an implementation of the concept of internal iteration: instead of collections yielding iterator objects, and programmers using those through speciall

Re: os.path.exists() and Samba shares

2009-07-31 Thread BDZ
On Jul 30, 4:41 pm, Loïc Domaigné wrote: > Hi, > > > Hello. I have written a Python 3.1 script running on Windows that uses > > os.path.exists() to connect to network shares. If the various network > > shares require different user account and password combos than the > > account the script is run

Re: supported versions policy?

2009-07-31 Thread Terry Reedy
Gary Wilson wrote: Does Python have a formal policy on the support lifetime (bug fixes, security fixes, etc.) for major and minor versions? I did a bit of searching on the Python web site and this group, but didn't find anything. If there is a policy posted somewhere (and I just didn't dig deep

threads check socket

2009-07-31 Thread NighterNet
I been trying to find a way to check the socket is open or not. The thread are in a group and loop if the sockets are open. If they are not open delete the thread and remove the group. I need on this. -- http://mail.python.org/mailman/listinfo/python-list

Re: fast video encoding

2009-07-31 Thread David Bolen
gregorth writes: > I am a novice with video encoding. I found that few codecs support > gray scale images. Any hints to take advantage of the fact that I only > have gray scale images? I don't know that there's any good way around the fact that video encoding is simply one of the heavier CPU-bou

Re: Confessions of a Python fanboy

2009-07-31 Thread Tim Rowe
2009/7/31 Steven D'Aprano : > On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: > >> That and the fact that I couldn't stop laughing for long enough to learn >> any more when I read in the Pragmatic Programmer's Guide that "Ruby, >> unlike less flexible languages, lets you alter the value of a co

Re: Confessions of a Python fanboy

2009-07-31 Thread Falcolas
On Jul 31, 3:49 am, Masklinn wrote: > On 31 Jul 2009, at 10:25 , Chris Rebert wrote:> On Fri, Jul 31, 2009 at 1:21 > AM, Xavier Ho   > > wrote: > >> On Fri, Jul 31, 2009 at 6:08 PM, Masklinn   > >> wrote: > > >>> ... but since Python doesn't have anonymous functions that   > >>> usage > >>> tend

Re: Help understanding the decisions *behind* python?

2009-07-31 Thread Joshua Bronson
On Jul 22, 7:55 am, Duncan Booth wrote: > I find it interesting that the heapq functions tell you in the > documentation that they aren't suitable for use where n==1 or where n is > near the total size of the sequence whereas random.sample() chooses what it > thinks is the best algorithm based on

Re: threads check socket

2009-07-31 Thread Gabriel Genellina
En Fri, 31 Jul 2009 13:35:10 -0300, NighterNet escribió: I been trying to find a way to check the socket is open or not. The thread are in a group and loop if the sockets are open. If they are not open delete the thread and remove the group. I need on this. What means an "open socket"? Do y

Re: threads check socket

2009-07-31 Thread Marcus Wanner
On 7/31/2009 12:35 PM, NighterNet wrote: I been trying to find a way to check the socket is open or not. The thread are in a group and loop if the sockets are open. If they are not open delete the thread and remove the group. I need on this. Being a bit more specific would help. Are you using t

Re: file comparison

2009-07-31 Thread Gabriel Genellina
En Fri, 31 Jul 2009 06:25:17 -0300, learner learner escribió: I want to compare two text files line by line and eliminate the matching/repeated line and store the unmatched/leftout lines into a third file or overwrite into one of them. Look at the difflib module: http://docs.python.org/libr

Re: Help understanding the decisions *behind* python?

2009-07-31 Thread Raymond Hettinger
On Jul 22, 4:55 am, Duncan Booth wrote: > Steven D'Aprano wrote: > > But that's the wrong solution to the problem. The OP wants the largest > > (or smallest) item, which he expects to get by sorting, then grabbing > > the first element: > > > sorted(alist)[0] > > > That requires sorting the entir

Re: threads check socket

2009-07-31 Thread NighterNet
On Jul 31, 10:23 am, "Gabriel Genellina" wrote: > En Fri, 31 Jul 2009 13:35:10 -0300, NighterNet   > escribió: > > > I been trying to find a way to check the socket is open or not. The > > thread are in a group and loop if the sockets are open. If they are > > not open delete the thread and remov

heapq "key" arguments

2009-07-31 Thread Joshua Bronson
According to http://docs.python.org/library/heapq.html, Python 2.5 added an optional "key" argument to heapq.nsmallest and heapq.nlargest. I could never understand why they didn't also add a "key" argument to the other relevant functions (heapify, heappush, etc). Say I want to maintain a heap of (x

Re: Help understanding the decisions *behind* python?

2009-07-31 Thread Raymond Hettinger
On Jul 20, 9:27 am, Phillip B Oldham wrote: > Specifically the "differences" between lists and tuples have us > confused and have caused many "discussions" in the office. We > understand that lists are mutable and tuples are not, but we're a > little lost as to why the two were kept separate from

Re: heapq "key" arguments

2009-07-31 Thread Jonathan Gardner
On Jul 31, 10:44 am, Joshua Bronson wrote: > Say I want to maintain a heap of (x, y) pairs sorted only by > first coordinate. Without being able to pass key=itemgetter(0), won't > heapifying a list of such pairs unnecessarily compare both > coordinates? It will compare the second value only if th

base64 Incorrect Padding

2009-07-31 Thread Brandon Fredericks
I did a search within this group, but couldn't find any information on this. I am sending base64 encoded data as the content over http using urllib2 urlopen. When I receive the data and attempt to decode it, I get an "Incorrect Padding" error. Is there a simple way to fix this? A better way to sen

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 18:24 , Terry Reedy wrote: Masklinn wrote: #each is simply a method that takes a function (called blocks in ruby). One could call it a higher-order method I guess. It's an implementation of the concept of internal iteration: instead of collections yielding iterator objects

Re: Confessions of a Python fanboy

2009-07-31 Thread Steven D'Aprano
On Fri, 31 Jul 2009 18:15:15 +0200, Masklinn wrote: > > I know, I know, Ruby people swear by > > anonymous code blocks, and I've read Paul Graham too. But I'm really > > not so sure that the benefits of anonymous code blocks are great > > enough to overcome the disadvantages of anonymous code bloc

Newbie Question regarding __init__()

2009-07-31 Thread Simon
Hi I want to create an instance of dcCursor which inherits from dcObject. When I run the following code it gives the error shown. Can some explain to me what is wrong? I have included the dcObject.py and dcCursor.py below. >>>import dcObject >>> import dcCursor >>> x = dcCursor.dcCursor() Traceb

Re: Printing with colors in a portable way

2009-07-31 Thread Nobody
On Thu, 30 Jul 2009 15:40:37 -0700, Robert Dailey wrote: > Anyone know of a way to print text in Python 3.1 with colors in a > portable way? In other words, I should be able to do something like > this: > > print_color( "This is my text", COLOR_BLUE ) > > And this should be portable (i.e. it sho

Re: Newbie Question regarding __init__()

2009-07-31 Thread MRAB
Simon wrote: Hi I want to create an instance of dcCursor which inherits from dcObject. When I run the following code it gives the error shown. Can some explain to me what is wrong? I have included the dcObject.py and dcCursor.py below. import dcObject import dcCursor x = dcCursor.dcCursor()

.dbf tables and Null

2009-07-31 Thread Ethan Furman
Mornin'! and a good one, too, I hope. Question for you... First part of the question: What is the general value in having Null capability for fields? Second part: Is there a tangible difference between Null, and the nothing of 0, '', False, etc, in python? Third part: If there is a tan

Re: Confessions of a Python fanboy

2009-07-31 Thread Emmanuel Surleau
On Friday 31 July 2009 18:54:23 Tim Rowe wrote: > 2009/7/31 Steven D'Aprano : > > On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: > >> That and the fact that I couldn't stop laughing for long enough to learn > >> any more when I read in the Pragmatic Programmer's Guide that "Ruby, > >> unlike l

Re: Help understanding the decisions *behind* python?

2009-07-31 Thread Emmanuel Surleau
On Friday 31 July 2009 19:49:04 Raymond Hettinger wrote: > On Jul 20, 9:27 am, Phillip B Oldham wrote: > > Specifically the "differences" between lists and tuples have us > > confused and have caused many "discussions" in the office. We > > understand that lists are mutable and tuples are not, but

Re: base64 Incorrect Padding

2009-07-31 Thread Peter Otten
Brandon Fredericks wrote: > I did a search within this group, but couldn't find any information on > this. > > I am sending base64 encoded data as the content over http using > urllib2 urlopen. When I receive the data and attempt to decode it, I > get an "Incorrect Padding" error. Is there a simp

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 20:17 , Steven D'Aprano wrote: On Fri, 31 Jul 2009 18:15:15 +0200, Masklinn wrote: I know, I know, Ruby people swear by anonymous code blocks, and I've read Paul Graham too. But I'm really not so sure that the benefits of anonymous code blocks are great enough to overcome the

Re: Help understanding the decisions *behind* python?

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 20:48 , Emmanuel Surleau wrote: On Friday 31 July 2009 19:49:04 Raymond Hettinger wrote: On Jul 20, 9:27 am, Phillip B Oldham wrote: Specifically the "differences" between lists and tuples have us confused and have caused many "discussions" in the office. We understand that

Re: heapq "key" arguments

2009-07-31 Thread Joshua Bronson
On Jul 31, 2:02 pm, Jonathan Gardner wrote: > On Jul 31, 10:44 am, Joshua Bronson wrote: > > > Say I want to maintain a heap of (x, y) pairs sorted only by > > first coordinate. Without being able to pass key=itemgetter(0), won't > > heapifying a list of such pairs unnecessarily compare both > >

  1   2   >