Research on collaborative navigation (zope prototype) z9

2006-02-11 Thread André
Hi all, My name is André. I'm working in a research prototype that tries to cluster web pages by tracking the interests of users (by recording the users' searches and accepted links) and relates that with an adaptive crawling mechanism. All system is implemented in zope, with python scripts.

SoCal Piggies meeting: Feb. 15th, 7PM @ USC

2006-02-11 Thread Grig Gheorghiu
If you're in the L.A. area, please join the SoCal Piggies for their monthly meeting at USC. Directions are available on the group's Wiki at http://www.socal-piggies.org/socalpiggies/USC_Salvatori_Computer_Science_Center,_room_222. Agenda: Grig Gheorghiu and Titus Brown will give a dry-run of a

Re: Jython inherit from Java class

2006-02-11 Thread Mark Fink
Please enlighten me. This seemed so easy yust inherit from a Java class overwrite one method - done. At the moment I do not know how to proceed :-(( Jython or jythonc? == In general is it better to run programms with the jython interpreter or is it better to compile them first? I

Re: Scientific Computing with NumPy

2006-02-11 Thread linda.s
On 2/10/06, David M. Cooke [EMAIL PROTECTED] wrote: linda.s [EMAIL PROTECTED] writes: where to download numpy for Python 2.3 in Mac? Thanks! Linda I don't know if anybody's specifically compiled for 2.3; I think most of the developers on mac are using 2.4 :-) But (assuming you have

Re: installing python on a server?

2006-02-11 Thread Peter Hansen
John Salerno wrote: Can anyone tell me how complicated it might be to install Python on my server so I can use it for web apps? Is it a one-time process, or something to maintain? I'm not sure what you would expect to maintain. Do you expect some kind of bit-rot to occur, requiring you to

Re: Yet another GUI toolkit question...

2006-02-11 Thread [EMAIL PROTECTED]
What's wrong with wxPython? (http://www.wxpython.org) Didn't see it mentioned here. David Berlin http://farpy.holev.com - Python GUI Editor -- http://mail.python.org/mailman/listinfo/python-list

Shortest prime number program

2006-02-11 Thread swisscheese
I figured someone out there must have written a minimal code size prime number generator. I did not find one after a bit of searching around. For primes up to 100 the best I could do was 70 characters (including spaces): r=range(2,99) m=[x*y for x in r for y in r] [x for x in r if not x in m] --

Is there any books such as 'effective python' or else about the performance?

2006-02-11 Thread Kenneth Xie
att, thx. -- http://mail.python.org/mailman/listinfo/python-list

Re: Legality of using Fonts

2006-02-11 Thread Steven D'Aprano
On Fri, 10 Feb 2006 20:24:34 -0800, Ross Ridge wrote: Steven D'Aprano wrote: It is highly unlikely that any judge will be fooled by a mere change in format (but Your Honour, I converted the TTF file into a bitmap). If that were true, almost the entire X11 bitmap font collection would be

Pyserial handobook

2006-02-11 Thread Zarathustra
Hi, where I can find the pyserial handbook?? THanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Scientific Computing with NumPy

2006-02-11 Thread Robert Kern
linda.s wrote: where to download numpy for Python 2.3 in Mac? I don't think anybody has a binary package compiled for you. However, if you have gcc installed, numpy should build out-of-box. $ tar zcf ~/downloads/numpy-0.9.4.tar.gz $ cd numpy-0.9.4 $ python setup.py build $ sudo python setup.py

Re: Too Many if Statements?

2006-02-11 Thread Terry Reedy
slogging_away [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] SystemError: com_backpatch: offset too large This message is generated in the backpatch function in Python/compile.c in the source tree. (See below: sorry, tab indents did not survive cut and paste operation.) As the

Re: Shortest prime number program

2006-02-11 Thread Mitja Trampus
swisscheese wrote: I figured someone out there must have written a minimal code size prime number generator. I did not find one after a bit of searching around. For primes up to 100 the best I could do was 70 characters (including spaces): r=range(2,99) m=[x*y for x in r for y in r] [x

Re: Inserting record with Microsoft Access

2006-02-11 Thread Frank Millman
Steve Holden wrote: Albert Leibbrandt wrote: jeffhg582003 wrote: Hi, I am developing a python script which add records to a microsoft access tables. All my tables have autogenerated number fields. I am trying to capture the number generated from the insert but I am not exactly

Re: Too Many if Statements?

2006-02-11 Thread Steve Holden
slogging_away wrote: Magnus Lycka wrote: What happens if you run it from the command line instead of IDLE? After all, it might be some problem in IDLE involved here. Even if it doesn't work correctly outside IDLE, I was thinking that IDLE might swallow some kind of error message.

How to check...

2006-02-11 Thread Lad
Hello, How can I check that a string does NOT contain NON English characters? Thanks L. -- http://mail.python.org/mailman/listinfo/python-list

Re: Shortest prime number program

2006-02-11 Thread swisscheese
At 58, very nice :-) Building on yours we get 57: r=range(2,99) [x for x in r if sum([x%d==0 for d in r])2] -- http://mail.python.org/mailman/listinfo/python-list

Re: Shortest prime number program

2006-02-11 Thread Ian Bygrave
On Sat, 11 Feb 2006 02:03:46 -0800, swisscheese wrote: I figured someone out there must have written a minimal code size prime number generator. I did not find one after a bit of searching around. For primes up to 100 the best I could do was 70 characters (including spaces): r=range(2,99)

Re: How to check...

2006-02-11 Thread augustus . kling
Hello, try using regular expressions. I'afraid that i don't have any documentation right here but i think there is a starting point for a web search now. Greetings -- http://mail.python.org/mailman/listinfo/python-list

Re: How to check...

2006-02-11 Thread augustus . kling
Additional info: You will documentation in the Python help utility by typing the module name 're' or 'sre' -- http://mail.python.org/mailman/listinfo/python-list

Re: two generators working in tandem

2006-02-11 Thread Michael Spencer
john peter wrote: I'd like to write two generators: one is a min to max sequence number generator that rolls over to min again once the max is reached. the other is a generator that cycles through N (say, 12) labels. currently, i'm using these generators in nested loops like this:

Re: Shortest prime number program

2006-02-11 Thread Martin v. Löwis
You can save two bytes with r=range(2,99) [x for x in r if sum(x%d==0 for d in r)2] -- http://mail.python.org/mailman/listinfo/python-list

Problem with smart pointers

2006-02-11 Thread swell
Hello, I use the Boost.Python lib for a couple of weeks now and i am facing a pb. To sum up i have a small hierarchy of objects and have a factory to build concrete object. The pb is i think aroud the auto_ptr object that is not correctly managed by my code ( i use version 1.33 ) I think that

Re: Jython inherit from Java class

2006-02-11 Thread Kent Johnson
Frank LaFond wrote: Jython 2.2 Alpha 1 supports Java 1.5 It is also buggy and IIRC has a broken jythonc which is what the OP is trying to use. Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: Shortest prime number program

2006-02-11 Thread swisscheese
You can save two bytes with 56 - nice catch. 55: r=range(2,99) [x for x in r if sum(x%d1 for d in r)2] -- http://mail.python.org/mailman/listinfo/python-list

Re: Shortest prime number program

2006-02-11 Thread [EMAIL PROTECTED]
swisscheese wrote: I figured someone out there must have written a minimal code size prime number generator. I did not find one after a bit of searching around. For primes up to 100 the best I could do was 70 characters (including spaces): r=range(2,99) m=[x*y for x in r for y in r] [x

Re: Jython inherit from Java class

2006-02-11 Thread Kent Johnson
Mark Fink wrote: Please enlighten me. This seemed so easy yust inherit from a Java class overwrite one method - done. At the moment I do not know how to proceed :-(( It should be easy. Jython or jythonc? == In general is it better to run programms with the jython

Re: Yet another GUI toolkit question...

2006-02-11 Thread Chris Mellon
On 2/10/06, Kevin Walzer [EMAIL PROTECTED] wrote: ...with a twist. I'm undertaking my first semi-substantial Python GUI application after a long time dabbling with the language. I'm fairly experienced with Tcl/Tk, so Tkinter seems the obvious choice to reduce my Python learning curve.

Re: Jython inherit from Java class

2006-02-11 Thread Kent Johnson
Mark Fink wrote: Alan, Kent, many thanks this really helped! But there is still a problem I guess with inheritance. I use the java testsuit supplied with the original to test the server. If I use the Java FitServer the testsuite can be completed. I commented everything out from my class and

Re: Shortest prime number program

2006-02-11 Thread Ian Bygrave
On Sat, 11 Feb 2006 12:43:23 +, Ian Bygrave wrote: p,r=[],range(2,99) while r:p,r=p+r[:1],[x for x in r if x%r[0]] And the result's in p. Well, given a hypothetical new function 'sieve' def sieve(f,l): if not l: return l head,tail=l[0],l[1:] def filter_func(x):

Re: Yet another GUI toolkit question...

2006-02-11 Thread Florian Nykrin
Hi Kevin! I have no experience with Tkinter, but I did some small GUIs with wxPython and PyGTK. wxPython works very well on Windows, but on Linux (Ubuntu/Debian in my case) it is very difficult to work with and buggy. PyGTK-Applications on the other hand maybe do not look totally like

Re: Shortest prime number program

2006-02-11 Thread Ian Bygrave
On Sat, 11 Feb 2006 13:33:58 +, Ian Bygrave wrote: Well, given a hypothetical new function 'sieve' which should have been: def sieve(f,l): if not l: return l head,tail=l[0],l[1:] def filter_func(x): return f(x,head) tail=filter(filter_func,tail) return

Re: is there a better way?

2006-02-11 Thread Charles Krug
On 2006-02-11, Alex Martelli [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Problem: You have a list of unknown length, such as this: list = [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know the X's are all up front and you know that the item after

Re: Is there any books such as 'effective python' or else about the performance?

2006-02-11 Thread Charles Krug
On 2006-02-11, Kenneth Xie [EMAIL PROTECTED] wrote: att, thx. A lot of the ideas discussed in Effective C++ et al are things that Python does for us already. C++ works at a much lower layer of abstraction and you need to deal explicitly with freestore for any nontrivial class. EC++ is mostly

Netstat in python. Does it's possible?

2006-02-11 Thread billie
Hi all. I don't know if Python is good for this kind of jobs but I'm wondering if it's possible emulate the netstat command in Python. I'd need to know if a certain executable opened a socket and, in that case, I'd like to know what kind of socket it uses (TCP or UDP), its src/dst PORT, and the

Re: PyGTK

2006-02-11 Thread Dieter Verfaillie
On Thu, 09 Feb 2006 12:38:26 +, Dave Cook wrote: particularly the last section on how to create an EXE from your pygtk program. That recipe isn't optimal with newer gtk versions (starting from 2.8 if I remember correctly). Look here instead:

Re: Yet another GUI toolkit question...

2006-02-11 Thread Grant Edwards
On 2006-02-11, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: What's wrong with wxPython? (http://www.wxpython.org) Nothing. A lot of us use it. Didn't see it mentioned here. I'm sorry, I didn't realize we were supposed to. You might want to check the wxpython mailing list if you want to see

Re: Yet another GUI toolkit question...

2006-02-11 Thread Grant Edwards
On 2006-02-11, Florian Nykrin [EMAIL PROTECTED] wrote: wxPython works very well on Windows, but on Linux (Ubuntu/Debian in my case) it is very difficult to work with and buggy. That's odd. I've been using wxPython for many years on both Windows and on many distributions and haven't found a

Re: Shortest prime number program

2006-02-11 Thread Grant Edwards
On 2006-02-11, swisscheese [EMAIL PROTECTED] wrote: You can save two bytes with 56 - nice catch. 55: r=range(2,99) [x for x in r if sum(x%d1 for d in r)2] And if this were FORTRAN: r=range(2,99) [xforxinrifsum(x%d1fordinr)2] ;) -- Grant Edwards grante Yow!

Re: Pyserial handobook

2006-02-11 Thread Grant Edwards
On 2006-02-11, Zarathustra [EMAIL PROTECTED] wrote: Hi, where I can find the pyserial handbook?? I don't think there is anything called the pyserial handbook. The documentation for pyserial is at http://pyserial.sourceforge.net/ It's the first hit when you google pyserial. Shocker, eh? --

encoding problems with pymssql / win

2006-02-11 Thread morris carre
I have a strange problem : some code that fetches queries from an mssql database works fine under Idle but the very same code run from a shell window obtains its strings garbled as if the encoding codepage was modified. This occurs only when using pymssql to connect; if I connect through odbc

Re: encoding problems with pymssql / win

2006-02-11 Thread morris carre
(to email use boris at batiment71 dot ch) oops, that's boris at batiment71 dot net -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a better way?

2006-02-11 Thread Steve Holden
[EMAIL PROTECTED] wrote: Problem: You have a list of unknown length, such as this: list = [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know the X's are all up front and you know that the item after the last X is an O, or that the list ends with an X. There are never O's

Re: Yet another GUI toolkit question...

2006-02-11 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: What's wrong with wxPython? (http://www.wxpython.org) Didn't see it mentioned here. David Berlin http://farpy.holev.com - Python GUI Editor I did mention it...see scaling the wxPython mountain. -- Kevin Walzer iReveal: File Search Tool

Re: is there a better way?

2006-02-11 Thread Carl Friedrich Bolz
Alex Martelli wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Problem: You have a list of unknown length, such as this: list = [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know the X's are all up front and you know that the item after the last X is an O, or that the

Re: Yet another GUI toolkit question...

2006-02-11 Thread Kevin Walzer
Florian Nykrin wrote: Hi Kevin! I have no experience with Tkinter, but I did some small GUIs with wxPython and PyGTK. wxPython works very well on Windows, but on Linux (Ubuntu/Debian in my case) it is very difficult to work with and buggy. PyGTK-Applications on the other hand maybe do

Re: Netstat in python. Does it's possible?

2006-02-11 Thread Sybren Stuvel
billie enlightened us with: Hi all. I don't know if Python is good for this kind of jobs but I'm wondering if it's possible emulate the netstat command in Python. On Linux, you can read /proc for that info, iirc. Sybren -- The problem with the world is stupidity. Not saying there should be a

Re: Martin Franklin's Tkinter/Tile wrapper--where'd it go?

2006-02-11 Thread Kevin Walzer
Kevin Walzer wrote: I believe Martin Franklin wrote a Tile.py wrapper for the Tk/Tile extension, which adds theming to the core Tk widget set. It used to reside here: http://mfranklin.is-a-geek.org/docs/Tile/index.html That server seems to be down. Anyone know if the wrapper is available

Re: is there a better way?

2006-02-11 Thread Carl Friedrich Bolz
Hi! [EMAIL PROTECTED] wrote: Problem: You have a list of unknown length, such as this: list = [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know the X's are all up front and you know that the item after the last X is an O, or that the list ends with an X. There are

Re: appending to a list via properties

2006-02-11 Thread Carl Banks
Lonnie Princehouse wrote: Here's a curious hack I want to put up for discussion. I'm thinking of writing a PEP for it. A minor library change wouldn' t need a PEP. Observation - I found myself using this construct for assembling multiple lists: foo = [] qux = []

Re: Yet another GUI toolkit question...

2006-02-11 Thread Peter Decker
On 2/10/06, Kevin Walzer [EMAIL PROTECTED] wrote: I'm undertaking my first semi-substantial Python GUI application after a long time dabbling with the language. ... So: my question is, would it be more productive for me to wrestle with these extensions when there doesn't seem to be much

Re: Yet another GUI toolkit question...

2006-02-11 Thread Lawrence Oluyede
Kevin Walzer [EMAIL PROTECTED] writes: Unfortunately, PyGTK does not run natively on the Mac (it's X11 only). There's some work in progress: http://developer.imendio.com/wiki/Gtk_Mac_OS_X -- Lawrence - http://www.oluyede.org/blog Anyone can freely use whatever he wants but the light at the

Re: How to invoke a tkinter menu *itself*

2006-02-11 Thread Edward K. Ream
I've spent a pleasant hour or so trying to bring up a top-level Tk menu at the same spot as it would appear if I had actually clicked the menu. That is, I want to bring up a menu from the keyboard. I'm going to investigate how to locate the 'button' that forms the anchor for the menu.

Re: Netstat in python. Does it's possible?

2006-02-11 Thread Martin v. Löwis
billie wrote: Hi all. I don't know if Python is good for this kind of jobs but I'm wondering if it's possible emulate the netstat command in Python. As a general recommendation, use strace(1) to answer this kind of question. Run strace -o tmp netstat, then inspect tmp to find out how netstat

Re: Legality of using Fonts

2006-02-11 Thread Ross Ridge
Steven D'Aprano wrote: In any case, even in the USA, hinted fonts are copyrightable, and merely removing the hints (say, by converting to a bitmap) is no more legal than whiting out the author's name from a book and claiming it as your own. That's an absurd comparison. By making a bitmap font

Re: Shortest prime number program

2006-02-11 Thread dickinsm
swisscheese wrote: r=range(2,99) m=[x*y for x in r for y in r] [x for x in r if not x in m] How about: [2]+[x for x in range(1,99) if 2**x%x==2] Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] functional 0.5 released

2006-02-11 Thread Neal Becker
I just installed from .tar.gz on fedora FC5 x86_64. I ran into 1 small problem: sudo python setup.py install --verbose running install running bdist_egg running egg_info writing functional.egg-info/PKG-INFO writing top-level names to functional.egg-info/top_level.txt reading manifest file

Re: How to check...

2006-02-11 Thread Daniel Marcel Eichler
Lad wrote: How can I check that a string does NOT contain NON English characters? try: foobar.encode('ascii') except: bla or use string.ascii_letters and enhance it. mfg Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet another GUI toolkit question...

2006-02-11 Thread Robert Hicks
Wow you are so wrong about Tk on OSX. Soon this is just not going to be the case at all for any of the system Tcl/Tk runs on. The Tcl folks have come out with a package called Tile that is going to be rolled in. It gives you native LF on OSX, Windows, Linux. Robert --

Re: How to check...

2006-02-11 Thread John Zenger
This should be just a matter of determining how your string is encoded (ASCII, UTF, Unicode, etc.) and checking the ord of each character to see if it is in the contiguous range of English characters for that encoding. For example, if you know that the string is ASCII or UTF-8, you could

Re: is there a better way?

2006-02-11 Thread Alex Martelli
Charles Krug [EMAIL PROTECTED] wrote: On 2006-02-11, Alex Martelli [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Problem: You have a list of unknown length, such as this: list = [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know the X's are

Re: Shortest prime number program

2006-02-11 Thread Christoph Zwerschke
[EMAIL PROTECTED] schrieb: How about: [2]+[x for x in range(1,99) if 2**x%x==2] If the range goes beyond 340, it also gives non-primes... -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet another GUI toolkit question...

2006-02-11 Thread Steve Holden
Robert Hicks wrote: Wow you are so wrong about Tk on OSX. Soon this is just not going to be the case at all for any of the system Tcl/Tk runs on. The Tcl folks have come out with a package called Tile that is going to be rolled in. It gives you native LF on OSX, Windows, Linux. This is good

Re: Shortest prime number program

2006-02-11 Thread Jeffrey Schwab
[EMAIL PROTECTED] wrote: swisscheese wrote: r=range(2,99) m=[x*y for x in r for y in r] [x for x in r if not x in m] How about: [2]+[x for x in range(1,99) if 2**x%x==2] 43. I'll be chewing on this one for a while. Thank you. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Shortest prime number program

2006-02-11 Thread swisscheese
[2]+[x for x in range(1,99) if 2**x%x==2] 42 - brilliant! 41: [2]+[x for x in range(1,99)if 2**x%x==2] ... although it appears Christoph is right that it's not scalable. -- http://mail.python.org/mailman/listinfo/python-list

Re: Shortest prime number program

2006-02-11 Thread bearophileHUGS
This is a little shorter :-) [2]+[x for x in range(2,99)if 2**x%x==2] Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet another GUI toolkit question...

2006-02-11 Thread Kevin Walzer
Chris Mellon wrote: If you're planning on selling an application, especially to OS X users, then Tk is absolutely out of the question. It doesn't have even the slightest resemblence to native behavior, and lacks the polish and flash that occasionally lets a non-native app get away with it.

Re: Yet another GUI toolkit question...

2006-02-11 Thread Kevin Walzer
Steve Holden wrote: Robert Hicks wrote: Wow you are so wrong about Tk on OSX. Soon this is just not going to be the case at all for any of the system Tcl/Tk runs on. The Tcl folks have come out with a package called Tile that is going to be rolled in. It gives you native LF on OSX, Windows,

Re: Shortest prime number program

2006-02-11 Thread swisscheese
42 Make that 41 and 40. -- http://mail.python.org/mailman/listinfo/python-list

Re: appending to a list via properties

2006-02-11 Thread Alex Martelli
Carl Banks [EMAIL PROTECTED] wrote: ... class better_list (list): tail = property(None, list.append) This is an impressive, spiffy little class. Yes, nice use of property. growing_lists = foo,qux while some_condition: for (s,x) in

Jython socket typecasting problems

2006-02-11 Thread Mark Fink
I try to port a server application to Jython. At the moment I use Jython21\Lib\socket.py Currently I do face problems with casting the string localhost to the desired value: D:\AUT_TEST\workspace\JyFITjython fit/JyFitServer2.py localhost 1234 23 ['fit/JyFitServer2.py', 'localhost', '1234', '23']

Re: Yet another GUI toolkit question...

2006-02-11 Thread Kevin Walzer
Peter Decker wrote: On 2/10/06, Kevin Walzer [EMAIL PROTECTED] wrote: I'm undertaking my first semi-substantial Python GUI application after a long time dabbling with the language. ... So: my question is, would it be more productive for me to wrestle with these extensions when there

Re: appending to a list via properties

2006-02-11 Thread Carl Banks
Alex Martelli wrote: Carl Banks [EMAIL PROTECTED] wrote: ... class better_list (list): tail = property(None, list.append) This is an impressive, spiffy little class. Yes, nice use of property. growing_lists = foo,qux while some_condition: for (s,x) in

Re: any way to customize the is operator?

2006-02-11 Thread Aahz
In article [EMAIL PROTECTED], Lonnie Princehouse [EMAIL PROTECTED] wrote: Why did you want to customize is? Well, mostly out of principle ;-) But also because I'm wrapping a C library which passes around C structs which are wrapped in shim C++ classes for a Boost.Python layer. Boost Python

Re: Jython socket typecasting problems

2006-02-11 Thread Diez B. Roggisch
This is the code section of my server class (I cut this from a Python example): def establishConnection(self): self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.connect((self.host, self.port)) Do I have to use explicit typecasting? How can this

Re: by reference

2006-02-11 Thread dirvine
Many thanks I will do so in the future. David -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet another GUI toolkit question...

2006-02-11 Thread Peter Decker
On 2/11/06, Kevin Walzer [EMAIL PROTECTED] wrote: Dabo looks interesting, but isn't it mainly for database applications? Has any other kind of application been developed with it? Also, it seems very Windows/Linux-centric. Is anyone using it on OS X? The Dabo demo comes with several games

Re: Yet another GUI toolkit question...

2006-02-11 Thread Peter Decker
On 2/11/06, Kevin Walzer [EMAIL PROTECTED] wrote: Also, it seems very Windows/Linux-centric. Is anyone using it on OS X? I almost forgot: take a look at this screencast: http://leafe.com/screencasts/sizers2.html It's the second part of a demonstration on using sizers in the Dabo visual

Re: PySizeof: almost useful

2006-02-11 Thread Alex Martelli
Ian Leitch [EMAIL PROTECTED] wrote: ... 2. I'm at a loss as how to calculate the size of a long object -- any tips? #include longintrepr.h (from the Python sources). Then, given a PyLongObject *l, abs(l-ob_size) is the number of digits, each taking SHIFT bits. Many thanks to anyone bored

Re: Yet another GUI toolkit question...

2006-02-11 Thread Chris Mellon
On 2/11/06, Kevin Walzer [EMAIL PROTECTED] wrote: Chris Mellon wrote: If you're planning on selling an application, especially to OS X users, then Tk is absolutely out of the question. It doesn't have even the slightest resemblence to native behavior, and lacks the polish and flash

Re: ordered sets operations on lists..

2006-02-11 Thread Alex Martelli
Raymond Hettinger [EMAIL PROTECTED] wrote: ... The intersection step is unnecessary, so the answer can be simplified a bit: filter(set(l2).__contains__, l1) [5, 3] filter(set(l1).__contains__, l2) [3, 5] ...and if one has time to waste, setification being only an optimization, it can

Re: only a simple xml reader tag:idvalue/tag:id

2006-02-11 Thread uche . ogbuji
[EMAIL PROTECTED] wrote: The only thing I must read is the response I get from a EPP server. A response like this: ?xml version=1.0 encoding=UTF-8? epp xmlns= http://www.eurid.eu/xml/epp/epp-1.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

Re: Legality of using Fonts

2006-02-11 Thread Chris Mellon
On 2/11/06, Steven D'Aprano [EMAIL PROTECTED] wrote: On Fri, 10 Feb 2006 20:24:34 -0800, Ross Ridge wrote: Steven D'Aprano wrote: It is highly unlikely that any judge will be fooled by a mere change in format (but Your Honour, I converted the TTF file into a bitmap). If that were true,

Re: Determining an operating system's default browser

2006-02-11 Thread Jorgen Grahn
On 10 Feb 2006 03:51:01 -0800, Paul Boddie [EMAIL PROTECTED] wrote: John McMonagle wrote: On Thu, 2006-02-09 at 17:53 -0600, Larry Bates wrote: You don't have to determine it. Just os.startfile('page1.html') and let the OS figure it out. Works great for Windows - not available on Unix

Re: Rethinking the Python tutorial

2006-02-11 Thread AdSR
I think you guys are up to something. We need some way to aggregate, update, and extend not just tutorials but all kinds of informatory material on Python. The Python Wiki is a good place for all that, although it hasn't become anything resembling a Wikipedia so far. AdSR --

python 2.5 and hashlib

2006-02-11 Thread rtilley
Is there a road map for python a 2.5 releases yet? I'd like to begin testing the new hashlib module with some old scripts I have that currently use the md5 and sha modules. Thanks, Brad -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining an operating system's default browser

2006-02-11 Thread Paul Boddie
Jorgen Grahn wrote: [desktop module] Note that those do not, of course, work on all Unices. Correct: they work only for the stated desktop environments. On my machines, there is One Correct Way of doing these things, and that's to look in the MIME support/configuration files (~/.mailcap,

simple math question

2006-02-11 Thread John Salerno
Hi all. I'm just starting out with Python, so I'm a little slow right now. :) Can someone explain to me why the expression 5 / -2 evaluates to -3, especially considering that -2 * -3 evaluates to 6? I'm sure it has something to do with the negative number and the current way that the /

Re: installing python on a server?

2006-02-11 Thread John Salerno
Dennis Lee Bieber wrote: On Sat, 11 Feb 2006 01:02:46 -0500, John Salerno [EMAIL PROTECTED] declaimed the following in comp.lang.python: Yikes, that's all the stuff I don't know. Maybe this is over my head right now. Let's start with something simple then... Do you have admin

Re: Is there any books such as 'effective python' or else about the performance?

2006-02-11 Thread Jorgen Grahn
On Sat, 11 Feb 2006 07:54:46 -0600, Charles Krug [EMAIL PROTECTED] wrote: On 2006-02-11, Kenneth Xie [EMAIL PROTECTED] wrote: att, thx. A lot of the ideas discussed in Effective C++ et al are things that Python does for us already. C++ works at a much lower layer of abstraction Yes. and

Clearing the screen

2006-02-11 Thread mwt
I'm doing some python programming for a linux terminal (just learning). When I want to completely redraw the screen, I've been using os.system(clear) This command works when using python in terminal mode, and in IDLE. However, when running a little .py file containing that command, the screen

Re: Netstat in python. Does it's possible?

2006-02-11 Thread Jorgen Grahn
On Sat, 11 Feb 2006 16:28:06 +0100, Martin v. Löwis [EMAIL PROTECTED] wrote: billie wrote: Hi all. I don't know if Python is good for this kind of jobs but I'm wondering if it's possible emulate the netstat command in Python. As a general recommendation, use strace(1) to answer this kind of

Re: Clearing the screen

2006-02-11 Thread Felipe Almeida Lessa
Em Sáb, 2006-02-11 às 12:04 -0800, mwt escreveu: I'm doing some python programming for a linux terminal (just learning). When I want to completely redraw the screen, I've been using os.system(clear) This command works when using python in terminal mode, and in IDLE. However, when running a

Re: simple math question

2006-02-11 Thread Felipe Almeida Lessa
Em Sáb, 2006-02-11 às 14:52 -0500, John Salerno escreveu: Hi all. I'm just starting out with Python, so I'm a little slow right now. :) Can someone explain to me why the expression 5 / -2 evaluates to -3, especially considering that -2 * -3 evaluates to 6? I'm sure it has something to

Re: python 2.5 and hashlib

2006-02-11 Thread Alex Martelli
rtilley [EMAIL PROTECTED] wrote: Is there a road map for python a 2.5 releases yet? I'd like to begin testing the new hashlib module with some old scripts I have that currently use the md5 and sha modules. http://python.org/peps/pep-0356.html -- but it's still a draft, being discussed in

Re: simple math question

2006-02-11 Thread James Stroud
John Salerno wrote: Hi all. I'm just starting out with Python, so I'm a little slow right now. :) Can someone explain to me why the expression 5 / -2 evaluates to -3, especially considering that -2 * -3 evaluates to 6? I'm sure it has something to do with the negative number and the

Re: simple math question

2006-02-11 Thread Rinzwind
'/' is a floor division (1/2 == 0) unless validated by a from __future__ import division. So: 5/2=2.5 - nearest lowest non-decimal number makes it 2. 5/-2=-2.5 - nearest lowest non-decilmal number makes it -3 -- http://mail.python.org/mailman/listinfo/python-list

Re: simple math question

2006-02-11 Thread Paul Rubin
John Salerno [EMAIL PROTECTED] writes: Can someone explain to me why the expression 5 / -2 evaluates to -3, especially considering that -2 * -3 evaluates to 6? I'm sure it has something to do with the negative number and the current way that the / operator is implemented, but why doesn't it

Re: Too Many if Statements?

2006-02-11 Thread Terry Reedy
Steve Holden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Clearly it would be a good idea to remove whatever problem is causing the error, The problem (see my post of the com_backpatch code) is writing a compound statement (here a for loop) with a body so large as to require a

Re: python 2.5 and hashlib

2006-02-11 Thread rtilley
Alex Martelli wrote: http://python.org/peps/pep-0356.html -- but it's still a draft, being discussed in the last few days on python-dev. Thank you, that's exactly what I was looking for! -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >