Re: do i need to create new rgbimage class

2007-12-30 Thread Gabriel Genellina
On 29 dic, 12:42, [EMAIL PROTECTED] wrote: > am a beginner in python and PIL  .I need to read an RGB 8 bit image > (am using jpeg )and pack the rgb color values into a double value so i > can store the image as a list of pixelvalues.From my application i > should be able to call rgbimage1.getpixel

Re: do i need to create new rgbimage class

2007-12-30 Thread Gabriel Genellina
On 30 dic, 04:57, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > The PIL docs at [1] say that using getpixel is very slow, and suggest Sorry, dropped the reference: [1] http://www.effbot.org/imagingbook/image.htm#tag-Image.Image.getpixel -- Gabriel Genellina -- http://mail.python.org/mailman/l

Re: Fate of itertools.dropwhile() and itertools.takewhile()

2007-12-30 Thread Marc 'BlackJack' Rintsch
On Sat, 29 Dec 2007 15:10:24 -0800, Raymond Hettinger wrote: > These thoughts reflect my own experience with the itertools module. > It may be that your experience with them has been different. Please > let me know what you think. I seem to be in a minority here as I use both functions from time

Re: difference between `x in list` and `list.index(x)` for instances of a new-style class

2007-12-30 Thread Riccardo Murri
[EMAIL PROTECTED] writes: > On 28 dic, 20:12, Riccardo Murri <[EMAIL PROTECTED]> wrote: > >> The list `self.base` contains "canonical" forms of the graphs and the >> `graph` object must compare equal to some item of the list, which >> indeed it does:: >> >>   (Pydb) p graph == self.base[27]   >>  

Re: sqlobject question...

2007-12-30 Thread Markus Gritsch
Hi, you should ask SQLObject related questions better at "SQLObject discussion" <[EMAIL PROTECTED]> Oleg Broytman and others are very helpful there. Markus -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread thebjorn
On Dec 29, 7:17 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Dec 29, 12:50 pm, bukzor <[EMAIL PROTECTED]> wrote: > > > Is this functionality intended? It seems very unintuitive. This has > > caused a bug in my programs twice so far, and both times I was > > completely mystified until I realize

Re: Choosing a new language

2007-12-30 Thread Joachim Durchholz
John Thingstad schrieb: > Skrev Joachim Durchholz <[EMAIL PROTECTED]>: > >> However, for web applications, I found a far easier variant: I just >> reload the page being debugged. (I have to make sure that the backend >> is in the same state when reloading, but that's usually easy to >> accompli

Unexpected __metaclass__ method behavior

2007-12-30 Thread anne . nospam01
Dear fellow Pythonians, I just stumbled upon the following unexpected behavior: class TestType(type): def Foo(self): return 'TestType Foo' class Test(object): __metaclass__ = TestType def Foo(self): return 'Test Foo' t = Test() print t.Foo() print Test.Foo() This will produce: Test F

Re: Unexpected __metaclass__ method behavior

2007-12-30 Thread Michele Simionato
[EMAIL PROTECTED] wrote: > Dear fellow Pythonians, > > I just stumbled upon the following unexpected behavior: > > class TestType(type): > def Foo(self): return 'TestType Foo' > class Test(object): > __metaclass__ = TestType > def Foo(self): return 'Test Foo' > t = Test() > print t.Fo

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread Istvan Albert
On Dec 30, 5:23 am, thebjorn <[EMAIL PROTECTED]> wrote: >def age(dob, today=datetime.date.today()): >... > > None of my unit tests caught that one :-) interesting example I can see how it caused some trouble. A quick fix would be to write it: def age(dob, today=datetime.date.today ):

Re: do i need to create new rgbimage class

2007-12-30 Thread jimgardener
> (May I ask why an accessor like getpixellist() instead of simply > rgbimage1.pixellist?) sorry, bad style of coding on my part..was doing java stuff.. > > I don't get the name - why "rgb to double"? This does not return a > "double", but a long integer, actually it was to be of 'long' type not

Re: difference between `x in list` and `list.index(x)` for instances of a new-style class

2007-12-30 Thread Gabriel Genellina
On 30 dic, 06:24, Riccardo Murri <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > >>   (Pydb) p graph == self.base[27]   > >>   True > >>   (Pydb) p graph in self.base > >>   True > >>   (Pydb) self.base.index(graph) > >>   *** ValueError: list.index(x): x not in list > > Looking at the

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread Istvan Albert
On Dec 29, 11:21 pm, bukzor <[EMAIL PROTECTED]> wrote: > The standard library is not affected because the people who wrote code into it know how python works. Programming abounds with cases that some people think should work differently: a = b = [] a.append(1) is b empty or not at this point?

Re: do i need to create new rgbimage class

2007-12-30 Thread Gabriel Genellina
On 30 dic, 10:53, [EMAIL PROTECTED] wrote: > > I don't get the name - why "rgb to double"? This does not return a > > "double", but a long integer, > > actually it was to be of 'long' type not double..sorry again Notice that a Python 'long' is an infinite range integer; the C 'long' type maps to

Redirecting STDOUT using C calls.

2007-12-30 Thread Tom Gaudasinski
Greetings, I'm trying to redirect python's stdout to another location. The reason for this is that I'm embedding python in an application. Now, originally my code was developed for Linux and that did not require redirection due to the fact that every X11 application can have an STDOUT assoc

Re: Fate of itertools.dropwhile() and itertools.takewhile()

2007-12-30 Thread Istvan Albert
On Dec 30, 3:29 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > One "recipe" is extracting blocks from text files that are delimited by a > special start and end line. Neat solution! I actually need such functionality every once in a while. Takewhile + dropwhile to the rescue! i. --

The Tears Of Finding The Truth

2007-12-30 Thread abdo911
Through The Internet INTRODUCTION The following story occurred on the Internet through one of the chat programs (Freetel) in January 1999. It is a real dialogue between a Christian and a Muslim. The story centers on Derek's realization of today's Christianity and his subseq

What is the best way to do dynamic imports ?

2007-12-30 Thread marcroy . olsen
Hi list and python gurus :-) I'm playing with some mod_python and web development. And in me code I need to do som dynamic imports. Right now I just do a: exec 'import '+some_modulename But it seems to easy, is there a "dark side" to doing it this way? (memory use,processing ,etc) And have to I

Re: Redirecting STDOUT using C calls.

2007-12-30 Thread Christian Heimes
Tom Gaudasinski wrote: > Greetings, > I'm trying to redirect python's stdout to another location. The > reason for this is that I'm embedding python in an application. Now, > originally my code was developed for Linux and that did not require > redirection due to the fact that every X11 appl

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread Benjamin
On Dec 30, 8:24 am, [EMAIL PROTECTED] wrote: > Hi list and python gurus :-) > > I'm playing with some mod_python and web development. And in me code I > need to do som dynamic imports. > Right now I just do a: > > exec 'import '+some_modulename The correct way to do this is use the __import__ funct

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread Torsten Bronger
Hallöchen! [EMAIL PROTECTED] writes: > I'm playing with some mod_python and web development. And in me > code I need to do som dynamic imports. Right now I just do a: > > exec 'import '+some_modulename > > But it seems to easy, is there a "dark side" to doing it this way? > (memory use,processin

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread Gabriel Genellina
En Sun, 30 Dec 2007 12:24:53 -0200, <[EMAIL PROTECTED]> escribi�: > I'm playing with some mod_python and web development. And in me code I > need to do som dynamic imports. > Right now I just do a: > > exec 'import '+some_modulename > > But it seems to easy, is there a "dark side" to doing it this

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread marcroy . olsen
First of thanks to all for you, especially for the quick replys. Just need to walk the dog then I giv it a short. On Dec 30, 3:57 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > Do anybody now a good howto or tutorial to this? > > No... what do you want covered? Nothing, think you repl

Re: Fate of itertools.dropwhile() and itertools.takewhile()

2007-12-30 Thread George Sakkis
On Dec 30, 4:12 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Dec 30, 3:29 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > One "recipe" is extracting blocks from text files that are delimited by a > > special start and end line. > > Neat solution! > > I actually need such function

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread StephenRFerg
This is a well-known python gotcha. See: http://www.ferg.org/projects/python_gotchas.html#contents_item_6 -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread George Sakkis
On Dec 29, 9:14 pm, bukzor <[EMAIL PROTECTED]> wrote: > Here's the answer to the > question:http://www.python.org/doc/faq/general/#why-are-default-values-shared-... > > It looks like Guido disagrees with me, so the discussion is closed. Note that the FAQ mainly explains *what* happens, not *why*

Re: Tab indentions on different platforms?

2007-12-30 Thread Thorsten Kampe
* Steven D'Aprano (Sun, 30 Dec 2007 00:37:32 -) > On Sat, 29 Dec 2007 15:29:25 +, Thorsten Kampe wrote: > > I'd personally go for spaces because: > > > > 1. I don't like things I cannot see (control characters) > > You can see spaces but not tabs? Your editor is pretty weird. In all the

Re: Tab indentions on different platforms?

2007-12-30 Thread Thorsten Kampe
* Ben Finney (Sun, 30 Dec 2007 15:36:12 +1100) > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > On Sat, 29 Dec 2007 15:29:25 +, Thorsten Kampe wrote: > > > I'd personally go for spaces because: > > > > > > 1. I don't like things I cannot see (control characters) > > > > You can see spaces bu

Re: error on importing variable value

2007-12-30 Thread int32bit
On Dec 29, 6:05 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sat, 29 Dec 2007 15:31:30 -0800 (PST), [EMAIL PROTECTED] declaimed > the following in comp.lang.python: > > > > > I can't figure out why this doesn't work. Any ideas appreciated. > > > conn = MySQLdb.connect (db = "vocab") > >

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread thebjorn
On Dec 30, 2:45 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Dec 30, 5:23 am, thebjorn <[EMAIL PROTECTED]> > wrote: > > >def age(dob, today=datetime.date.today()): > >... > > > None of my unit tests caught that one :-) > > interesting example I can see how it caused some trouble. A

Push to Make (Single Pole) Button running a loop

2007-12-30 Thread Jon Todd
Happy holidays all! I'm developing an application and, as a relative newbie to Python, have come across a stumbling block with Tkinter. I'd like to have a button that when pressed executes a loop (this could be a thread) and then stops execution when it's released (Push to Make - Single Pole i

Re: Why does __builtins__ mean different things...

2007-12-30 Thread Dustan
On Dec 22, 1:59 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Dustan wrote: > > On Dec 21, 8:11 pm, James Stroud <[EMAIL PROTECTED]> wrote: > >> I swear there is another thread going on here of which I am not aware. > > > You just keep on telling yourself that. > > Is there a cricket here? No, but

Sub-classing unicode: getting the unicode value

2007-12-30 Thread Torsten Bronger
Hallöchen! I sub-classed unicode in an own class called "Excerpt", and now I try to implement a __unicode__ method. In this method, I want to get the actual value of the instance, i.e. the unicode string: def __unicode__(self): """Returns the Unicode representation of Excerpt. Note

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread bukzor
On Dec 30, 2:23 am, thebjorn <[EMAIL PROTECTED]> wrote: > Scenario: long running server process, > Bug report: "people aren't getting older", Code: > >def age(dob, today=datetime.date.today()): >... A very interesting example, thanks. On Dec 30, 8:25 am, [EMAIL PROTECTED] wrote: > Thi

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread Istvan Albert
On Dec 30, 11:26 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm with you on this one; IMHO it's one of the relatively few language > design missteps of Python, favoring the rare case as the default > instead of the common one. George, you pointed this out this link in a different thread http

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread bukzor
On Dec 30, 12:32 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Dec 30, 11:26 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > I'm with you on this one; IMHO it's one of the relatively few language > > design missteps of Python, favoring the rare case as the default > > instead of the common o

Re: Sub-classing unicode: getting the unicode value

2007-12-30 Thread Gabriel Genellina
On 30 dic, 17:25, Torsten Bronger <[EMAIL PROTECTED]> wrote: > I sub-classed unicode in an own class called "Excerpt", and now I > try to implement a __unicode__ method.  In this method, I want to > get the actual value of the instance, i.e. the unicode string: The "actual value of the instance",

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread Istvan Albert
On Dec 30, 3:41 pm, bukzor <[EMAIL PROTECTED]> wrote: > No globals, as you specified. BTW, it's silly not to 'allow' globals > when they're called for, otherwise we wouldn't need the 'global' > keyword. okay, now note that you do not actually use the ingroup list for anything else but getting and

Re: MySQL-python Error

2007-12-30 Thread godavemon
Hopefully you've found it by now and didn't have a frustrating christmas :). Get the source from sourceforge and then follow the instructions here. http://www.davidcramer.net/code/57/mysqldb-on-leopard.html Worked perfectly for me on OSX 10.5, python 2.5. Was frustrating to find. Good luck!

Re: Sub-classing unicode: getting the unicode value

2007-12-30 Thread Torsten Bronger
Hallöchen! Gabriel Genellina writes: > On 30 dic, 17:25, Torsten Bronger <[EMAIL PROTECTED]> > wrote: > >> I sub-classed unicode in an own class called "Excerpt", and now I >> try to implement a __unicode__ method.  In this method, I want to >> get the actual value of the instance, i.e. the unico

Re: Sub-classing unicode: getting the unicode value

2007-12-30 Thread Gabriel Genellina
On 30 dic, 19:08, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Gabriel Genellina writes: > > On 30 dic, 17:25, Torsten Bronger <[EMAIL PROTECTED]> > > wrote: > > >> I sub-classed unicode in an own class called "Excerpt", and now I > >> try to implement a __unicode__ method.  In this method, I want

Re: Redirecting STDOUT using C calls.

2007-12-30 Thread Tom Gaudasinski
Christian Heimes wrote: > Tom Gaudasinski wrote: > >> Greetings, >> I'm trying to redirect python's stdout to another location. The >> reason for this is that I'm embedding python in an application. Now, >> originally my code was developed for Linux and that did not require >> redirection

Re: Sub-classing unicode: getting the unicode value

2007-12-30 Thread Torsten Bronger
Hallöchen! Gabriel Genellina writes: > On 30 dic, 19:08, Torsten Bronger <[EMAIL PROTECTED]> > wrote: > >> [...] >> >> But then it is not unicode but Excerpt which I don't want.  The >> idea is to buffer the unicode representation in order to gain >> efficiency. Otherwise, a lot of unicode conve

Re: Sub-classing unicode: getting the unicode value

2007-12-30 Thread Martin v. Löwis
> How does my object get its own value? def __unicode__(self): return unicode(self) Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Sub-classing unicode: getting the unicode value

2007-12-30 Thread John Machin
On Dec 31, 8:08 am, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > Gabriel Genellina writes: > > On 30 dic, 17:25, Torsten Bronger <[EMAIL PROTECTED]> > > wrote: > > >> I sub-classed unicode in an own class called "Excerpt", and now I > >> try to implement a __unicode__ method. In thi

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > First of thanks to all for you, especially for the quick replys. > > Just need to walk the dog then I giv it a short. Please, don't kill your dog! We're a peace-loving community here that respects dogs, and snakes and even trolls. SCNR, Diez -- http://mail.python.

Re: Sub-classing unicode: getting the unicode value

2007-12-30 Thread Torsten Bronger
Hallöchen! Martin v. Löwis writes: >> How does my object get its own value? > > def __unicode__(self): > return unicode(self) I get an endless recursion with this. I must admit, though, that I probably overestimate the costs connected with unicode(my_excerpt) because Gabriel is probably r

Re: Sub-classing unicode: getting the unicode value

2007-12-30 Thread Torsten Bronger
Hallöchen! John Machin writes: > On Dec 31, 8:08 am, Torsten Bronger <[EMAIL PROTECTED]> > wrote: > >> [...] >> >> But then it is not unicode but Excerpt which I don't want. The >> idea is to buffer the unicode representation in order to gain >> efficiency. Otherwise, a lot of unicode conversio

Re: Unexpected __metaclass__ method behavior

2007-12-30 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Dear fellow Pythonians, | | I just stumbled upon the following unexpected behavior: | | class TestType(type): |def Foo(self): return 'TestType Foo' | class Test(object): |__metaclass__ = TestType |def Foo(self): return 'Tes

Re: Tab indentions on different platforms?

2007-12-30 Thread Steven D'Aprano
On Sun, 30 Dec 2007 20:33:19 +, Thorsten Kampe wrote: > * Steven D'Aprano (Sun, 30 Dec 2007 00:37:32 -) >> On Sat, 29 Dec 2007 15:29:25 +, Thorsten Kampe wrote: >> > I'd personally go for spaces because: >> > >> > 1. I don't like things I cannot see (control characters) >> >> You can

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread Steven D'Aprano
On Sun, 30 Dec 2007 12:41:57 -0800, bukzor wrote: > BTW, it's silly not to 'allow' globals when they're called for, > otherwise we wouldn't need the 'global' keyword. Nobody argues against allowing globals variables *when they're called for*, just pointing out that ninety-nine times out of a hun

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread Steven D'Aprano
On Sun, 30 Dec 2007 13:34:07 -0800, Dennis Lee Bieber wrote: > On Sun, 30 Dec 2007 12:11:50 -0800 (PST), bukzor > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >> Just because it's well known doesn't mean we shouldn't think about it. >> For example, in the same list you li

Re: Tab indentions on different platforms?

2007-12-30 Thread Steven D'Aprano
On Sun, 30 Dec 2007 20:41:09 +, Thorsten Kampe wrote: > Anyway: the consequence of your well done argumentation is that > someone editing Python code has to use a specialised editor to prevent > screwing up tab indented code - and that's bad. You just need to use an editor that inserts tab ch

Re: Fate of itertools.dropwhile() and itertools.takewhile()

2007-12-30 Thread Raymond Hettinger
[bearophile] > Here are my usages (every sub-list is > sorted by inverted frequency usage): > > I use often or very often: > groupby( iterable[, key]) > imap( function, *iterables) > izip( *iterables) > ifilter( predicate, iterable) > islice( iterable, [start,] stop [, step]) > > I use once in whil

Re: Fate of itertools.dropwhile() and itertools.takewhile()

2007-12-30 Thread Raymond Hettinger
[Michele Simionato] > in my code > base I have exactly zero occurrences of takewhile and > dropwhile, even if I tend to use the itertools quite > often. That should be telling. Thanks for the additional empirical evidence. > I presume you did scans of > large code bases and you did not find occur

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread Graham Dumpleton
On Dec 31, 1:24 am, [EMAIL PROTECTED] wrote: > Hi list and python gurus :-) > > I'm playing with somemod_pythonand web development. And in me code I > need to do som dynamic imports. > Right now I just do a: > > exec 'import '+some_modulename > > But it seems to easy, is there a "dark side" to doin

Re: Fate of itertools.dropwhile() and itertools.takewhile()

2007-12-30 Thread Raymond Hettinger
[Marc 'BlackJack' Rintsch] > I use both functions from time to time. > One "recipe" is extracting blocks from text files that are delimited by a > special start and end line. > > def iter_block(lines, start_marker, end_marker): >     return takewhile(lambda x: not x.startswith(end_marker), >      

Re: Fate of itertools.dropwhile() and itertools.takewhile()

2007-12-30 Thread Raymond Hettinger
FWIW, here is an generator version written without the state flag: def iter_block(lines, start_marker, end_marker): lines = iter(lines) for line in lines: if line.startswith(start_marker): yield line break for line in lines:

Re: Tab indentions on different platforms?

2007-12-30 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sun, 30 Dec 2007 20:41:09 +, Thorsten Kampe wrote: > > > Anyway: the consequence of your well done argumentation is that > > someone editing Python code has to use a specialised editor to prevent > > screwing up tab indented code - and that's b

evolution-python

2007-12-30 Thread eloi-ribeiro.blogspot.com
Hi everyone, I would like to use a python script to export (save as...) all my contacts in Evolution to VCard format (.vcf). I am a beginner so I don't knock how to use evolution-python module. The second part of the script would be to make inserts to a database, at these second part, I think I ca

Help please with code to find and move files.

2007-12-30 Thread inFocus
Hello, I am new to python and wanted to write something for myself where after inputing two words it would search entire drive and when finding both names in files name would either copy or move thoe files to a specified directory. But couple of attempts did not work as desired this is one of the

Re: Help please with code to find and move files.

2007-12-30 Thread infixum
> path = r"c:\\" I don't know if this is the whole problem, but this line should read r'c:\' (one backslash). -- http://mail.python.org/mailman/listinfo/python-list

Re: Fate of itertools.dropwhile() and itertools.takewhile()

2007-12-30 Thread Paul Hankin
On Dec 31, 1:25 am, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > FWIW, here is an generator version written without the state flag: > >     def iter_block(lines, start_marker, end_marker): >         lines = iter(lines) >         for line in lines: >             if line.startswith(start_marker): >

Re: Help please with code to find and move files.

2007-12-30 Thread inFocus
On Sun, 30 Dec 2007 18:42:50 -0800 (PST), infixum <[EMAIL PROTECTED]> wrote: > >> path = r"c:\\" > >I don't know if this is the whole problem, but this line should read >r'c:\' (one backslash). after changing i got this path = r"c:\" ^ SyntaxError: EOL while scanning single-

Re: Help please with code to find and move files.

2007-12-30 Thread infixum
> > after changing i got this > >     path = r"c:\" >                 ^ > SyntaxError: EOL while scanning single-quoted string Sorry about that. You can't end with a backslash - my bad. I just tried this in the interpreter and 'c:' works. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help please with code to find and move files.

2007-12-30 Thread John Machin
On Dec 31, 1:04 pm, [EMAIL PROTECTED] wrote: > Hello, > > I am new to python and wanted to write something for myself where > after inputing two words it would search entire drive and when finding > both names in files name would either copy or move thoe files to a > specified directory. > > But co

ElementTree should parse string and file in teh same way

2007-12-30 Thread Peter Pei
One bad design about elementtree is that it has different ways parsing a string and a file, even worse they return different objects: 1) When you parse a file, you can simply call parse, which returns a elementtree, on which you can then apply xpath; 2) To parse a string (xml section), you can ca

Re: Help please with code to find and move files.

2007-12-30 Thread inFocus
On Sun, 30 Dec 2007 19:29:38 -0800 (PST), John Machin <[EMAIL PROTECTED]> wrote: >On Dec 31, 1:04 pm, [EMAIL PROTECTED] wrote: >> Hello, >> >> I am new to python and wanted to write something for myself where >> after inputing two words it would search entire drive and when finding >> both names i

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread bukzor
On Dec 30, 3:34 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sun, 30 Dec 2007 12:41:57 -0800, bukzor wrote: > > BTW, it's silly not to 'allow' globals when they're called for, > > otherwise we wouldn't need the 'global' keyword. > > Nobody argues against allowing globals v

Re: Choosing a new language

2007-12-30 Thread George Neuner
On Fri, 28 Dec 2007 22:07:12 -0800 (PST), [EMAIL PROTECTED] wrote: >Ada is airline/dod blessed. Airline blessed maybe. The DOD revoked its Ada only edict because they couldn't find enough Ada programmers. AFAIK, Ada is still the preferred language, but it is not required. George -- for email r

Re: Help please with code to find and move files.

2007-12-30 Thread John Machin
On Dec 31, 2:44 pm, [EMAIL PROTECTED] wrote: > On Sun, 30 Dec 2007 19:29:38 -0800 (PST), John Machin > > > > > > <[EMAIL PROTECTED]> wrote: > >On Dec 31, 1:04 pm, [EMAIL PROTECTED] wrote: > >> Hello, > > >> I am new to python and wanted to write something for myself where > >> after inputing two wo

Re: Help please with code to find and move files.

2007-12-30 Thread inFocus
On Sun, 30 Dec 2007 20:49:29 -0800 (PST), John Machin <[EMAIL PROTECTED]> wrote: >On Dec 31, 2:44 pm, [EMAIL PROTECTED] wrote: >> On Sun, 30 Dec 2007 19:29:38 -0800 (PST), John Machin >> >> >> >> >> >> <[EMAIL PROTECTED]> wrote: >> >On Dec 31, 1:04 pm, [EMAIL PROTECTED] wrote: >> >> Hello, >> >> >

how to connect to a remote machine using python........

2007-12-30 Thread vinoj davis
hi all,  i am new to python, can anyone tell me how can i connect to a remote machine using python and execute commands.Thanking you..Regards,    ---ViNOJ DAViS--- Chat on a cool, new interface. No download required. Click here. -- http://mail.python.org/mailman/list

Re: how to connect to a remote machine using python........

2007-12-30 Thread Shane Geiger
Some python ssh packages are available if you are wanting to execute commands on a machine that has ssh. ssh servers are available for windows, but they aren't necessarily so well supported. Here's a simple approach that works on ssh servers: import commands hostname = commands.getoutput('ssh [E

Re: Brussels Python Interest/Users Group

2007-12-30 Thread David Van Mosselbeen
on Sat, 29 Dec 2007 04:51:12 -0800 (PST), seb <[EMAIL PROTECTED]> wrote: > Hi Pythonistas, > > Is anyone interested in forming a Brussels(Belgium) area Python User > Group ? I am not aware of any python focused group in this area. > > Language could be whatever fits the bill (English/French/Dutch/.

help building python installer

2007-12-30 Thread abhishek
Hello group, I have been able to successfully compile python 2.5.1 using MSVC 8 compiler . Now i want to build an msi installer out of this. What's procedure that I should follow for this ?? Thank You -- http://mail.python.org/mailman/listinfo/python-list

Re: Fate of itertools.dropwhile() and itertools.takewhile()

2007-12-30 Thread Matt Nordhoff
Raymond Hettinger wrote: > I'm considering deprecating these two functions and would like some > feedback from the community or from people who have a background in > functional programming. > > * I'm concerned that use cases for the two functions are uncommon and > can obscure code rather than cl

Re: Python for web...

2007-12-30 Thread David Van Mosselbeen
on Tue, 25 Dec 2007 20:42:03 -0800 (PST), [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > I have to develop a web based enterprise application for my final year > project. Since i am interested in open source, i searched the net. > Almost 90% of them were PHP and MySQL. Cant we u

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread Steven D'Aprano
On Sun, 30 Dec 2007 20:00:14 -0800, bukzor wrote: > I think you struck at the heart of the matter earlier when you noted > that this is the simplest way to declare a static variable in python. > Using the 'global' keyword is the other way, and is much more explicit, > and much more widely used. I

Re: Help please with code to find and move files.

2007-12-30 Thread inFocus
On Sun, 30 Dec 2007 22:52:32 -0800, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On Sun, 30 Dec 2007 23:58:17 -0500, [EMAIL PROTECTED] declaimed the >following in comp.lang.python: > > >> I am sorry i thought I did say what I was tryng to do. > > The only thing I picked up from the thread i

Re: ElementTree should parse string and file in teh same way

2007-12-30 Thread Paddy
On Dec 31, 3:42 am, "Peter Pei" <[EMAIL PROTECTED]> wrote: > One bad design about elementtree is that it has different ways parsing a > string and a file, even worse they return different objects: > 1) When you parse a file, you can simply call parse, which returns a > elementtree, on which you can

Re: Bizarre behavior with mutable default arguments

2007-12-30 Thread Gabriel Genellina
En Mon, 31 Dec 2007 05:01:51 -0200, Steven D'Aprano <[EMAIL PROTECTED]> escribió: > On Sun, 30 Dec 2007 20:00:14 -0800, bukzor wrote: > >> I also see this as the main use of the >> 'notlocal' keyword to be introduced in py3k (it also fixes the example >> given by Istvan above). > > There doesn't

Re: Push to Make (Single Pole) Button running a loop

2007-12-30 Thread Hendrik van Rooyen
"Jon Todd" wrote: >I'd like to have a button that when pressed executes a loop (this could be a >thread) and then stops execution when it's released (Push to Make - Single >Pole in electronics terms). > >I've tried the regular way of associating the procedure with a callback and >tried using an