pyvm 3.0

2010-08-02 Thread Nikos Fotoulis
We are humble to announce that pyvm has reached milestone version 3.0. The URL is: http://students.ceid.upatras.gr/~sxanth/pyvm-3.0/ The pyvm project explores an alternative direction in the use of dynamic languages (based on the python model) for the construction of a full userspace

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-08-02 Thread Michele Simionato
On Jul 31, 5:08 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: I have read Michelle Simionato's articles on super in Python. One l please! I am a man! ;-) But Michelle is wrong to conclude that the problem lies with the concept of *superclass*. The problem lies with the

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-08-02 Thread Paul Rubin
Michele Simionato michele.simion...@gmail.com writes: I am actually more radical than that. From http://www.artima.com/weblogs/viewpost.jsp?thread=237121: In this series I have argued that super is tricky; I think nobody can... When I look at that URL, I see a Java stack dump:

Re: Trying to set a cookie within a python script

2010-08-02 Thread Νίκος
If you just click in my web page to see the script run in action due to the cgitb module i use it will provide you both the source code that the error appears and the error as well. All you have to do is click here: http://www.webville.gr/cgi-bin/koukos.py As for the encoding why when i print

RE: The untimely dimise of a weak-reference

2010-08-02 Thread Vincent van Beveren
Hi Gregory, You can create your own wrapper that keeps a weak reference to the underlying object. Here's an example. [...] Thanks for the code! Regards, Vincent -- http://mail.python.org/mailman/listinfo/python-list

RE: The untimely dimise of a weak-reference

2010-08-02 Thread Vincent van Beveren
Hi Christiaan, Instances of a class have no means of storing the bound method object. The or unbound bound method is a simple and small wrapper that keeps a reference to the class, self and the function object. Python keeps a pool of empty method objects in a free list. The creation of a

sending a file chunk by chunk instead as a whole to a web server

2010-08-02 Thread Sanjeeb
Hi, I have a web client which send a file to a server as multipart form data, the sending of data is from http://code.activestate.com/recipes/146306-http-client-to-post-using-multipartform-data/. I dont want to open the whole file to memory(at cliend end) and then send, i just want to send part

Re: Merging two dictionaries

2010-08-02 Thread Gary Herron
On 08/01/2010 11:11 PM, Douglas Garstang wrote: On Sun, Aug 1, 2010 at 10:58 PM, Gary Herrongher...@islandtraining.com wrote: On 08/01/2010 10:09 PM, Douglas Garstang wrote: Anyone, I have the two dictionaries below. How can I merge them, such that: 1. The cluster dictionary

Re: Merging two dictionaries

2010-08-02 Thread Douglas Garstang
On Sun, Aug 1, 2010 at 11:57 PM, Gary Herron gher...@islandtraining.com wrote: On 08/01/2010 11:11 PM, Douglas Garstang wrote: On Sun, Aug 1, 2010 at 10:58 PM, Gary Herrongher...@islandtraining.com  wrote: On 08/01/2010 10:09 PM, Douglas Garstang wrote: Anyone, I have the two

Re: Merging two dictionaries

2010-08-02 Thread Chris Rebert
On Mon, Aug 2, 2010 at 12:06 AM, Douglas Garstang doug.garst...@gmail.com wrote: Actually, I had issues with trying recurse through the structures in tandem too. This didn't work: for a,b,c,d in ( cluster.iteritems(), default.iteritems() ):    ... do something ... It returns an unpack

Re: Merging two dictionaries

2010-08-02 Thread Paul Rubin
Douglas Garstang doug.garst...@gmail.com writes: default = {... 'data_sources': { ... cluster = {... 'data_source': { ... Did you want both of those to say the same thing instead of one of them being 'data_source' and the other 'data_sources' ? If yes, then

Re: How to catch windows shutdown/reboot message

2010-08-02 Thread Tim Golden
On 02/08/2010 02:17, rechardchen wrote: I'm writing a python script which runs as a windowsxp service. The problem is how to catch the windows shutdown/reboot message and do some cleaning job when system is going down? The atexit module and signal module on windows dont seems to work. I guess

Re: Problem with Elementtree and XMLSchem instance type

2010-08-02 Thread NewBlue
Lawrence == Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: Lawrence In message Lawrence mailman.1339.1280496494.1673.python-l...@python.org, Lawrence Roland Lawrence Hedberg wrote: And there is the problem, I've lost the coupling between the prefix 'fed'

Re: Merging two dictionaries

2010-08-02 Thread Peter Otten
Douglas Garstang wrote: I have the two dictionaries below. How can I merge them, such that: 1. The cluster dictionary contains the additional elements from the default dictionary. 2. Nothing is removed from the cluster dictionary. def inplace_merge(default, cluster): assert

Re: How to capture all the environment variables from shell?

2010-08-02 Thread Thorsten Kampe
* Tim Chase (Mon, 26 Jul 2010 21:42:24 -0500) On 07/26/10 21:26, Steven W. Orr wrote: Please! Never export anything from your .bashrc unless you really know what you're doing. Almost all exports should be done in your .bash_profile Could you elaborate on your reasoning why (or why-not)?

Re: Access stdout from external program.

2010-08-02 Thread Jean-Michel Pichavant
Paul Lemelle wrote: Hi JM, My last dumb question: When I try to run the below script as an executable, I get the following error: ptt...@ptttestvm:~$ ./argv.py 4 import: unable to open X server `/tmp/launch-c8feFG/org.x:0' @ import.c/ImportImageCommand/361. ./argv.py: line 8: syntax error

Capturing running Application

2010-08-02 Thread S.Selvam
Hi all, I am using python 2.6(running ubuntu 9.10 ). I want to display the amount of time spent( by an user) among all the running applications like Gedit, Firefox, GIMP and display the result graphically. For eg: Firefox: 60% Gedit:25% Terminal:15% I think, i need to capture the currently

Re: Why is python not written in C++ ?

2010-08-02 Thread Tim Wintle
On Sun, 2010-08-01 at 20:01 -0400, Terry Reedy wrote: Not every C programmer knows or wants to learn C++. I think Terry is the only person that's mentioned this - but I'd like to give extra support to it - I for one prefer C to C++ (as someone that writes quite a lot of C extension modules).

Re: The untimely dimise of a weak-reference

2010-08-02 Thread Bruno Desthuilliers
Gregory Ewing a écrit : (snip) import weakref class weakmethod(object): def __init__(self, bm): self.ref = weakref.ref(bm.im_self) self.func = bm.im_func def __call__(self, *args, **kwds): obj = self.ref() if obj is None: raise ValueError(Calling dead weak method)

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-08-02 Thread Jean-Michel Pichavant
Paul Rubin wrote: Michele Simionato michele.simion...@gmail.com writes: I am actually more radical than that. From http://www.artima.com/weblogs/viewpost.jsp?thread=237121: In this series I have argued that super is tricky; I think nobody can... When I look at that URL, I see a Java

Re: Trying to set a cookie within a python script

2010-08-02 Thread Steven D'Aprano
On Sun, 01 Aug 2010 23:39:34 -0700, Νίκος wrote: If you just click in my web page to see the script run in action due to the cgitb module i use it will provide you both the source code that the error appears and the error as well. All you have to do is click here:

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-08-02 Thread Steven D'Aprano
On Sun, 01 Aug 2010 23:15:11 -0700, Michele Simionato wrote: On Jul 31, 5:08 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: I have read Michelle Simionato's articles on super in Python. One l please! I am a man! ;-) My apologies. You'd think I would know the difference

Re: Normalizing A Vector

2010-08-02 Thread Bartc
Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote in message news:877hkdhyl5@dpt-info.u-strasbg.fr... Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: Say a vector V is a tuple of 3 numbers, not all zero. You want to normalize it (scale all components by the same factor) so

Re: Normalizing A Vector

2010-08-02 Thread Alain Ketterlin
Bartc ba...@freeuk.com writes: def norm(V): L = math.sqrt( sum( [x**2 for x in V] ) ) return [ x/L for x in V ] There's a cost involved in using those fancy constructions. Sure. The above has three loops that take some time. I found the following to be about twice as fast, when

python3: signal.signal/singal.alarm not working as expected

2010-08-02 Thread Alan
Hi there, I have this example code to illustrate a problem I am having with python3. It works fine with python 2.6 and 2.7 but does not with python 3.1. Please, can someone tell me why or how to fix this example? from __future__ import print_function import os, subprocess, signal def

Re: Normalizing A Vector

2010-08-02 Thread Bartc
Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote in message news:87fwyxgvuv@dpt-info.u-strasbg.fr... Bartc ba...@freeuk.com writes: def norm3d(v): L = math.sqrt((v[0]*v[0]+v[1]*v[1]+v[2]*v[2])) return (v[0]/L,v[1]/L,v[2]/L) (Strangely, changing those divides to multiplies made

Re: beginner python GUI question

2010-08-02 Thread Chris Hare
On Aug 1, 2010, at 8:33 PM, rechardchen wrote: 于 2010-8-2 6:15, Chris Hare 写道: I hope I can explain this correctly. I have a GUI, which is already being processed by a mainloop. I want to be able to open a second window so the user can interact with specific information in the second

run subprocesses in parallel

2010-08-02 Thread Santiago Caracol
Hello, I want to run several subprocesses. Like so: p1 = Popen(mycmd1 + myarg, shell=True) p2 = Popen(mycmd2 + myarg, shell=True) ... pn = Popen(mycmdn + myarg, shell=True) What would be the most elegant and secure way to run all n subprocesses in parallel? Santiago --

Re: run subprocesses in parallel

2010-08-02 Thread Christian Heimes
I want to run several subprocesses. Like so: p1 = Popen(mycmd1 + myarg, shell=True) p2 = Popen(mycmd2 + myarg, shell=True) pn = Popen(mycmdn + myarg, shell=True) What would be the most elegant and secure way to run all n subprocesses in parallel? They already run in parallel.

Re: beginner python GUI question

2010-08-02 Thread Peter Otten
Chris Hare wrote: root = Tk() root.title = test I should think it would work, but I don't understand why it doesn't. Try root.title(test) title() is a method that you are hiding with your attribute leading to problems later on. By the way, what kind of documentation are you using for

Re: How to catch windows shutdown/reboot message

2010-08-02 Thread rechardchen
于 2010-8-2 16:00, Tim Golden 写道: On 02/08/2010 02:17, rechardchen wrote: I'm writing a python script which runs as a windowsxp service. The problem is how to catch the windows shutdown/reboot message and do some cleaning job when system is going down? The atexit module and signal module on

Re: Trying to set a cookie within a python script

2010-08-02 Thread Νίκος
Steven, First of all thank you for your response. I cant beleive i neglected to import the time module! The only reason that i asked you guys to follow the link was for you to see the actualt coding and error report as python produces it by itself with all the relative characteristics. Of course

Re: beginner python GUI question

2010-08-02 Thread Chris Hare
On Aug 2, 2010, at 7:25 AM, Peter Otten wrote: Chris Hare wrote: root = Tk() root.title = test I should think it would work, but I don't understand why it doesn't. Try root.title(test) title() is a method that you are hiding with your attribute leading to problems later on.

Re: Mechanize - save to XML or CSV

2010-08-02 Thread Simon Brunning
On 2 August 2010 14:13, flebber flebber.c...@gmail.com wrote: HI guys and gals this is probably a simple question but I can't find the answer directly in the docs for python mechanize. http://pypi.python.org/pypi/mechanize/ Is it possible to retrieve and save a web page data as xml or a csv

Re: Why is python not written in C++ ?

2010-08-02 Thread Grant Edwards
On 2010-08-02, Christian Heimes li...@cheimes.de wrote: In your opinion what would Python gain from a C++ implementation? Greater buzzword-compliance -- an important characteristic highly prized by Human-Resources poeple and mid-level managers here in the US. ;) -- Grant --

AMY JACKSON HOT PICTURES including upcoming movies, biography,

2010-08-02 Thread amyjack1
AMY JACKSON HOT PICTURES including upcoming movies, biography, http://amyjacksons.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is there no platform independent way of clearing a terminal?

2010-08-02 Thread Mark Lawrence
On 01/08/2010 12:10, Lawrence D'Oliveiro wrote: In messagemailman.1383.1280649150.1673.python-l...@python.org, Mark Lawrence wrote: On 01/08/2010 08:18, Lawrence D'Oliveiro wrote: In messagemailman.1382.1280646210.1673.python-l...@python.org, Mark Lawrence wrote: On 01/08/2010 07:50,

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-08-02 Thread Mark Lawrence
On 02/08/2010 10:23, Jean-Michel Pichavant wrote: Paul Rubin wrote: Michele Simionato michele.simion...@gmail.com writes: I am actually more radical than that. From http://www.artima.com/weblogs/viewpost.jsp?thread=237121: In this series I have argued that super is tricky; I think nobody

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-08-02 Thread Mark Lawrence
On 02/08/2010 07:15, Michele Simionato wrote: On Jul 31, 5:08 am, Steven D'Apranost...@remove-this- cybersource.com.au wrote: I have read Michelle Simionato's articles on super in Python. One l please! I am a man! ;-) Please prove it, get your bits out!!! :) M. Simionato

Re: Why is there no platform independent way of clearing a terminal?

2010-08-02 Thread Benjamin Kaplan
On Mon, Aug 2, 2010 at 8:21 AM, Mark Lawrence breamore...@yahoo.co.ukwrote: On 01/08/2010 12:10, Lawrence D'Oliveiro wrote: In messagemailman.1383.1280649150.1673.python-l...@python.org, Mark Lawrence wrote: On 01/08/2010 08:18, Lawrence D'Oliveiro wrote: In

THANKS GOD! I GOT $2000 FROM PAYPAL....

2010-08-02 Thread paypal cash
THANKS GOD! I GOT $2000 FROM PAYPAL At http://ukcollegegirls.co.cc I have hidden the PayPal Form link in an image. in that website On Top Side Above search box , click on image and enter your PayPal id And Your name. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is python not written in C++ ?

2010-08-02 Thread David Cournapeau
On Mon, Aug 2, 2010 at 10:20 AM, Christian Heimes li...@cheimes.de wrote: In your opinion what would Python gain from a C++ implementation? The elusive advantages of OO in C++ are relatively minor compared to RIIA which would make reference counting much easier to deal with. But even that is

Re: Why is python not written in C++ ?

2010-08-02 Thread Thomas Jollans
On 08/02/2010 04:42 PM, Grant Edwards wrote: On 2010-08-02, Christian Heimes li...@cheimes.de wrote: In your opinion what would Python gain from a C++ implementation? Greater buzzword-compliance -- an important characteristic highly prized by Human-Resources poeple and mid-level managers

Re: Why is there no platform independent way of clearing a terminal?

2010-08-02 Thread Mark Lawrence
On 02/08/2010 16:41, Benjamin Kaplan wrote: On Mon, Aug 2, 2010 at 8:21 AM, Mark Lawrencebreamore...@yahoo.co.ukwrote: On 01/08/2010 12:10, Lawrence D'Oliveiro wrote: In messagemailman.1383.1280649150.1673.python-l...@python.org, Mark Lawrence wrote: On 01/08/2010 08:18, Lawrence

Re: Merging two dictionaries

2010-08-02 Thread Douglas Garstang
On Mon, Aug 2, 2010 at 12:47 AM, Paul Rubin no.em...@nospam.invalid wrote: Douglas Garstang doug.garst...@gmail.com writes: default = {...                 'data_sources': { ... cluster = {...                 'data_source': { ... Did you want both of those to say the same thing instead of

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-08-02 Thread Ethan Furman
Steven D'Aprano wrote: On Sat, 31 Jul 2010 13:29:25 +, Brian Victor wrote: Steven D'Aprano wrote: On Sat, 31 Jul 2010 14:25:39 +1200, Gregory Ewing wrote: Steven D'Aprano wrote: A / \ C B \ / D / \ E F Yes, a super call might jog left from C to

Re: Merging two dictionaries

2010-08-02 Thread Peter Otten
Douglas Garstang wrote: On Mon, Aug 2, 2010 at 12:47 AM, Paul Rubin no.em...@nospam.invalid wrote: If yes, then the following works for me: def merge(cluster, default): # destructively merge default into cluster for k,v in cluster.iteritems(): if k in default

Re: Why is there no platform independent way of clearing a terminal?

2010-08-02 Thread David Robinow
On Mon, Aug 2, 2010 at 11:41 AM, Benjamin Kaplan benjamin.kap...@case.edu wrote: ... So these are the packages needed just to run Python in Ubuntu. It doesn't include the packages required for the kernel, the desktop environment, the window manager, the terminal, and whatever else you want

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-08-02 Thread donn
On 02/08/2010 17:35, Mark Lawrence wrote: aka the colon. :) Ha. This is a case of the colon being the appendix! \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Merging two dictionaries

2010-08-02 Thread Douglas Garstang
On Mon, Aug 2, 2010 at 1:09 AM, Peter Otten __pete...@web.de wrote: Douglas Garstang wrote: I have the two dictionaries below. How can I merge them, such that: 1. The cluster dictionary contains the additional elements from the default dictionary. 2. Nothing is removed from the cluster

Re: run subprocesses in parallel

2010-08-02 Thread Nobody
On Mon, 02 Aug 2010 14:21:38 +0200, Christian Heimes wrote: You might want to drop shell=True and use a list as arguments instead. The two issues (whether shell is True/False and whether the command is a list or string) are orthogonal. You should always use a list for the command, unless you

Re: Accumulate function in python

2010-08-02 Thread Aahz
In article 7xpqyjgvjm@ruckus.brouhaha.com, Paul Rubin no.em...@nospam.invalid wrote: I think Peter Otten's solution involving a generator is the one most in the current Python spirit. It's cleaner (for my tastes) than the ones that use things like list.append. Agreed -- Aahz

Re: Merging two dictionaries

2010-08-02 Thread Paul Rubin
Douglas Garstang doug.garst...@gmail.com writes: where line 42 is 'assert type(default(k))==dict', and the inputs are: Woops, cut and paste error. default(k) should say default[k]. Or you could remove the assertion altogether. -- http://mail.python.org/mailman/listinfo/python-list

Behavior of re.split on empty strings is unexpected

2010-08-02 Thread John Nagle
The regular expression split behaves slightly differently than string split: import re kresplit = re.compile(r'[^\w\]+',re.UNICODE) kresplit2.split( HELLOTHERE ) ['', 'HELLO', 'THERE', ''] kresplit2.split(VERISIGN INC.) ['VERISIGN', 'INC', ''] I'd thought that split would never

constructing and using large lexicon in a program

2010-08-02 Thread Majdi Sawalha
Dear List members, I am developing a morphological analyzer that depends on a large lexicon. i construct a Lexicon class that reades a text file and construct a dictionary of the lexicon entries.  the other class will use the lexicon class to chech if the word is found in the lexicon. the

Re: constructing and using large lexicon in a program

2010-08-02 Thread Michael Torrie
On 08/02/2010 11:46 AM, Majdi Sawalha wrote: I am developing a morphological analyzer that depends on a large lexicon. i construct a Lexicon class that reades a text file and construct a dictionary of the lexicon entries. the other class will use the lexicon class to chech if the word is

Re: Behavior of re.split on empty strings is unexpected

2010-08-02 Thread MRAB
John Nagle wrote: The regular expression split behaves slightly differently than string split: import re kresplit = re.compile(r'[^\w\]+',re.UNICODE) kresplit2.split( HELLOTHERE ) ['', 'HELLO', 'THERE', ''] kresplit2.split(VERISIGN INC.) ['VERISIGN', 'INC', ''] I'd

Re: Behavior of re.split on empty strings is unexpected

2010-08-02 Thread Peter Otten
John Nagle wrote: The regular string split operation doesn't yield empty strings: HELLO THERE .split() ['HELLO', 'THERE'] Note that invocation without separator argument (or None as the separator) is special in that respect: hello there .split( ) ['', 'hello', 'there', ''] Peter

Re: Why is there no platform independent way of clearing a terminal?

2010-08-02 Thread Benjamin Kaplan
On Mon, Aug 2, 2010 at 9:51 AM, David Robinow drobi...@gmail.com wrote: On Mon, Aug 2, 2010 at 11:41 AM, Benjamin Kaplan benjamin.kap...@case.edu wrote: ... So these are the packages needed just to run Python in Ubuntu. It doesn't include the packages required for the kernel, the desktop

namespaces, scoping and variables

2010-08-02 Thread Chris Hare
I am having a problem getting around this variable namespace thing. Consider these code bits File a.py from Tkinter import * import a1 def doAgain(): x = a1.Net() x.show(Again!) root = Tk() root.title(test) f = Frame(root,bg=Yellow) l = Button(root,text=window

Re: Behavior of re.split on empty strings is unexpected

2010-08-02 Thread John Nagle
On 8/2/2010 11:02 AM, MRAB wrote: John Nagle wrote: The regular expression split behaves slightly differently than string split: occurrences of pattern, which is not too helpful. It's the plain str.split() which is unusual in that: 1. it splits on sequences of whitespace instead of one per

Re: namespaces, scoping and variables

2010-08-02 Thread Thomas Jollans
On 08/02/2010 09:33 PM, Chris Hare wrote: I am having a problem getting around this variable namespace thing. Consider these code bits File a.py from Tkinter import * import a1 def doAgain(): x = a1.Net() x.show(Again!) root = Tk() root.title(test) f =

Re: Behavior of re.split on empty strings is unexpected

2010-08-02 Thread Thomas Jollans
On 08/02/2010 09:41 PM, John Nagle wrote: On 8/2/2010 11:02 AM, MRAB wrote: John Nagle wrote: The regular expression split behaves slightly differently than string split: occurrences of pattern, which is not too helpful. It's the plain str.split() which is unusual in that: 1. it splits on

Re: namespaces, scoping and variables

2010-08-02 Thread Dave Angel
Chris Hare wrote: I am having a problem getting around this variable namespace thing. Consider these code bits File a.py from Tkinter import * import a1 def doAgain(): x =1.Net() x.show(Again!) root =k() root.title(test) f =rame(root,bg=Yellow) l =utton(root,text=window

Re: Why is python not written in C++ ?

2010-08-02 Thread Mithrandir
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/01/2010 07:34 PM, Albert Hopkins wrote: On Mon, 2010-08-02 at 01:08 +0200, candide wrote: Python is an object oriented langage (OOL). The Python main implementation is written in pure and old C90. Is it for historical reasons? C is not

Re: namespaces, scoping and variables

2010-08-02 Thread MRAB
Chris Hare wrote: I am having a problem getting around this variable namespace thing. Consider these code bits File a.py from Tkinter import * import a1 def doAgain(): x = a1.Net() x.show(Again!) root = Tk() root.title(test) f = Frame(root,bg=Yellow) l =

Re: namespaces, scoping and variables

2010-08-02 Thread Ethan Furman
Chris Hare wrote: I am having a problem getting around this variable namespace thing. Consider these code bits File a.py from Tkinter import * import a1 def doAgain(): x = a1.Net() x.show(Again!) root = Tk() root.title(test) f = Frame(root,bg=Yellow) l =

Re: namespaces, scoping and variables

2010-08-02 Thread Chris Hare
Thanks to everyone for answering my question. I think its clear now. I'll just go the stuff 'em in a module and import that route. Chris On Aug 2, 2010, at 3:03 PM, MRAB wrote: Chris Hare wrote: I am having a problem getting around this variable namespace thing. Consider these code bits

Re: Trying to set a cookie within a python script

2010-08-02 Thread Νίκος
Hello, any ideas?! -- http://mail.python.org/mailman/listinfo/python-list

Re: how best to clear objects from a frame

2010-08-02 Thread Chris Hare
On Aug 1, 2010, at 10:13 PM, rantingrick wrote: On Aug 1, 7:12 pm, Chris Hare ch...@labr.net wrote: Here is the situation: I have a window with a bunch of widgets in it. I want to clear the objects in a given frame and recreate them to update them. You need to check out the w.update

Re: namespaces, scoping and variables

2010-08-02 Thread rantingrick
On Aug 2, 3:12 pm, Chris Hare ch...@labr.net wrote: Thanks to everyone for answering my question.  I think its clear now.  I'll just go the stuff 'em in a module and import that route. Chris, first of all i want you to know that this message is not meant to offend but it may offend you --

Re: Trying to set a cookie within a python script

2010-08-02 Thread Thomas Jollans
On 08/02/2010 04:20 AM, Νίκος wrote: Also my greek print appear in funny encoding although i do use # -*- coding: utf-8 -*- That's because you never told the web browser which encoding you're using. Content-Type: text/html; charset=UTF-8 -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to set a cookie within a python script

2010-08-02 Thread Thomas Jollans
On 08/02/2010 10:13 PM, Νίκος wrote: Hello, any ideas?! That's no way to treat a friendly volunteer mailing list like this one! On 08/02/2010 02:32 PM, Νίκος wrote: As for the encoding Notepad++, which is what i use for an editor say its UTF-8 without BOM. Isn't this what i'm supposed to

Re: let optionparse.Optionparser ignore unknown command line switches.

2010-08-02 Thread News123
On 08/01/2010 07:53 PM, Jon Clements wrote: On 1 Aug, 16:43, News123 news1...@free.fr wrote: On 08/01/2010 05:34 PM, Steven W. Orr wrote: On 08/01/10 07:27, quoth News123: On 08/01/2010 01:08 PM, News123 wrote: I wondered, whether there's a simple/standard way to let the Optionparser just

Re: Behavior of re.split on empty strings is unexpected

2010-08-02 Thread John Nagle
On 8/2/2010 12:52 PM, Thomas Jollans wrote: On 08/02/2010 09:41 PM, John Nagle wrote: On 8/2/2010 11:02 AM, MRAB wrote: John Nagle wrote: The regular expression split behaves slightly differently than string split: occurrences of pattern, which is not too helpful. It's the plain

checking that process binds a port, fuser functionality

2010-08-02 Thread Zdenek Maxa
Hello, I need to start a process (using subprocess.Popen()) and wait until the new process either fails or successfully binds a specified port. The fuser command seems to be indented exactly for this purpose. Could anyone please provided a hint to a handy Python library to do this or would the

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-08-02 Thread Mark Lawrence
On 02/08/2010 17:53, donn wrote: On 02/08/2010 17:35, Mark Lawrence wrote: aka the colon. :) Ha. This is a case of the colon being the appendix! \d Is there a better newsgroup in the world than c.l.py? No! Kindest regards. Mark Lawrence. --

Re: Behavior of re.split on empty strings is unexpected

2010-08-02 Thread Benjamin Kaplan
On Mon, Aug 2, 2010 at 2:22 PM, John Nagle na...@animats.com wrote: On 8/2/2010 12:52 PM, Thomas Jollans wrote: On 08/02/2010 09:41 PM, John Nagle wrote: On 8/2/2010 11:02 AM, MRAB wrote: John Nagle wrote: The regular expression split behaves slightly differently than string split:

Re: Why is there no platform independent way of clearing a terminal?

2010-08-02 Thread Mark Lawrence
On 02/08/2010 19:14, Benjamin Kaplan wrote: On Mon, Aug 2, 2010 at 9:51 AM, David Robinowdrobi...@gmail.com wrote: On Mon, Aug 2, 2010 at 11:41 AM, Benjamin Kaplan benjamin.kap...@case.edu wrote: ... So these are the packages needed just to run Python in Ubuntu. It doesn't include the

Re: Why is python not written in C++ ?

2010-08-02 Thread Mark Lawrence
On 02/08/2010 00:08, candide wrote: Python is an object oriented langage (OOL). The Python main implementation is written in pure and old C90. Is it for historical reasons? C is not an OOL and C++ strongly is. I wonder if it wouldn't be more suitable to implement an OOL with another one. Has

Re: how best to clear objects from a frame

2010-08-02 Thread Mark Lawrence
On 02/08/2010 04:13, rantingrick wrote: On Aug 1, 7:12 pm, Chris Harech...@labr.net wrote: Here is the situation: I have a window with a bunch of widgets in it. I want to clear the objects in a given frame and recreate them to update them. You need to check out the w.update and

Re: Why is python not written in C++ ?

2010-08-02 Thread Peter
On Aug 3, 7:42 am, Mark Lawrence breamore...@yahoo.co.uk wrote: On 02/08/2010 00:08, candide wrote: snip I can't understand why any serious programmer mentions C++. As soon as I read it, I have to rush either to the kitchen to find a bowl to throw up in, or head for the toilet so I can talk

Re: Why is python not written in C++ ?

2010-08-02 Thread Michael Torrie
On 08/02/2010 03:42 PM, Mark Lawrence wrote: I can't understand why any serious programmer mentions C++. As soon as I read it, I have to rush either to the kitchen to find a bowl to throw up in, or head for the toilet so I can talk to the great white telephone. Sometimes, C++ is just the

Re: Behavior of re.split on empty strings is unexpected

2010-08-02 Thread Thomas Jollans
On 08/02/2010 11:22 PM, John Nagle wrote: [ s in rexp.split(long_s) if s ] Of course I can discard the blank strings afterward, but is there some way to do it in the split operation? If not, then the default case for split() is too non-standard. (Also, if s won't work; if s != ''

Trying to run Python 2.7 on Windows 7 and any suggestions on books/websites for dummies guide to python type learning

2010-08-02 Thread ben owen
Hi everyone, I'm new to this and was needing help with trying to learn/work with Python 2.7 on my computer. I'm running Windows 7 and trying to learn python programming from an older book from 1999 by Mark Lutz and David Ascher my boss gave me, and for some reason none of my script/modules for

Re: Why is python not written in C++ ?

2010-08-02 Thread sturlamolden
On 2 Aug, 01:08, candide cand...@free.invalid wrote: Has it ever been planned to rewrite in C++ the historical implementation (of course in an object oriented design) ? OO programming is possible in C. Just take a look at GNOME and GTK. Perl is written in C++. That is not enough to make me

Re: Why is python not written in C++ ?

2010-08-02 Thread Paul Rubin
Michael Torrie torr...@gmail.com writes: Sometimes, C++ is just the right tool for the job, despite all its warts C++'s object semantics (guaranteed destruction, scoping, etc) can sometimes work very well when you need the speed of a compiled language, but don't want to be quite as

Re: Why is python not written in C++ ?

2010-08-02 Thread sturlamolden
On 2 Aug, 05:04, Tomasz Rola rto...@ceti.pl wrote: And one should not forget about performance. C++ was for a long time behind C, and even now some parts (like iostreams) should be avoided in fast code. For fast I/O one must use platform specific APIs, such as Windows' i/o completion ports

Re: Trying to run Python 2.7 on Windows 7 and any suggestions on books/websites for dummies guide to python type learning

2010-08-02 Thread James Mills
On Tue, Aug 3, 2010 at 8:07 AM, ben owen troabarto...@hotmail.com wrote: Hi everyone, I'm new to this and was needing help with trying to learn/work with Python 2.7 on my computer. I'm running Windows 7 and trying to learn python programming from an older book from 1999 by Mark Lutz and David

Re: Why is python not written in C++ ?

2010-08-02 Thread sturlamolden
On 3 Aug, 00:27, Paul Rubin no.em...@nospam.invalid wrote: Certain folks in the functional-programming community consider OO to be a 1980's or 1990's approach that didn't work out, and that what it was really trying to supply was polymorphism.  C++ programs these days apparently tend to use

Re: Why is python not written in C++ ?

2010-08-02 Thread Aahz
In article f9e652d6-3945-4c18-92f3-b85b994fe...@k8g2000prh.googlegroups.com, Peter peter.milli...@gmail.com wrote: On Aug 3, 7:42=A0am, Mark Lawrence breamore...@yahoo.co.uk wrote: On 02/08/2010 00:08, candide wrote: I can't understand why any serious programmer mentions C++. As soon as I

Re: Why is python not written in C++ ?

2010-08-02 Thread Martin Gregorie
On Mon, 02 Aug 2010 15:54:52 -0700, sturlamolden wrote: On 3 Aug, 00:27, Paul Rubin no.em...@nospam.invalid wrote: Certain folks in the functional-programming community consider OO to be a 1980's or 1990's approach that didn't work out, and that what it was really trying to supply was

Re: Why is python not written in C++ ?

2010-08-02 Thread sturlamolden
On 3 Aug, 01:14, Martin Gregorie mar...@address-in-sig.invalid wrote: Bottom line: All this would still have happened regardless of the programming language used. I am quite sure C and Fortran makes it unlikely for an unhandled exception to trigger the autodestruct sequence. But it's nice to

Re: Why is python not written in C++ ?

2010-08-02 Thread Mark Lawrence
On 03/08/2010 00:03, Aahz wrote: In articlef9e652d6-3945-4c18-92f3-b85b994fe...@k8g2000prh.googlegroups.com, Peterpeter.milli...@gmail.com wrote: On Aug 3, 7:42=A0am, Mark Lawrencebreamore...@yahoo.co.uk wrote: On 02/08/2010 00:08, candide wrote: I can't understand why any serious

Re: Why is python not written in C++ ?

2010-08-02 Thread Mark Lawrence
On 03/08/2010 00:14, Martin Gregorie wrote: On Mon, 02 Aug 2010 15:54:52 -0700, sturlamolden wrote: On 3 Aug, 00:27, Paul Rubinno.em...@nospam.invalid wrote: Certain folks in the functional-programming community consider OO to be a 1980's or 1990's approach that didn't work out, and that

Package management (was: Why is there no platform independent way of clearing a terminal?)

2010-08-02 Thread Ben Finney
Mark Lawrence breamore...@yahoo.co.uk writes: How does any user or an admin cope with 500 packages? Operating systems with good package management come with tools that help the administrator do this job easily. Also, operating systems with good package management encourage the

Re: Why is there no platform independent way of clearing a terminal?

2010-08-02 Thread MRAB
Mark Lawrence wrote: On 02/08/2010 19:14, Benjamin Kaplan wrote: On Mon, Aug 2, 2010 at 9:51 AM, David Robinowdrobi...@gmail.com wrote: On Mon, Aug 2, 2010 at 11:41 AM, Benjamin Kaplan benjamin.kap...@case.edu wrote: ... So these are the packages needed just to run Python in Ubuntu. It

Re: Why is python not written in C++ ?

2010-08-02 Thread sturlamolden
On 3 Aug, 01:37, Mark Lawrence breamore...@yahoo.co.uk wrote: A bug is a bug is a bug? According to Grace Hopper, a bug might be a moth, in which case the best debugger is a pair of forceps. -- http://mail.python.org/mailman/listinfo/python-list

simple integer subclass

2010-08-02 Thread Andreas Pfrengle
I'm trying to define a subclass of int called int1. An int1-object shall behave exactly like an int-object, with the only difference that the displayed value shall be value + 1 (it will be used to display array indices starting at 1 instead of 0). Right now I have: class int1(int): def

Re: Why is python not written in C++ ?

2010-08-02 Thread Christian Heimes
Am 03.08.2010 01:03, schrieb Aahz: http://www.netfunny.com/rhf/jokes/98/May/stroustrup.html I don't understand why the URL contains the word joke. Every word is true. Hell yeah! :) Christian -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >