Needed: FTP Upload Directory Tree script

2007-06-10 Thread IanC
Hi, Does anyone know of a function or script to upload an entire subdirectory tree from a local file space to an FTP server? The Python distribution comes with "ftpmirror.py", which performs a mirror download of a directory tree, but I need the "Upload" version of this. Thanks for any hints --

Re: read xml file from compressed file using gzip

2007-06-10 Thread John Machin
On 10/06/2007 3:06 PM, flebber wrote: > On Jun 10, 3:45 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> flebber wrote: >>> I was working at creating a simple program that would read the content >>> of a playlist file( in this case *.k3b") and write it out . the >>> compressed "*.k3b" file has two f

Re: read xml file from compressed file using gzip

2007-06-10 Thread flebber
On Jun 10, 7:43 pm, John Machin <[EMAIL PROTECTED]> wrote: > On 10/06/2007 3:06 PM, flebber wrote: > > > > > On Jun 10, 3:45 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > >> flebber wrote: > >>> I was working at creating a simple program that would read the content > >>> of a playlist file( in thi

Re: read xml file from compressed file using gzip

2007-06-10 Thread John Machin
On 10/06/2007 8:08 PM, flebber wrote: > > Thanks that was so helpful to see how to do it. I have read a lot but > it wasn't sinking in, and sometimes its better to learn by doing. IMHO it's always better to learn by: read some, try it out, read some, ... > Some > of the books I have read just se

matching objects by a tuple field criterion

2007-06-10 Thread bullockbefriending bard
i have a large collection of python objects, each of which contains an integer 6-tuple as part of its data payload. what i need to be able to do is select only those objects which meet a simple tuple element wildcard matching criterion. e.g. given the following python objects: object A include

Re: matching objects by a tuple field criterion

2007-06-10 Thread Steven D'Aprano
On Sun, 10 Jun 2007 03:58:44 -0700, bullockbefriending bard wrote: > i have a large collection of python objects, each of which contains an > integer 6-tuple as part of its data payload. what i need to be able to > do is select only those objects which meet a simple tuple element > wildcard matchi

Re: matching objects by a tuple field criterion

2007-06-10 Thread Diez B. Roggisch
bullockbefriending bard schrieb: > i have a large collection of python objects, each of which contains an > integer 6-tuple as part of its data payload. what i need to be able to > do is select only those objects which meet a simple tuple element > wildcard matching criterion. e.g. given the follow

Re: Where can I suggest an enchantment for Python Zip lib?

2007-06-10 Thread Anders J. Munch
durumdara wrote: > Only one way I have to control this: if I modify the ZipFile module. Since you already have the desired feature implemented, why don't you submit a patch. See http://www.python.org/patches/ - Anders -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread [EMAIL PROTECTED]
On Jun 9, 12:16 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Terry Reedy wrote: > > In Python, you have a choice of recursion (normal or tail) > > Please explain this. I remember reading on this newsgroup that an > advantage of ruby (wrt python) is that ruby has tail recursion, implying > that pyt

userinteraction for a webspider

2007-06-10 Thread Chris
hi guys, i would like to to write a little spider, where, occasionally, the user has to interact. For example show a log-in page or something similar (since everyone has those verification letter/number pics), or send a message by hand. I had the idea of the script relaying the page to localho

Re: matching objects by a tuple field criterion

2007-06-10 Thread Diez B. Roggisch
Diez B. Roggisch schrieb: > bullockbefriending bard schrieb: >> i have a large collection of python objects, each of which contains an >> integer 6-tuple as part of its data payload. what i need to be able to >> do is select only those objects which meet a simple tuple element >> wildcard matching

How can I obtain the exception object on a generlized except statement?

2007-06-10 Thread Chris Allen
I am confused on one aspect of exception handling. If you specify the exception object type to match in an except statement it is possible to also obtain the exception object itself, but I can't figure out how to get the exception object when I don't specify a match. for example: >>> try: urlope

Re: Third-party libs in version control

2007-06-10 Thread [EMAIL PROTECTED]
On Jun 10, 5:26 am, Marcus <[EMAIL PROTECTED]> wrote: > Good evening, > > I'm new to developing large subversion-controlled projects. This one > will involve a few third-party libraries like wxWidgets, and perhaps > Twisted. Ordinarily you could just install these into your system and > they'll end

Re: matching objects by a tuple field criterion

2007-06-10 Thread bullockbefriending bard
> Instead of passing a wild-card tuple like (*,*,*,4,*,*) simply pass the > integer you want to match and the position you want to match it in. for sure. that was more for expository purpose rather than how i was planning to go about it. > As a generator expression: > > (obj for obj in list_of_

Re: How can I obtain the exception object on a generlized except statement?

2007-06-10 Thread Diez B. Roggisch
Chris Allen schrieb: > I am confused on one aspect of exception handling. If you specify the > exception object type to match in an except statement it is possible > to also obtain the exception object itself, but I can't figure out how > to get the exception object when I don't specify a match. >

Re: How to get existing frames in non-current thread?

2007-06-10 Thread Fabio Zadrozny
On 6/10/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: En Sat, 09 Jun 2007 21:40:40 -0300, Fabio Zadrozny <[EMAIL PROTECTED]> escribió: > Is there some way to get all the frames for any given thread? -- in a way > that does not require a compiled extension. For the current (calling) thread,

Re: matching objects by a tuple field criterion

2007-06-10 Thread John Machin
On Jun 10, 8:58 pm, bullockbefriending bard <[EMAIL PROTECTED]> wrote: > i have a large collection of python objects, each of which contains an > integer 6-tuple as part of its data payload. what i need to be able to > do is select only those objects which meet a simple tuple element > wildcard mat

Re: How can I obtain the exception object on a generlized except statement?

2007-06-10 Thread John Machin
On Jun 10, 10:13 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Chris Allen schrieb: > > > > > I am confused on one aspect of exception handling. If you specify the > > exception object type to match in an except statement it is possible > > to also obtain the exception object itself, but I c

Re: matching objects by a tuple field criterion

2007-06-10 Thread John Machin
On Jun 10, 10:32 pm, bullockbefriending bard <[EMAIL PROTECTED]> wrote: > quite so, i rephrased docstring to be: > > """criteria is an iterable containing either '*' instances or strings > of comma-separated integers. e.g. ['*','1,2,3', '11,12']""" > > thanks very much for the idea! upon further

Re: matching objects by a tuple field criterion

2007-06-10 Thread bullockbefriending bard
quite so, i rephrased docstring to be: """criteria is an iterable containing either '*' instances or strings of comma-separated integers. e.g. ['*','1,2,3', '11,12']""" thanks very much for the idea! upon further reflection, this seems to be a more elegant solution for my case than the ad-hoc g

Re: matching objects by a tuple field criterion

2007-06-10 Thread Diez B. Roggisch
bullockbefriending bard schrieb: >> Instead of passing a wild-card tuple like (*,*,*,4,*,*) simply pass the >> integer you want to match and the position you want to match it in. > > for sure. that was more for expository purpose rather than how i was > planning to go about it. > > >> As a gener

Re: matching objects by a tuple field criterion

2007-06-10 Thread bullockbefriending bard
> There are certainly cases where the speedup is tremendous - think of a > single integer in the first criteria - but then the overall performance > depends on the real-live queries. If lot's of wildcards are used, you > might end up slower if the tree-walk takes more time than the > C-implemented

Python editors again (it's not the same old request)

2007-06-10 Thread Eric S. Johansson
I upgraded to version 9.5 and all of my tools which enabled me to program by voice in Emacs are broken. it's one of those dagnabbit a moment's of life. What I am looking for is a Windows based Python Smart editor that uses specific rich text edit controls as specified here: http://knowledgebas

Python in the Mozilla world

2007-06-10 Thread Eric S. Johansson
this morning I was looking at Python and XUL. I was impressed by the very interesting projects that were happening around 2005 but it seems like they have all died. Integrating Python at the Mozilla was also very intriguing as it held the promise of eliminating JavaScript for extension devel

Re: Pyrex problem with cdef'd attribute

2007-06-10 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > I'll play around a bit > more and if I continue to confuse myself will subscribe to the pyrex mailing > list (or at least use the somewhat clunky gmane.org interface). I find that using a newsreader for gmane stuff is far more convenient. I use Thunderbird to access va

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread Josiah Carlson
Steven D'Aprano wrote: > On Sat, 09 Jun 2007 22:52:32 +, Josiah Carlson wrote: > >> the only thing that optimization >> currently does in Python at present is to discard docstrings > > Python, or at least CPython, does more optimizations than that. Aside from > run-time optimizations like in

memory efficient set/dictionary

2007-06-10 Thread koara
What is the best to go about using a large set (or dictionary) that doesn't fit into main memory? What is Python's (2.5 let's say) overhead for storing int in the set, and how much for storing int -> int mapping in the dict? Please recommend a module that allows persistent set/dict storage + fast

Re: Python editors again (it's not the same old request)

2007-06-10 Thread Chris Mellon
On 6/10/07, Eric S. Johansson <[EMAIL PROTECTED]> wrote: > I upgraded to version 9.5 and all of my tools which enabled me to program by > voice in Emacs are broken. it's one of those dagnabbit a moment's of life. > > What I am looking for is a Windows based Python Smart editor that uses > specifi

Re: Python in the Mozilla world

2007-06-10 Thread Steve Howell
--- "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > > As a result, I started looking at Python generating > JavaScript and I know there > is pypy but is that really something one can count > on or is it more a good > demonstration of technology? > I would not completely give up on the idea o

Re: Hooking exceptions outside of call stack

2007-06-10 Thread Josiah Carlson
Warren Stringer wrote: > Josiah Carlson wrote: >> >>> foo = type(foo)(foo.func_code, d, foo.func_name, foo.func_defaults, >> foo.func_closure) > > Wow! I've never seen that, before. Is there documentation for `type(n)(...)` > somewhere? I did find a very useful "Decorator for Binding Constants, b

Re: memory efficient set/dictionary

2007-06-10 Thread Steven D'Aprano
On Sun, 10 Jun 2007 07:27:56 -0700, koara wrote: > What is the best to go about using a large set (or dictionary) that > doesn't fit into main memory? What is Python's (2.5 let's say) > overhead for storing int in the set, and how much for storing int -> > int mapping in the dict? How do you know

Re: Python editors again (it's not the same old request)

2007-06-10 Thread Eric S. Johansson
Chris Mellon wrote: > wx does (in large part), but most likely the problem is that the "rich > text" control used in most editors is not the win32 rich text control, > but instead Scintilla, which is designed for source editing and is > much easier to use. Very few editors, of any kind, use the nat

Re: Python in the Mozilla world

2007-06-10 Thread Eric S. Johansson
Steve Howell wrote: > --- "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > I would not completely give up on the idea of Python > itself running in the browser, although obviously > there have been lots of false starts. > > http://www.voidspace.org.uk/python/weblog/arch_d7_2007_04_28.shtml#e702 i

Re: Python in the Mozilla world

2007-06-10 Thread Steve Howell
--- "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: http://www.voidspace.org.uk/python/weblog/arch_d7_2007_04_28.shtml#e702 > > interesting. Very interesting but I suspect the > message is "don't hold your > breath but don't give up hope." > Exactly. :) > [...] What I need to do would take m

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread John Nagle
[EMAIL PROTECTED] wrote: > On Jun 9, 12:16 pm, James Stroud <[EMAIL PROTECTED]> wrote: > >>Terry Reedy wrote: >> >>>In Python, you have a choice of recursion (normal or tail) >> >>Please explain this. I remember reading on this newsgroup that an >>advantage of ruby (wrt python) is that ruby has ta

Re: memory efficient set/dictionary

2007-06-10 Thread koara
Hello Steven, On Jun 10, 5:29 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > ... > How do you know it won't fit in main memory if you don't know the > overhead? A guess? You've tried it and your computer crashed? exactly > > Please recommend a module that allows persistent set/dict storage +

Select one of 2 functions with the same name ?

2007-06-10 Thread Stef Mientki
hello, For a simulation at different levels, I need different functions with the same name. Is that possible ? I can realize it with a simple switch within each function, but that makes the code much less readable: def Some_Function(): if simulation_level == 1: ... do things in a way

load data infile problem

2007-06-10 Thread moishyyehuda
does any one know why when I execute this mysql statement with python api LOAD DATA INFILE 'data.txt' INTO TABLE merchandise; I get this error and how can I fix it #1045 - Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-10 Thread John Nagle
Josiah Carlson wrote: > Steven D'Aprano wrote: > >> On Sat, 09 Jun 2007 22:52:32 +, Josiah Carlson wrote: >> >>> the only thing that optimization currently does in Python at present >>> is to discard docstrings >> >> >> Python, or at least CPython, does more optimizations than that. Aside >>

Re: Python in the Mozilla world

2007-06-10 Thread Eric S. Johansson
Steve Howell wrote: > --- "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > http://www.voidspace.org.uk/python/weblog/arch_d7_2007_04_28.shtml#e702 >> interesting. Very interesting but I suspect the >> message is "don't hold your >> breath but don't give up hope." >> > > Exactly. :) This is one

Sharon Stone - Anna Kournikova Lindsay lohan

2007-06-10 Thread D - A - T - I - N - G
Sharon Stone - Anna Kournikova Lindsay lohan search engines + cams www.alphasearch.gr www.alphasearch.ru-- http://mail.python.org/mailman/listinfo/python-list

Re: Select one of 2 functions with the same name ?

2007-06-10 Thread 7stud
On Jun 10, 10:37 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > For a simulation at different levels, > I need different functions with the same name. > Is that possible ? > > I can realize it with a simple switch within each function, > but that makes the code much less readable: > > def

Re: Select one of 2 functions with the same name ?

2007-06-10 Thread Francesco Guerrieri
If the functions are f1, f2, f3 you could go this way: def SimulationRun(): if simulation_level = 1: SimulationFunction = f1 else if simulation_level = 2: SimulationFunction = f2 else and in the rest of the code you can refer to SimulationFunction instead of explicitly calling

Re: load data infile problem

2007-06-10 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > does any one know why when I execute this mysql statement with python > api > > LOAD DATA INFILE 'data.txt' INTO TABLE merchandise; > > I get this error and how can I fix it > > #1045 - Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) This has nothin

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | > Terry Reedy wrote: | > > In Python, you have a choice of recursion (normal or tail) [snip Stroud questions] | I'm afraid Terry is wrong here, at least if he meant that CPython had | tail recursion *optimization*. NO!!! I did not m

Re: Needed: FTP Upload Directory Tree script

2007-06-10 Thread kyosohma
On Jun 10, 3:01 am, IanC <[EMAIL PROTECTED]> wrote: > Hi, > > Does anyone know of a function or script to upload an entire > subdirectory tree from a local file space to an FTP server? > > The Python distribution comes with "ftpmirror.py", which performs > a mirror download of a directory tree, but

Re: Repository - file scanner

2007-06-10 Thread kyosohma
On Jun 9, 12:38 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 09 Jun 2007 12:30:49 -0300, <[EMAIL PROTECTED]> escribió: > > > On Jun 8, 2:33 pm, HMS Surprise <[EMAIL PROTECTED]> wrote: > >> Could someone point my muddled head at a/the python repository. I know > >> that one exists bu

Re: Select one of 2 functions with the same name ?

2007-06-10 Thread 7stud
On Jun 10, 11:11 am, 7stud <[EMAIL PROTECTED]> wrote: > On Jun 10, 10:37 am, Stef Mientki <[EMAIL PROTECTED]> > wrote: > > > > > hello, > > > For a simulation at different levels, > > I need different functions with the same name. > > Is that possible ? > > > I can realize it with a simple switch w

Re: pyexe "format"

2007-06-10 Thread hg
John Machin wrote: > On Jun 10, 11:25 am, John Machin <[EMAIL PROTECTED]> wrote: >> On Jun 10, 10:38 am, hg <[EMAIL PROTECTED]> wrote: >> >> > hg wrote: >> > > Hi, >> >> > > Is there a clean way to figure out that a .exe was actually generated >> > > by pyexe ? >> >> > > hg >> >> > I should gave w

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-10 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, I asked: >In article <[EMAIL PROTECTED]>, >ahlongxp <[EMAIL PROTECTED]> wrote: > . > . > . >>I'm a Chinese. >>Language/English is really a big problem for Chinese programmers. >>If python can be writ

Re: How can I obtain the exception object on a generlized except statement?

2007-06-10 Thread Chris Allen
Just what I was looking for thanks Diez and John. -- http://mail.python.org/mailman/listinfo/python-list

Re: New mailing list mirrors

2007-06-10 Thread kirby urner
Thanks tomer, I joined both through Google. Kirby "moe" Urner 4dsolutions.net/ocn/cp4e.html myspace.com/4dstudios [EMAIL PROTECTED] (moe rhymes with Minister of Education was my thinking -- a portfolio I sometimes grab for a gig, but always put back where I found it). On 6/10/07, sebulba <[EMAIL

Re: need help with python

2007-06-10 Thread James T. Dennis
[EMAIL PROTECTED] wrote: > On May 11, 10:16 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: >> On May 11, 9:41 pm, [EMAIL PROTECTED] wrote: [... much ellided ...] ["ellided" is a fancy word for "left out" or "replaced with ellipses."] > I was looking around in my Python folder and

Redux: Allowing 'return obj' in generators

2007-06-10 Thread Dustin J. Mitchell
This question was first brought up in October of 2005[1], and was included in the "Unresolved Issues" section of my microthreading PEP, which I have quietly withdrawn from consideration due to lack of community interest. PEP 255 says Q. Then why not allow an expression on "return" too? A

Re: Select one of 2 functions with the same name ?

2007-06-10 Thread Stef Mientki
thanks Francesco and "7stud", The solution with objects is too difficult, because I want to stay very close to the orginal language, ( so the users can understand the Python code, and the automatic translation becomes as simple as possible). But after some tests, it seems to be quit simple:

Re: Needed: FTP Upload Directory Tree script

2007-06-10 Thread Stefan Schwarzer
Hello Ian, On 2007-06-10 10:01, IanC wrote: > Does anyone know of a function or script to upload an entire > subdirectory tree from a local file space to an FTP server? > > The Python distribution comes with "ftpmirror.py", which performs > a mirror download of a directory tree, but I need the "U

Re: Dynamic subclassing ?

2007-06-10 Thread James T. Dennis
Karlo Lozovina <[EMAIL PROTECTED]> wrote: > manatlan wrote: >> I can't find the trick, but i'm pretty sure it's possible in an easy >> way. > It's somewhat easy, boot looks ugly to me. Maybe someone has a more > elegant solution: > In [6]: import new > In [13]: class Button: >: def

codecs / subprocess interaction: utf help requested

2007-06-10 Thread smitty1e
The first print statement does what you'd expect. The second print statement has rather a lot of rat in it. The goal here is to write a function that will return the man page for some command (mktemp used as a short example here) as text to client code, where the groff markup will be chopped to ext

RE: Hooking exceptions outside of call stack

2007-06-10 Thread Warren Stringer
Hey Josiah, I just spent a couple hours with your example, and it explains a lot. Some of your interactive session got garbled, so am reposting your merged_namespace example, with tweaks: #- def merged_namespace(*ns): try: __builti

Re: memory efficient set/dictionary

2007-06-10 Thread Rafael Darder Calvo
> > > Please recommend a module that allows persistent set/dict storage + > > > fast query that best fits my problem, > > > > What is the problem you are trying to solve? How many keys do you have? > > Corpus processing. There are in the order of billions to tens of > billions keys (64bit integers)

Re: MI5 Persecution: Goldfish and Piranha 29/9/95 (5104)

2007-06-10 Thread Shmuel (Seymour J.) Metz
In <[EMAIL PROTECTED]>, on 06/10/2007 at 04:57 AM, "Mike" <[EMAIL PROTECTED]> said: >And this is here because ??? 1. MI5 didn't take him down like they were supposed to 2. You didn't include followup-to in your header -- Shmuel (Seymour J.) Metz, SysProg and JOAT

Re: Select one of 2 functions with the same name ?

2007-06-10 Thread 7stud
On Jun 10, 2:03 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: > thanks Francesco and "7stud", > > The solution with objects is too difficult, > because I want to stay very close to the orginal language, > Why would you want to duplicate poorly written code? -- http://mail.python.org/mailman/listin

Re: Select one of 2 functions with the same name ?

2007-06-10 Thread BJörn Lindqvist
On 6/10/07, Stef Mientki <[EMAIL PROTECTED]> wrote: > I can realize it with a simple switch within each function, > but that makes the code much less readable: > > def Some_Function(): >if simulation_level == 1: > ... do things in a way >elif simulation_level == 2: > ... do things

Re: codecs / subprocess interaction: utf help requested

2007-06-10 Thread John Machin
On Jun 11, 7:17 am, smitty1e <[EMAIL PROTECTED]> wrote: > The first print statement does what you'd expect. > The second print statement has rather a lot of rat in it. > The goal here is to write a function that will return the man page for > some command (mktemp used as a short example here) as te

Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-06-10 Thread Larry Elmore
Twisted wrote: > On Jun 9, 8:21 pm, "BCB" <[EMAIL PROTECTED]> wrote: >> "Paul McGuire" <[EMAIL PROTECTED]> wrote in message >> >> news:[EMAIL PROTECTED] >> >>> On Jun 9, 6:49 am, Lew <[EMAIL PROTECTED]> wrote: > In particular, Perl code looks more like line > noise than like code from any k

Re: How to get existing frames in non-current thread?

2007-06-10 Thread Gabriel Genellina
En Sun, 10 Jun 2007 09:17:21 -0300, Fabio Zadrozny <[EMAIL PROTECTED]> escribió: > On 6/10/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> >> En Sat, 09 Jun 2007 21:40:40 -0300, Fabio Zadrozny <[EMAIL PROTECTED]> >> escribió: >> >> > Is there some way to get all the frames for any given thre

Re: Select one of 2 functions with the same name ?

2007-06-10 Thread Stef Mientki
7stud wrote: > On Jun 10, 2:03 pm, Stef Mientki <[EMAIL PROTECTED]> > wrote: >> thanks Francesco and "7stud", >> >> The solution with objects is too difficult, >> because I want to stay very close to the orginal language, >> > > Why would you want to duplicate poorly written code? > I didn't know

Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-06-10 Thread Lew
Twisted wrote: >> Oh come on! Toy languages (such as any set of editor commands) and >> joke languages (ala Intercal) don't count, even if they are >> technically Turing-complete. ;) >> >> Nor does anything that was designed for the every-character-at-a- >> premium punch-card era, particularly if i

Tits Live Webcams Boobs all naturals

2007-06-10 Thread en.wikipedia.org
http://www.tits.sc/ The Best Resource for Tits on the Net. -- http://mail.python.org/mailman/listinfo/python-list

Re: Repository - file scanner

2007-06-10 Thread John Machin
On Jun 9, 5:33 am, HMS Surprise <[EMAIL PROTECTED]> wrote: > Greetings, > > Could someone point my muddled head at a/the python repository. I know > that one exists but cannot find it again. In particular I am looking > for a standalone search tool that given a path searches files for a > text stri

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-10 Thread Steve Howell
--- John Nagle <[EMAIL PROTECTED]> wrote: > > With this, the heavy optimizations are possible. > Strength reduction. Hoisting > common subexpressious out of loops. Hoisting > reference count updates out of > loops. Keeping frequently used variables in > registers. And elimination of > many u

Re: Dynamic subclassing ?

2007-06-10 Thread Gabriel Genellina
En Sun, 10 Jun 2007 18:16:12 -0300, James T. Dennis <[EMAIL PROTECTED]> escribió: > When I try something like this I run into a little problem: > > class Foo: > def foo(self): > return "foo" > class Bar: > def bar(self): > return "bar"

Re: Python in the Mozilla world

2007-06-10 Thread Steve Howell
--- "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > Steve Howell wrote: > > --- "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > > > http://www.voidspace.org.uk/python/weblog/arch_d7_2007_04_28.shtml#e702 > >> interesting. Very interesting but I suspect the > >> message is "don't hold your > >

Re: codecs / subprocess interaction: utf help requested

2007-06-10 Thread smitty1e
On Jun 10, 6:10 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jun 11, 7:17 am, smitty1e <[EMAIL PROTECTED]> wrote: > > > The first print statement does what you'd expect. > > The second print statement has rather a lot of rat in it. > > The goal here is to write a function that will return the ma

Re: Python in the Mozilla world

2007-06-10 Thread Eric S. Johansson
Steve Howell wrote: > --- "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > >> Steve Howell wrote: >>> --- "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: >>> > http://www.voidspace.org.uk/python/weblog/arch_d7_2007_04_28.shtml#e702 interesting. Very interesting but I suspect the message

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread Alexander Schmolck
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 09 Jun 2007 22:42:17 +0100, Alexander Schmolck wrote: > >>> As for why tail calls are not optimized out, it was decided that being able >>> to have the stack traces (with variable information, etc.) was more useful >>> than offering tail call o

Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-06-10 Thread Reilly
On Jun 10, 3:11 pm, Larry Elmore <[EMAIL PROTECTED]> wrote: > Twisted wrote: > > On Jun 9, 8:21 pm, "BCB" <[EMAIL PROTECTED]> wrote: > >> "Paul McGuire" <[EMAIL PROTECTED]> wrote in message > > >>news:[EMAIL PROTECTED] > > >>> On Jun 9, 6:49 am, Lew <[EMAIL PROTECTED]> wrote: > > In particular,

Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-06-10 Thread BCB
> > Neither APL nor Snobol nor J are toy or joke languages I wholeheartedly agree, and did not mean to imply as much in my original post, in which my intent was to emphasize the fact that, until you learn the language, a J program /does/ resemble line noise! :-) -- http://mail.python.org/m

Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-06-10 Thread Twisted
On Jun 10, 8:50 pm, "BCB" <[EMAIL PROTECTED]> wrote: > I wholeheartedly agree, and did not mean to imply as much in my original > post, in which my intent was to emphasize the fact that, until you learn the > language, a J program /does/ resemble line noise! :-) Eh. This isn't right. The whole dis

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-10 Thread John Nagle
Steve Howell wrote: > --- John Nagle <[EMAIL PROTECTED]> wrote: > >>With this, the heavy optimizations are possible. >>Strength reduction. Hoisting >>common subexpressious out of loops. Hoisting >>reference count updates out of >>loops. Keeping frequently used variables in >>registers. And el

Re: Python in the Mozilla world

2007-06-10 Thread Steve Howell
--- "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > > this is good to know except I am somewhat cautious > about the end result given > that it's from Microsoft (explained below) > Believe me, I agree! I work mostly in the Unix world now, but I've done enough serious development in the Windo

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread Steven D'Aprano
On Mon, 11 Jun 2007 01:28:09 +0100, Alexander Schmolck wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > >> On Sat, 09 Jun 2007 22:42:17 +0100, Alexander Schmolck wrote: >> As for why tail calls are not optimized out, it was decided that being able to have the stack traces (with va

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > Not tail calls, in general, no. > > Sorry, how does that work? You're suggesting that there is an algorithm > which the compiler could follow to optimize away tail-recursion, but human > beings can't follow the same algorithm? > > Now I'm confused.

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-10 Thread Kay Schluehr
On Jun 11, 12:43 am, Steve Howell <[EMAIL PROTECTED]> wrote: > To the extent that some of these optimizations could > be achieved by writing better Python code, it would > nice for optimization tools to have a "suggest" mode. Is anyone out there who uses MS Word and doesn't deactivate the "sugges

read 9 bytes

2007-06-10 Thread nik
Hi, I need to read a 9 byte response from a device on the serial port. >From reading the pySerial documentation it appears that I can only read in characters at a time. If I do: serialport.read(4) I would get 8 bytes, and if I did serialport.read(5) I think the port will block until a time out, s

Re: read 9 bytes

2007-06-10 Thread Gabriel Genellina
En Mon, 11 Jun 2007 00:52:28 -0300, nik <[EMAIL PROTECTED]> escribió: > I need to read a 9 byte response from a device on the serial port. >> From reading the pySerial documentation it appears that I can only > read in characters at a time. > > If I do: serialport.read(4) > I would get 8 bytes, W

RE: Python optimization (was Python's "only one way to do it"philosophy isn't good?)

2007-06-10 Thread Doug Phillips
> Is anyone out there who uses MS Word and doesn't deactivate > the "suggest" mode i.e. Clippy? Me... I don't install Clippy (or any of his horribly annoying friends) to start with. :) On the topic though, the suggest mode of the MS help system is generally way off-base, even for my 80-yr-old gr

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-10 Thread Steve Howell
--- Kay Schluehr <[EMAIL PROTECTED]> wrote: > On Jun 11, 12:43 am, Steve Howell > <[EMAIL PROTECTED]> wrote: > > > To the extent that some of these optimizations > could > > be achieved by writing better Python code, it > would > > nice for optimization tools to have a "suggest" > mode. > > Is

Why does one regex routine work and not the other one?

2007-06-10 Thread TtfnJohn
I have two small scripts that while on the surface should both work the problem is they don't. Here's the first one: import re testString = 'Thap,fpvi,[EMAIL PROTECTED]:[EMAIL PROTECTED] dialin.net:[EMAIL PROTECTED]::' reobj = re.compile(r"(.*),(.*),(.*):::(.*):::(.*)") testString1 = reobj.

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-10 Thread Josiah Carlson
John Nagle wrote: > Josiah Carlson wrote: [snip] >> Constant folding happens regardless of optimization level in current >> Pythons. > >> So really, assert and docstring removals. Eh. > >It's hard to optimize Python code well without global analysis. > The problem is that you have to make s

Re: updating db with csv

2007-06-10 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >#1 If any one familiar with godaddy hosting. They have apparently have >a hosing server i.e.(scripts, html files etc.), and a server for >databases. How can I import from my script, with a csv. if the db is >on a different server than the script server. What does this

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread Josiah Carlson
Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >>> Not tail calls, in general, no. >> Sorry, how does that work? You're suggesting that there is an algorithm >> which the compiler could follow to optimize away tail-recursion, but human >> beings can't follow the same algorithm? >>

Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-06-10 Thread Joachim Durchholz
Twisted schrieb: > After all, you can't really take a language seriously if > it's either impossible to write unmaintainable code in it That's true for any language. Substitute "not straightforward" for "impossible", and you have a condition that actually distinguishes languages. > OR impossibl

Re: read 9 bytes

2007-06-10 Thread Tim Roberts
nik <[EMAIL PROTECTED]> wrote: > >I need to read a 9 byte response from a device on the serial port. >From reading the pySerial documentation it appears that I can only >read in characters at a time. Yes, but it is 8-bit characters. That is, characters == bytes in this instance. >If I do: seria

Re: memory efficient set/dictionary

2007-06-10 Thread Josiah Carlson
Rafael Darder Calvo wrote: >> > > Please recommend a module that allows persistent set/dict storage + >> > > fast query that best fits my problem, >> > >> > What is the problem you are trying to solve? How many keys do you have? >> >> Corpus processing. There are in the order of billions to tens of