Re: Where is the document of python-mode.el

2005-09-14 Thread Fredrik Lundh
"JackPhil" <[EMAIL PROTECTED]> wrote: > I searched in the python-mode.el, sf.net, python.org, and found nothing what document? if you want documentation, switching to a python buffer and typing alt-X followed by "describe-mode" works for me (alternatively, press control-H followed by M): ..

Python linear algebra module -- requesting comments on interface

2005-09-14 Thread C. Barnes
Szabolcs Nagy wrote: >nice interface, but with 3d apps i prefer cgkit's approach, which has >vec3, vec4, mat3, mat4 and quat types with lots of useful functions for >3d graphics (like mat4.looakAt(pos, target, up) or mat3.toEulerXYZ()) >there are other libs with similar types and functions: >cgki

calling .Net Webservice using SOAPpy

2005-09-14 Thread Achim Domma (SyynX Solutions GmbH)
Hi, I'm using SOAPpy to call a .Net Webservice. Using WSDL.Proxy(service_url) works fine but has to get the WSDL each time from the server. If I try SOAPpy.SOAPProxy(service_url) the call fails with low level SOAP errors. Was somebody able to call a .Net service without using WSDL.Proxy and

retrieve data using FTP in Python

2005-09-14 Thread swarna pulavarty
Hi all,   I am new to this Python group and to Python . I need to retrieve data from an arbitrary URL and save it to a file. Can anyone tell me how to retrieve "any" data using FTP modules in Python ? And also, Can you suggest me some books and online references to get familiar with Python and es

How to make python24.dll smaller ?

2005-09-14 Thread Stormbringer
Hello, I am trying to make an executable for one of my applications with cx freeze. All works ok although I must include python24.dll with it if I want to redistribute it. The big problem is python24.dll size, it's 1.8 MB and I am sure I don't need much of what's in there. I downloaded python sou

Builtin classes list, set, dict reimplemented via B-trees

2005-09-14 Thread barnesc
Hi again, Since my linear algebra library appears not to serve any practical need (I found cgkit, and that works better for me), I've gotten bored and went back to one of my other projects: reimplementing the Python builtin classes list(), set(), dict(), and frozenset() with balanced trees (speci

Re: read stdout/stderr without blocking

2005-09-14 Thread Adriaan Renting
>>>Jacek Pop*awski <[EMAIL PROTECTED]> 09/13/05 9:23 am >>> Grant Edwards wrote: >On 2005-09-12, Jacek Pop?awski <[EMAIL PROTECTED]> wrote: > >>> ready = select.select(tocheck, [], [], 0.25) ##continues after 0.25s >>> for file in ready[0]: >>> try: >>>

Re: read stdout/stderr without blocking

2005-09-14 Thread Adriaan Renting
Please note that popen uses pipes, which are block devices, not character devices, so the writes will be done in blocks instead of characters/lines, (you can only read something _after_ the application at the other end of the pipe has done a flush or written 8192 bytes. When reading from a pty

Re: Software bugs aren't inevitable

2005-09-14 Thread Paul Rubin
"Paddy" <[EMAIL PROTECTED]> writes: > A work colleague circulated this interesting article about reducing > software bugs by orders of magnitude: > http://www.spectrum.ieee.org/WEBONLY/publicfeature/sep05/0905ext.html This gets a not found error. Got a different link? > Some methods they talk

An interesting python problem

2005-09-14 Thread Johnny Lee
Hi, Look at the follow command in python command line, See what's interesting?:) >>> class A: i = 0 >>> a = A() >>> b = A() >>> a.i = 1 >>> print a.i, b.i 1 0 --- >>> class A: arr = [] >>> a = A() >>> b = A() >>> a <__main__.A instance at 0x

Re: CGIHTTPServer, popen3, and windoze

2005-09-14 Thread Fuzzyman
Fuzzyman wrote: > Hello all, > > I may well post this a a bug on Monday (after testing with Python 2.3) > - but I thought I'd post here to see if anyone has any ideas. > Hmm... testing on Python 2.3 I *don't* have the same problem - but it's very frustrating under Python 2.4 (different machine).

Re: Builtin classes list, set, dict reimplemented via B-trees

2005-09-14 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > Hi again, > > Since my linear algebra library appears not to serve any practical > need (I found cgkit, and that works better for me), I've gotten bored > and went back to one of my other projects: reimplementing the Python > builtin classes list(), set(), dict(), a

Re: help in simplification of code [string manipulation]

2005-09-14 Thread Christophe
John a écrit : > Thanks for your replies... > Solved my problem. Even so, I made a big mistake here. The Split function is of no use because there is already a list of flags. Better do it like that : libs = Split('glut GLU GL m') env.Append (LIBS = libs) BTW, Split is a scons function. > Christ

network parameters

2005-09-14 Thread le dahut
Hi, Is there a way to get network parameters (number of network interfaces, ip address(es), DNS, gateway) on a linux station using python 2.3 ? Klaas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Database Scripts

2005-09-14 Thread Simon Brunning
On 13 Sep 2005 11:32:05 -0700, Chuck <[EMAIL PROTECTED]> wrote: > BTW, where is the DB-API docs for python? Google is your friend - , 1st hit. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mail

Re: An interesting python problem

2005-09-14 Thread bruno modulix
Johnny Lee wrote: > Hi, >Look at the follow command in python command line, See what's > interesting?:) > > class A: > > i = 0 > a = A() b = A() a.i = 1 print a.i, b.i > > 1 0 Quite what I would expect. First you declare i as being a *class* attribute of A, with

Re: round() wrong in Python 2.4?

2005-09-14 Thread Nils Grimsmo
I am running Debian unstable for 386. Python 2.4 is from the official package archive, and seems to be compiled with GCC 4.0.2. $ dpkg -l python2.4 ii python2.4 2.4.1-4 ... $ python2.4 Python 2.4.1+ (#2, Sep 4 2005, 21:58:51) [GCC 4.0.2 20050821 (prerelease) (Debian 4.0.1-6)] on l

Re: Unexpected Behavior Iterating over a Mutating Object

2005-09-14 Thread bruno modulix
Dave Hansen wrote: (snip code snippets and sensible explanations) > Again, iterating over an item that is mutating seems like a Bad > Idea(tm) to me. It as *always* been a bad idea to modify a list in place (I mean adding or removing items) while iterating over it, whatever the language. If you

Re: An interesting python problem

2005-09-14 Thread Johnny Lee
bruno modulix wrote: > > I dont see anything interesting nor problematic here. If you understand > the difference between class attributes and instance attributes, the > difference between mutating an object and rebinding a name, and the > attribute lookup rules in Python, you'll find that all thi

new programms

2005-09-14 Thread Burgs A. Polygonal
Come and gat some -- http://mail.python.org/mailman/listinfo/python-list

Re: An interesting python problem

2005-09-14 Thread bruno modulix
Johnny Lee wrote: > bruno modulix wrote: > >>I dont see anything interesting nor problematic here. If you understand >>the difference between class attributes and instance attributes, the >>difference between mutating an object and rebinding a name, and the >>attribute lookup rules in Python, you'

Re: How to make python24.dll smaller ?

2005-09-14 Thread Stormbringer
Ok, for anyone interested on the issue: I have found the solution. I commented out some module lines inside config.c (modules I know for certain I will not use) and removed the module .c files from the project. Biggest save was when I removed the Asian character encodings, reduced size by about 65

Re: What XML lib to use?

2005-09-14 Thread Edvard Majakari
Kalle Anke <[EMAIL PROTECTED]> writes: > I'm confused, I want to read/write XML files but I don't really understand > what library to use. > > I've used DOM-based libraries in other languages, is PyXML the library to > use? It depends. Like there's no best car - "best" is very dependant on use

Re: What XML lib to use?

2005-09-14 Thread Paul Boddie
Kalle Anke wrote: > I've used DOM-based libraries in other languages, is PyXML the library to > use? I would start off with minidom; a tutorial I once wrote can be found here: http://www.boddie.org.uk/python/XML_intro.html That should demonstrate some minor differences between PyXML-style DOMs a

Re: An interesting python problem

2005-09-14 Thread Adriaan Renting
In my mind all Python variables are some kind of "named pointers", I find that thinking this way helps me a lot in understanding what I'm doing. I know that this is not completely technically correct as in the first two examples there is actually a new a.i/a.arr created that shadows A.i, but thi

Re: round() wrong in Python 2.4?

2005-09-14 Thread Jeremy Sanders
Robert Kern wrote: > That's not what he's asking about. He's asking why his Python 2.3 rounds > 0.0225 *up* to 0.023 while his Python 2.4 rounds *down* to 0.022. It's > the change in behavior that he's concerned with and isn't just the usual > floating point problem. You can't rely on either bein

Re: PyGTK or wXPython?

2005-09-14 Thread paron
Just a thought -- you might consider using a HTTP/browser UI. It's graphically ugly, but it's familiar for users, and it goes cross-platform very well. Plus, if you decide to move the app to a Web server, you're already done. Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: round() wrong in Python 2.4?

2005-09-14 Thread Antoon Pardon
Op 2005-09-13, Robert Kern schreef <[EMAIL PROTECTED]>: > Jeremy Sanders wrote: >> Nils Grimsmo wrote: >> >>>Why did round() change in Python 2.4? >> >> It the usual floating point representation problem. 0.0225 cannot be >> represented exactly: > > That's not what he's asking about. He's asking

tk.createfilehandler() broken with threaded tcl?

2005-09-14 Thread klappnase
Hello everyone, I am running into troubles with some of my scripts that make use of tk.createfilehandler() to catch the output messages of subprocesses I started with popen2.Popen4() (debian linux, python-2.3.5, tk-8.4.9). Sometimes when those background processes are running it happens that the g

Re: What XML lib to use?

2005-09-14 Thread paron
One more vote for Amara! I think it's unmatched for ease of use, if you already know Python. Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Magic Optimisation

2005-09-14 Thread ABO
Bengt Richter wrote: > On 5 Sep 2005 07:27:41 -0700, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > > >I still think there are savings to be had by looping inside the > >try-except block, which avoids many setup/teardown exception handling > >steps. This is not so pretty in another way (repeated whil

some advice about Python GUI apps

2005-09-14 Thread mitsura
Hi, I am writing a program in Python and I am using wx.Python for the GUI. I have no prior GUI and Python experience so that's why I turn to the specialists for aid. Basically, my app is a wx.tree object with items. You can click on each item and set some properties of the item (Pydata). To set th

Re: An interesting python problem

2005-09-14 Thread bruno modulix
Adriaan Renting wrote: > In my mind all Python variables are some kind of "named pointers", Technically, they are key/value pairs in a dictionnary, the key being the name and the value a reference to an object. > I > find that thinking this way helps me a lot in understanding what I'm > doing. I

Re: An interesting python problem

2005-09-14 Thread Steve Holden
Adriaan Renting wrote: > In my mind all Python variables are some kind of "named pointers", I find > that thinking this way helps me a lot in understanding what I'm doing. I know > that this is not completely technically correct as in the first two examples > there is actually a new a.i/a.arr cr

Re: round() wrong in Python 2.4?

2005-09-14 Thread Robert Kern
Antoon Pardon wrote: > Op 2005-09-13, Robert Kern schreef <[EMAIL PROTECTED]>: > >>Jeremy Sanders wrote: >> >>>Nils Grimsmo wrote: >>> Why did round() change in Python 2.4? >>> >>>It the usual floating point representation problem. 0.0225 cannot be >>>represented exactly: >> >>That's not what

Removing duplicates from a list

2005-09-14 Thread Rubinho
I've a list with duplicate members and I need to make each entry unique. I've come up with two ways of doing it and I'd like some input on what would be considered more pythonic (or at least best practice). Method 1 (the traditional approach) for x in mylist: if mylist.count(x) > 1:

Re: some advice about Python GUI apps

2005-09-14 Thread Franz Steinhaeusler
On 14 Sep 2005 04:26:11 -0700, [EMAIL PROTECTED] wrote: >Hi, > >I am writing a program in Python and I am using wx.Python for the GUI. >I have no prior GUI and Python experience so that's why I turn to the >specialists for aid. Hello Kris, I think the specialists are in the wxPython-mailing list

Re: Software bugs aren't inevitable

2005-09-14 Thread Steven D'Aprano
On Wed, 14 Sep 2005 01:05:55 -0700, Paul Rubin wrote: > There's a famous paper by John Hughes called "Why Functional > Programming Matters" that (cheap oversimplification) says you should > never modify the value of any variable. So, no increments, not even > for loops (use recursion instead).

Re: some advice about Python GUI apps

2005-09-14 Thread mitsura
Hi, the properties of the items are just virtual properties like e.g. color, icon, gender. Just image that an item represent a human. You can then click on the item and start a 'Set Human Properties' windows (a frame with a Notebook object with multiple tabs). In the 'Set Human Properties' window

Re: Removing duplicates from a list

2005-09-14 Thread Thomas Guettler
Am Wed, 14 Sep 2005 04:38:35 -0700 schrieb Rubinho: > I've a list with duplicate members and I need to make each entry > unique. > > I've come up with two ways of doing it and I'd like some input on what > would be considered more pythonic (or at least best practice). > mylist = set(mylist) > my

Re: Why do Pythoneers reinvent the wheel?

2005-09-14 Thread Magnus Lycka
Claudio Grondi wrote: > To name a simplest example: > What should I do to find a piece of code taking an > integer and giving a string with binary form of a > number? How to put some available pieces of code > together if the binary form is needed and the integer > is provided as a string holding i

Re: PyGTK or wXPython?

2005-09-14 Thread Thomas Guettler
Am Tue, 13 Sep 2005 07:01:57 -0700 schrieb TPJ: >> Beside this, wxPython (and wxWidgets) is often told to be more complete, >> better documented and better supported than GTK/PyGTK. > > Is wxPython often told to be more documented? By who? > > Several months ago I wanted to choose a nice GUI for

Re: Removing duplicates from a list

2005-09-14 Thread Will McGugan
Rubinho wrote: > I've a list with duplicate members and I need to make each entry > unique. > > I've come up with two ways of doing it and I'd like some input on what > would be considered more pythonic (or at least best practice). > > Method 1 (the traditional approach) > > for x in mylist: >

Re: Software bugs aren't inevitable

2005-09-14 Thread Jerzy Karczmarczuk
Steven D'Aprano recommends iteration over recursion: > For instance, try these two simple functions for the nth number > in the Fibonacci sequence: > > def fibr(n): > "Recursive version of Fibonacci sequence." > if n == 0: return 0 > elif n == 1: return 1 > else:return fibr(n

Re: Removing duplicates from a list

2005-09-14 Thread Peter Otten
Rubinho wrote: > I've a list with duplicate members and I need to make each entry > unique. > > I've come up with two ways of doing it and I'd like some input on what > would be considered more pythonic (or at least best practice). > > Method 1 (the traditional approach) > > for x in mylist: >

Re: Software bugs aren't inevitable

2005-09-14 Thread Giles Brown
Paddy wrote: > I was wondering what Praxis thought of Python, and how good it would be > if a Praxis engineer gave a critique of Python as a part of a flow for > producing low bug-count software. I used to work at Praxis about 4 years ago and Perl was their scripting language of choice at that tim

Re: What XML lib to use?

2005-09-14 Thread Fredrik Lundh
Edvard Majakari wrote: > Using a SAX / full-compliant DOM parser could be good for learning things, > though. As I said, depends a lot. since there are no *sane* reasons to use SAX or DOM in Python, that's mainly a job security issue... -- http://mail.python.org/mailman/listinfo/python-lis

How can I find all the dependencies of a py?

2005-09-14 Thread could ildg
when  I run a.py, it uses b.py,c.py and a.py uses x.py,y.py How could I find all the modules that a.py and all of its imported modules? Is there any built in functions or any tools to do this? Thank you~, I really want to know it. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to protect Python source from modification

2005-09-14 Thread Magnus Lycka
Frank Millman wrote: > I have seen Twisted mentioned many times in this ng, but I have no idea > what it actually does. Can someone tell me in simple terms what > advantage it might give me over a multi-threaded socket server program. More control. Less resource usage. Twisted also provides a very

warning when doubly liked list is defined globally

2005-09-14 Thread chand
Hi., In my api.py file 'g_opt_list' is defined globally g_opt_list =[[],[],[],[],[],[],[]] when I run the py file, I am getting the Following Error SyntaxWarning: name 'g_opt_list' is used prior to global declaration SyntaxWarning: name 'layers' is used prior to global declaration Please let me

Dr. Dobb's Python-URL! - weekly Python news and links (Sep 13)

2005-09-14 Thread Diez B. Roggisch
QOTW: "In my view, the doctrinaire', indeed religious, adherence to OO purity has harmed our discipline considerably. Python was a nice breath of fresh air when I discovered it exactly because it does not have this slavish committment to an exclusively OO model." -- Tim Daneliuk "[W]hen you add a

"week-year" conversion to date

2005-09-14 Thread oyvgi
I was wondering if it there is an "easy" way to get the dd-mm- from ww-. I would like to get, for example the first day (date-month-year) in the week i specify. Found plenty of ways to go th other way, but none that give me the reverse. Idealy I would like both the beginning date/time and

Re: Removing duplicates from a list

2005-09-14 Thread Rubinho
Peter Otten wrote: > Rubinho wrote: > > > I've a list with duplicate members and I need to make each entry > > unique. > > > > I've come up with two ways of doing it and I'd like some input on what > > would be considered more pythonic (or at least best practice). > > > > Method 1 (the traditional

Builtin classes list, set, dict reimplemented via B-trees

2005-09-14 Thread barnesc
>barnesc at engr.orst.edu wrote: > > So my question is: are there any other *practical* applications of a > > B-tree based list/set/dict ? In other words, is this module totally > > worth coding, or is it just academic wankery and theoretical flim > > flam ? :) > >B-trees are specifically designe

test

2005-09-14 Thread s051509
This is just a try. bye! -- http://mail.python.org/mailman/listinfo/python-list

test

2005-09-14 Thread s051509
This is just a try. bye! -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Python 2.4: Unbuffered flag causes SyntaxError on interactive sessions?

2005-09-14 Thread Reinhold Birkenfeld
Irmen de Jong wrote: > Michael Hoffman wrote: >> Lonnie Princehouse wrote: >> >>> C:\>python -u >>> Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] >>> on win32 >>> Type "help", "copyright", "credits" or "license" for more information. >>> >> print 'hello' >>> >>> >>> F

Re: Builtin classes list, set, dict reimplemented via B-trees

2005-09-14 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The bset() and bdict() classes improve upon the builtin set and > dictionary types by maintaining the elements in sorted order. > > Generally, the b* classes are a factor of O(log(N)) slower[2] than the > corresponding builtin classes,

Re: "week-year" conversion to date

2005-09-14 Thread Rune Strand
year = '2005' week = 50 weekday = 1 # Monday is 1 time_expr = '%s, %s, %s' % (year, week, weekday) time_struct = time.strptime(time_expr, "%Y, %W, %w") print time.strftime("%Y%m%d", time_struct) But the datetime module may have an easier way -- http://mail.python.org/mailman/listinfo/python-li

Re: PyGTK or wXPython?

2005-09-14 Thread Magnus Lycka
Rod W wrote: > I'm just starting out on Python but my primary goal is to provide > applications with some user interface (GUI). > > Can someone point me to a good comparison of whether I should use > wxPython (with wxGlade I assume) or PyGTK (with Glade I assume)? What OS(es) do yo need to supp

Re: Why do Pythoneers reinvent the wheel?

2005-09-14 Thread konrad . hinsen
Stefano Masini wrote: > There are a few ares where everybody seems to be implementing their > own stuff over and over: logging, file handling, ordered dictionaries, > data serialization, and maybe a few more. > I don't know what's the ultimate problem, but I think there are 3 main > reasons: > 1)

Re: "week-year" conversion to date

2005-09-14 Thread Eddie Corns
[EMAIL PROTECTED] writes: >I was wondering if it there is an "easy" way to get the dd-mm- from >ww-. >I would like to get, for example the first day (date-month-year) in the >week i specify. Found plenty of ways to go th other way, but none that >give me the reverse. >Idealy I would like

Re: Removing duplicates from a list

2005-09-14 Thread Christian Stapfer
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I do this: > > def unique(keys): >unique = [] >for i in keys: >if i not in unique:unique.append(i) >return unique > > I don't know what is faster at the moment. This is quadratic, O(n^2), in the length n of the list

Writing at the beginning of a file

2005-09-14 Thread Thierry Lam
Let's say I already wrote a file and have the following: testing testing testing testing testing testing Is there an easy way to write something of variable length at the top of the file? For example, 6 testing written testing testing testing testing testing testing I tried to write some garba

Re: Magic Optimisation

2005-09-14 Thread Terry Reedy
"ABO" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > There are other "optimisations" that could be applied that make this > code faster but uglier. For example, putting another "while True: loop > inside the try block to avoid the try block setup each iteration. In CPython, 'setti

Re: Removing duplicates from a list

2005-09-14 Thread martijn
I do this: def unique(keys): unique = [] for i in keys: if i not in unique:unique.append(i) return unique I don't know what is faster at the moment. -- http://mail.python.org/mailman/listinfo/python-list

Re: What XML lib to use?

2005-09-14 Thread Paul Boddie
Fredrik Lundh wrote: > since there are no *sane* reasons to use SAX or DOM in Python, that's mainly > a job security issue... While I doubt that anyone would really recommend exclusive DOM API usage for significant XML processing tasks (or for anything other than educational purposes), I think you

Re: Magic Optimisation

2005-09-14 Thread Paul McGuire
Terry - If setting up a try-block is as fast (or "takes as long") as one iteration loop, then wont putting a try-block inside a loop double the execution time? -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Python Search Engine app

2005-09-14 Thread Harlin Seritt
Hi, Is anyone aware of an available open-source/free search engine app (something similar to HTDig) written in Python that is out there? Googling has turned up nothing. Thought maybe I'd mine some of you guys' minds on this. thanks, Harlin Seritt Internet Villa: www.seritt.org -- http://mail.p

Re: python-dev Summary for 2005-08-01 through 2005-08-15

2005-09-14 Thread Steve Tregidgo
Hi, on 2005-08-30 01:45 Tony Meyer said the following: > [The HTML version of this Summary is available at > http://www.python.org/dev/summary/2005-08-01_2005-08-15.html] ... > Many revision control systems were extensively discussed, including > `Subversion`_ (SVN), `Perforce`_, `Mercurial`_, and

Re: round() wrong in Python 2.4?

2005-09-14 Thread Grant Edwards
On 2005-09-14, Robert Kern <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: >> 0.0225 isn't representable and it happens that the actual number >> you get differ. Now which number python should choose when it is >> fed 0.0225, I don't know. But expressing the different behaviour >> as a change in

Re: Writing at the beginning of a file

2005-09-14 Thread Paul McGuire
Thierry - Check out the StringIO module. It will allow you to buffer the whole file into a string, and then give you a pseudo file pointer to the string buffer, so that your "fp.write"s will work unchanged. -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing at the beginning of a file

2005-09-14 Thread Grant Edwards
On 2005-09-14, Thierry Lam <[EMAIL PROTECTED]> wrote: > Let's say I already wrote a file and have the following: > > testing > testing testing > testing testing testing > > Is there an easy way to write something of variable length at the top > of the file? No. [...] > The other way to do what I

Re: Removing duplicates from a list

2005-09-14 Thread Rocco Moretti
Rubinho wrote: > I can't imagine one being much faster than the other except in the case > of a huge list and mine's going to typically have less than 1000 > elements. To add to what others said, I'd imagine that the technique that's going to be fastest is going to depend not only on the lengt

Re: python-dev Summary for 2005-08-01 through 2005-08-15

2005-09-14 Thread Steve Tregidgo
I wrote: > Take a look at the HTML version of this summary... Argh! Sorry everyone, I meant to send that to just the python-dev summary chaps, not to the whole list. An email mistake I should have grown out of years ago. :-( -- Steve Tregidgo -- http://mail.python.org/mailman/listinfo/python

Re: Removing duplicates from a list

2005-09-14 Thread Steven D'Aprano
On Wed, 14 Sep 2005 13:28:58 +0100, Will McGugan wrote: > Rubinho wrote: >> I can't imagine one being much faster than the other except in the case >> of a huge list and mine's going to typically have less than 1000 >> elements. > > I would imagine that 2 would be significantly faster. Don't

Re: How to protect Python source from modification

2005-09-14 Thread Frank Millman
Magnus Lycka wrote: > Frank Millman wrote: > > I have seen Twisted mentioned many times in this ng, but I have no idea > > what it actually does. Can someone tell me in simple terms what > > advantage it might give me over a multi-threaded socket server program. > > More control. Less resource usa

Re: Software bugs aren't inevitable

2005-09-14 Thread Terry Reedy
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Which works wonderfully as an academic exercise, but doesn't tend to work > so terribly well in the real world where the performance and > resource-requirement differences between iteration and recursion can be > sign

Re: appended crontab entries with py script

2005-09-14 Thread rbt
On Tue, 2005-09-13 at 23:18 -0400, Mike Meyer wrote: > rbt <[EMAIL PROTECTED]> writes: > > > How can I safely append a crontab entry to a crontab file > > progammatically with Python? > > Well, one way would be to invoke the system crontab utility and use an > "editor" that passes the file to you

Re: Removing duplicates from a list

2005-09-14 Thread Will McGugan
Steven D'Aprano wrote: > > > Don't imagine, measure. > > Resist the temptation to guess. Write some test functions and time the two > different methods. But first test that the functions do what you expect: > there is no point having a blindingly fast bug. Thats is absolutely correct. Although

Oblique Strategies

2005-09-14 Thread robin
The Oblique Strategies were originally a set of one-hundred cards, each bearing a short phrase. They were devised by Brian Eno and Peter Schmidt as ways of working through creative problems. When a blockage occurs, draw a card, and see if it can direct you in a tangential way that helps solve the p

Re: retrieve data using FTP in Python

2005-09-14 Thread Jaime Wyant
Try this from the interpreter: import ftplib help(ftplib) The module is pretty easy to use. If you'll be doing anything with `http', then visit urllib2: import urllib2 help(urllib2) I think urllib2 will take `ftp' urls: ftp://user:[EMAIL PROTECTED]/dir/file_to_get hth, jw On 9/13/05, swarna p

Re: Builtin classes list, set, dict reimplemented via B-trees

2005-09-14 Thread Szabolcs Nagy
IMO sorted dict implementation can be useful, eg. one can get an interval: L = D['A' : 'K'] other useful data types: linkedlist queue, stack (well deque can do it efficiently in py 2.4) prioritydict (for graph algorithms) multimap, multiset (i've never used it but it's in the c++ stl) mutable stri

Re: Tkinter add_cascade option_add

2005-09-14 Thread Bob Greschke
You can set the font for the labels on the menu bar, and you can set the font of the items in the drop down portion independently (except on Windows where you cannot control the font of the menu bar labels). I just don't know how to set the font for the menu bar labels using an option_add comm

Python on AIX 4.3.

2005-09-14 Thread David Gutierrez
Hello Everyone, I'm trying to install Python on an aix 4.3.3. but keep on getting a failed attempt with the following errors. ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_s

O'Reilly book on Twisted

2005-09-14 Thread Alessandro Bottoni
Most likely, you are already aware of this but, just in case... O'Reilly is going to publish a nook on Twisted: http://www.oreilly.com/catalog/twistedadn/ http://www.amazon.com/exec/obidos/tg/detail/-/0596100329/qid=1126714644/sr=1-1/ref=sr_1_1/102-3430080-1376942?v=glance&s=books CU --

Re: List of integers & L.I.S. (SPOILER)

2005-09-14 Thread n00m
Tim Peters wrote: > The chance that Raymond Hettinger is going to recode _your_ > functions in C is approximately 0 ;-) Who is Raymond Hettinger? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python on AIX 4.3.

2005-09-14 Thread Fredrik Lundh
David Gutierrez wrote: > I'm trying to install Python on an aix 4.3.3. but keep on getting a failed > attempt with the following errors. > > ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock ... > Has anyone seen this before. $ more README ... AIX:A complete overhaul of the shared lib

Re: Python on AIX 4.3.

2005-09-14 Thread Alessandro Bottoni
David Gutierrez wrote: > Hello Everyone, > I'm trying to install Python on an aix 4.3.3. but keep on getting a failed > attempt with the following errors. > > ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock > ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock > ld: 0711-317 ERR

Re: Python for ARM7?

2005-09-14 Thread Sybren Stuvel
Ken Seehart enlightened us with: > I could try to unpack them on another (non-ARM7) linux box and then > move the files over to the ARM7 device. Yep, that should work. > Better yet, can I unpack them on windows XP somehow? Don't know. > If for some reason that is not possible, i suppose my next

Re: Django Vs Rails

2005-09-14 Thread Ian Bicking
Diez B. Roggisch wrote: > - rails/subway reflect over a existing table. They create OR-mappings > based on that. You only specify exceptional attributes for these mappings. > > - django specifies the whole meta-model in python - and _generates_ > the SQL/DDL to populate the DB. So obviously you

Re: network parameters

2005-09-14 Thread Sybren Stuvel
le dahut enlightened us with: > Is there a way to get network parameters (number of network > interfaces, ip address(es), DNS, gateway) on a linux station using > python 2.3 ? Sure. - number of network interfaces, ip address(es), gateway: read from /proc - DNS: read /etc/resolv.conf Sybren -- T

Re: What XML lib to use?

2005-09-14 Thread Fredrik Lundh
Paul Boddie wrote: > For example, PyQt and PyKDE expose various DOMs of the purest > "non-Pythonic" kind; Mozilla exposes DOMs for XML and HTML I didn't see anything about manipulating an application's internal data structures in the original post, but I might have missed some- thing. For stand-

Re: Software bugs aren't inevitable

2005-09-14 Thread Rocco Moretti
Terry Reedy wrote: > But that, I admit, would be an invalid conclusion. And that, I claim, is > also invalid when 'iteration' and 'recursion' are reversed, no matter how > often repeated in texts and articles. The difference is between the > algorithms, not the differing syntactic expressions

Re: Python Search Engine app

2005-09-14 Thread Alan Meyer
"Harlin Seritt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > Is anyone aware of an available open-source/free search engine app > (something similar to HTDig) written in Python that is out there? > Googling has turned up nothing. Thought maybe I'd mine some of you > guys'

Re: improvements for the logging package

2005-09-14 Thread skip
>> It does, in the "in-development" version of the documentation. Sorry it >> was not in the 2.4 releases :-( Thomas> Maybe it can be backported to 2.4.2 - is there still time for that? Changed now in CVS. When 2.4.2 is released it should be there. Skip -- http://mail.python.org/ma

Re: Python Search Engine app

2005-09-14 Thread gene tani
Yes, there's a bunch. Google for "query parser" + python, "porter stemming" "stopwords" "text indexer". Maybe lucene has some python bindings, hmm? Harlin Seritt wrote: > Hi, > > Is anyone aware of an available open-source/free search engine app > (something similar to HTDig) written in Python t

Re: Python Search Engine app

2005-09-14 Thread Fredrik Lundh
Harlin Seritt wrote: > Is anyone aware of an available open-source/free search engine app > (something similar to HTDig) written in Python that is out there? > Googling has turned up nothing. Thought maybe I'd mine some of you > guys' minds on this. http://divmod.org/ has a couple of alternatives

h2py.py and char literals

2005-09-14 Thread lsmithso
Python 2.3.4 on RedHat Linux FC3. Tools/scripts/h2py.py doesn't translate C char literals. When I feed it a .h file with the single line: #define GOO 'L' It throws out: Skipping: GOO = ord() And doesn't generate any code. I'm sure this used to work. I fixed it by hacking h2py.py: diff -N

Re: round() wrong in Python 2.4?

2005-09-14 Thread Magnus Lycka
Nils Grimsmo wrote: > (Is this due to the different GCC used?) Yes, but there are probably other nasty values with the other CGG. Basically, what the code does, for a positive number, is to calculate floor(0.0225*1000.0+0.5)/1000.0. As others have said: Don't trust this. If you use Python 2.4, yo

  1   2   3   >