Re: newbie: dictionary - howto get key value

2005-03-14 Thread Peter Otten
Joal Heagney wrote: > Does python guarantee that the lists given by phone.values() and > phone.keys() are in mutual order? Or is it possible that python will > return the lists in different orders for .values() and .keys()? Yes. Quoted from http://docs.python.org/lib/typesmapping.html: Keys and

Re: Generating data types automatically

2005-03-14 Thread Thomas Heller
Torsten Bronger <[EMAIL PROTECTED]> writes: > Hallöchen! > > I have to generate a lot of data types (for ctypes by the way). An > example is > > ViUInt32 = u_long > ViPUInt32 = POINTER(ViUInt32) > ViAUInt32 = ViPUInt32 > > Therefore, I defined functions that should make my life easier: > > def g

Re: Web framework

2005-03-14 Thread Joe
On Sun, 13 Mar 2005 19:20:34 +0100, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >Plain wrong. You can access them via FTP and WEBDAV. Not wrong. I am aware of this, but it's not like that many development tools can work through FTP or WebDav... Besides, how to have the source code under source c

Re: Itertools wishlists

2005-03-14 Thread Ville Vainio
> "Raymond" == Raymond Hettinger <[EMAIL PROTECTED]> writes: Raymond> Each one of the options listed is a reason that flatten() Raymond> shouldn't be an itertool. It fails tests of obviousness, Raymond> learnability, complexity of implementation, and Raymond> simplicity of API

Re: Regular Expressions: large amount of or's

2005-03-14 Thread Daniel Yoo
Daniel Yoo <[EMAIL PROTECTED]> wrote: : John Machin <[EMAIL PROTECTED]> wrote: : : tree.search("I went to alpha beta the other day to pick up some spam") : : could use a startpos (default=0) argument for efficiently restarting : : the search after finding the first match : Ok, that's easy to fi

Re: Add Properties to Instances?

2005-03-14 Thread Martin Miller
In answer to my question about instance properties not working, Bengt Richter suggest using: > > >>> class InstProp(object): > > ... def __getattribute__(self, attr): > > ... p = object.__getattribute__(self, attr) > > ... if isinstance(p, property): return p.__get__(self) > > .

{SPAM} Remote debugging with boa constructor

2005-03-14 Thread Gijs Korremans
Hi, I'm a newby on the Python language but I have to modify an excisting pyhon application which runs as a Windows NT service (on 2003 server). I've heared that it's possible to debug an application with boa constructor over the internet, I tried some things what I found on the internet but it

Re: [Python-Dev] RELEASED Python 2.4.1, release candidate 1

2005-03-14 Thread Richie Hindle
[Martin] > However, I just noticed that the python24.dll is in c:\python24. Could > it be that you have another one in \windows\system32? I do, yes. > If so, could it > also be that the installer has told you that the target directory > exists, and asked whether you want to proceed anyway? It

Re: injecting "set" into 2.3's builtins?

2005-03-14 Thread Pete Forman
Skip Montanaro <[EMAIL PROTECTED]> writes: > Stephen> I have: > Stephen> try: > Stephen> set > Stephen> except NameError: > Stephen> from sets import Set as set > > Stephen> in my code in a few places. > > Yes, but then pychecker complains about a statement w

Re: Add Properties to Instances?

2005-03-14 Thread Bengt Richter
On 14 Mar 2005 01:19:23 -0800, "Martin Miller" <[EMAIL PROTECTED]> wrote: >In answer to my question about instance properties not working, Bengt >Richter suggest using: >> > >>> class InstProp(object): >> > ... def __getattribute__(self, attr): >> > ... p = object.__getattribute__(self

Re: Web framework

2005-03-14 Thread Josef Meile
Hi Joe, Not wrong. I am aware of this, but it's not like that many development tools can work through FTP or WebDav... Besides, how to have the source code under source control if it's stuck in the ZODB? I guess you are reffering to "Python Scripts" and "ZClasses", which indeed are stuck in the ZOD

Re: Passing values to another script using CGI

2005-03-14 Thread Fuzzyman
Hello Mike, Mike Wimpe wrote: > Without creating a form, how do i pass a value to another script? > > I would like to pass: > > group = "Oranges" > > to another script or at least just 'group' and initialize it in the > first script. > Do you want to pass it *from* a CGI script or *two* a CGI scr

Re: Working on a log in script to my webpage

2005-03-14 Thread Fuzzyman
Pete. wrote: > Hi all. > > Unfortunaly it looks like I dont have to skill to make a secure log in, cant > figure out how the code has to look like, so guess my webpage has to live > with a security issue. > > Thanks for the effort you put into teaching me the use of cookies. > I've written a

Re: Web framework

2005-03-14 Thread Diez B. Roggisch
> Not wrong. I am aware of this, but it's not like that many development > tools can work through FTP or WebDav .. If your tools can't, then you can still use ftp clients to push the files to the server. Actually lots of web-development is done by working locally on the files, then publishing th

Listbox fill=BOTH expand=YES (Tkinter)

2005-03-14 Thread Harlin Seritt
I am trying the following: Listbox(parent).pack(fill=BOTH, expand=YES) I notice that the listbox will fill on the X axis but will not on the Y axis unlike other widgets. Is there any way to force this? thanks, Harlin -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating data types automatically

2005-03-14 Thread Torsten Bronger
HallÃchen! Thomas Heller <[EMAIL PROTECTED]> writes: > Torsten Bronger <[EMAIL PROTECTED]> writes: > >> I have to generate a lot of data types (for ctypes by the way). >> An example is >> >> ViUInt32 = u_long >> ViPUInt32 = POINTER(ViUInt32) >> ViAUInt32 = ViPUInt32 >> >> [...] > > Others have a

Re: Listbox fill=BOTH expand=YES (Tkinter)

2005-03-14 Thread Martin Franklin
Harlin Seritt wrote: I am trying the following: Listbox(parent).pack(fill=BOTH, expand=YES) I notice that the listbox will fill on the X axis but will not on the Y axis unlike other widgets. Is there any way to force this? thanks, Harlin Harlin, It should expand (and fill ) in both directions have

Re: Python-list Digest, Vol 18, Issue 208

2005-03-14 Thread John Roth
"Charles Hartman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I know this isnt that big of a problem, but i cannot think of one reason why they would not allow numbers preceded with a 0 to have a number higher then a 7 in them... And it seems very inconsistant to me... Is there a

Re: Wishlist item: itertools.flatten

2005-03-14 Thread Leif K-Brooks
Michael Spencer wrote: if hasattr(item,"__iter__"): # Avoids iterating over strings That's probably the cleanest way to avoid strings, but it's unfortunately not a good idea IMHO. Many objects (IndexedCatalog's Result objects are what I'm concerned about, but there are undoubtedly ot

Re: Who Knows of a Good Computational Physics Textbook?

2005-03-14 Thread beliavsky
Sean Richards wrote: > This may be of interest > > http://farside.ph.utexas.edu/teaching/329/lectures/lectures.html The information at http://farside.ph.utexas.edu/teaching/329/lectures/node7.html about scientific programming languages is out of date, since g95 http://www.g95.org is a free Fortran

will it cause any problems to open a read-only file & not close it?

2005-03-14 Thread Sara Khalatbari
Dear friends In a code, I'm opening a file to read. Like : lines = open(filename).readlines() & I'm never closing it. I'm not writing in that file, I just read it. Will it cause any problems if you open a file to read & never close it? __ Do

Encodings and printing unicode

2005-03-14 Thread Fuzzyman
How does the print statement decode unicode strings itis passed ? (By that I mean which encoding does it use). Under windows it doesn't appear to use defaultencoding. On my system the default encoding is ascii, yet the terminal encoding is latin1 (or cp1252 or whatever, but not ascii). This means

Re: will it cause any problems to open a read-only file & not close it?

2005-03-14 Thread John Machin
Sara Khalatbari wrote: > Dear friends > In a code, I'm opening a file to read. Like : > lines = open(filename).readlines() > & I'm never closing it. > I'm not writing in that file, I just read it. > > Will it cause any problems if you open a file to read > & never close it? AFAIK, only if you

optparse alternative

2005-03-14 Thread Henry Ludemann
I've been writing an optparse alternative (using getopt) that is at a stage where I'd be interested in people's opinions. It allows you to easily creating command line interfaces to existing functions, using flags (which are optional) and arguments. It will automatically print a nicely formatted us

Re: urllib's functionality with urllib2

2005-03-14 Thread Fuzzyman
Monty wrote: > Hello, > Sorry for this maybe stupid newbie question but I didn't find any > answer in all my readings about python: > > With urllib, using urlretrieve, it's possible to get the number of > blocks transferred and the total size of the file. > > Is it possible to get those informatio

Re: Licensing Python code under the Python license

2005-03-14 Thread Daniel Dittmar
Leif K-Brooks wrote: Harlin Seritt wrote: If this is for making money, make it either a proprietary license or BSD. If you're giving it away and expect nothing for it except maybe fame, do GPL. You're kidding, right? How does the BSD license possibly offer more protection for a commercial program

urllib (and urllib2) read all data from page on open()?

2005-03-14 Thread Alex Stapleton
The entire page is downloaded immediately whether you want it to or not when you do an http request using urllib. This seems slightly broken to me. Is there anyway to turn this behaviour off and have the objects read method actually read data from the socket when you ask it to? -- http://mail.py

Re: Licensing Python code under the Python license

2005-03-14 Thread Leif K-Brooks
Harlin Seritt wrote: If this is for making money, make it either a proprietary license or BSD. If you're giving it away and expect nothing for it except maybe fame, do GPL. You're kidding, right? How does the BSD license possibly offer more protection for a commercial program than the GPL does? --

Re: will it cause any problems to open a read-only file & not close it?

2005-03-14 Thread Fuzzyman
Sara Khalatbari wrote: > Dear friends > In a code, I'm opening a file to read. Like : > lines = open(filename).readlines() > & I'm never closing it. > I'm not writing in that file, I just read it. > > Will it cause any problems if you open a file to read > & never close it? > > Under CPython

Re: Apparently, I don't understand threading

2005-03-14 Thread Jeff Epler
Ah -- I'm sorry I was off-target, and I'm glad someone else had what may be better advice for you. Jeff pgptOZnkOhiE1.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

How do I pass structures using a C extension?

2005-03-14 Thread [EMAIL PROTECTED]
Hi. I trying to write an extension module to call some C libraries so I can use them in Python. Several of the library functions pass pointers to structures as arguments. I was thinking that I could create a class for each structure, but I'm not sure how to get the data back and forth. The example

{SPAM} start a python application as a win NT service

2005-03-14 Thread Gijs Korremans
Hi, I'm using windows 2003 small business server and I want to install my python programm as a NT (it's just an old name) service. Does anybody know how to do this? Kind regards, Gijs Korremans R&D Department Global Supply Chain Services (pty) Ltd. P.O. Box 1263 Rivonia 2128 South Africa T

Re: How do I pass structures using a C extension?

2005-03-14 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi. > > I trying to write an extension module to call some C libraries so I can > use them in Python. Several of the library functions pass pointers to > structures as arguments. I was thinking that I could create a class for > each structure, but I'm not sure how to ge

Re: How do I pass structures using a C extension?

2005-03-14 Thread Jaime Wyant
You need to check out swig. It is the *only* way to setup a `c' library for use with python. http://www.swig.org/ jw On 14 Mar 2005 05:25:03 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi. > > I trying to write an extension module to call some C libraries so I can > use them in Pyth

Re: error sending path to Win OS

2005-03-14 Thread Earl Eiland
A couple of you commented that I should be using os.path.join. Accordingly, I rewrote my code. Unfortunately, I still have the same problem. the following code snippet Results.SetOriginal(os.path.getsize(os.path.join(InputDirectory , x))) y = str(x.split('.')[0]) + '.rk' print InputDirectory, y

Re: error sending path to Win OS

2005-03-14 Thread Earl Eiland
A couple of you commented that I should be using os.path.join. Accordingly, I rewrote my code. Unfortunately, I still have the same problem. the following code snippet Results.SetOriginal(os.path.getsize(os.path.join(InputDirectory , x))) y = str(x.split('.')[0]) + '.rk' print InputDirectory, y

Re: will it cause any problems to open a read-only file & not close it?

2005-03-14 Thread Daniel Dittmar
Fuzzyman wrote: Sara Khalatbari wrote: Will it cause any problems if you open a file to read & never close it? Under CPython the filehandle will be automatically garbage collected. Under JPython (Jython) it won't be... Isn't it rather that CPython will close the file as soon as the last reference

Re: urllib (and urllib2) read all data from page on open()?

2005-03-14 Thread Fuzzyman
Certianly under urllib2 - handle.read(100) will read the next 100 bytes (up to) from the handle. Which is the same beahviour as the read method for files. Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: {SPAM} start a python application as a win NT service

2005-03-14 Thread lbolognini
Hi there, these guys did it: http://www.cherrypy.org/wiki/WindowsService not sure if it can help. Lorenzo -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I pass structures using a C extension?

2005-03-14 Thread qui le bile
[EMAIL PROTECTED] a écrit : Hi. I trying to write an extension module to call some C libraries so I can use them in Python. Several of the library functions pass pointers to structures as arguments. I was thinking that I could create a class for each structure, but I'm not sure how to get the data

Re: Encodings and printing unicode

2005-03-14 Thread Kent Johnson
Fuzzyman wrote: How does the print statement decode unicode strings itis passed ? (By that I mean which encoding does it use). sys.stdout.encoding Under windows it doesn't appear to use defaultencoding. On my system the default encoding is ascii, yet the terminal encoding is latin1 (or cp1252 or wh

Re: Encodings and printing unicode

2005-03-14 Thread Fuzzyman
Kent Johnson wrote: > Fuzzyman wrote: > > How does the print statement decode unicode strings itis passed ? (By > > that I mean which encoding does it use). > > sys.stdout.encoding > [snip..] Aha... that's the missing piece of information. Thank you. Regards, Fuzzy http://www.voidspace.org.uk/p

RE: urllib (and urllib2) read all data from page on open()?

2005-03-14 Thread Alex Stapleton
Except wouldn't it of already read the entire file when it opened, or does it occour on the first read()? Also will the data returned from handle.read(100) be raw HTTP? In which case what if the encoding is chunked or gzipped? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTE

Re: urllib (and urllib2) read all data from page on open()?

2005-03-14 Thread Fuzzyman
Alex Stapleton wrote: > Except wouldn't it of already read the entire file when it opened, or does > it occour on the first read()? Don't know, sorry. Try looking at the source code - it should be reasonably obvious. > Also will the data returned from > handle.read(100) be raw HTTP? In which cas

RE: urllib (and urllib2) read all data from page on open()?

2005-03-14 Thread Swaroop C H
--- Alex Stapleton <[EMAIL PROTECTED]> wrote: > Except wouldn't it of already read the entire file when it opened, > or does it occour on the first read()? Also will the data returned > from handle.read(100) be raw HTTP? In which case what if the > encoding is chunked or gzipped? Maybe the httpl

RE: urllib (and urllib2) read all data from page on open()?

2005-03-14 Thread Alex Stapleton
Whilst it might be able to do what I want I feel this to be a flaw in urllib that should be fixed, or at least added to a buglist somewhere so I can at least pretend someone other than me cares. -Original Message- From: Swaroop C H [mailto:[EMAIL PROTECTED] Sent: 14 March 2005 14:45 To: Al

Re: About Databases...

2005-03-14 Thread Ruben Baumann
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello NG, I am still quite a newbie with Python (I intensely use wxPython, anyway). I would like to know what are, in your opinions, the best/faster databases that I could use in Python (and, of course, I should be able to "link" eve

Re: Itertools wishlists

2005-03-14 Thread Steven Bethard
Ville Vainio wrote: A simpler API: def flatten(sequence, atomic_test = lambda o: isinstance(o,basestring)): """ don't recurse into iterables if atomic_test -> True """ Yes, this is also the API I would have suggested. Simple, but flexible enough to handle the odd cases with the occasional user-

Re: PEP 309 (Partial Function Application) Idea

2005-03-14 Thread Chris Perkins
Steven Bethard <[EMAIL PROTECTED]> wrote: > > getting attributes with defaults[1]: > objs.sort(key=lambda a: getattr(a, 'lineno', 0)) > objs.sort(key=getattr(__, 'lineno', 0) > Yes, this exact example is one of the (very) few that I found in the standard library where the syntax actual

Re: [OT] Who Knows of a Good Computational Physics Textbook?

2005-03-14 Thread Scott David Daniels
Look into Ruth Chabay's physics books for a possibly appropriate choice and surpisingly on-topic choice. That is, unless you are talking computational physics at the level of "ab initio chemistry" and friends. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/pytho

Re: {SPAM} start a python application as a win NT service

2005-03-14 Thread elbertlev
> I'm using windows 2003 small business server and I want to install my python programm as a NT (it's just an old name) service. Does anybody know how to do this? 1. you need win32 extensions installed; 2. you need py2exe (optional if you want to install the service on the machine with no Python)

Re: optparse alternative

2005-03-14 Thread Steven Bethard
Henry Ludemann wrote: I've been writing an optparse alternative (using getopt) that is at a stage where I'd be interested in people's opinions. Looks interesting, but is it really that different from optparse? I do like the fact that you can specify a type with a conversion function. (In optparse

Re: Building Python 2.4 with icc and processor-specific optimizations

2005-03-14 Thread Michael Hoffman
Michael Hoffman wrote: Just out of curiosity, I was wondering if anyone has compiled Python 2.4 with the Intel C Compiler and its processor specific optimizations. I can build it fine with OPT="-O3" or OPT="-xN" but when I try to combine them I get this as soon as ./python is run: """ case $MAKEFLA

Escaping filename in http response

2005-03-14 Thread Fuzzyman
I know I *could* look this up in the relevant RFC... but I thought someone might know it off the top of their head. I'm offering files for download via a CGI. I am inserting the filename into the relevant http header. Where the filename contains spaces firefox truncates it - which is probably corr

python reading excel thru ADO ?

2005-03-14 Thread Chris Curvey
Windows-specific question for you all... I've been reading http://www.mayukhbose.com/python/ado/ad-connection.php , which seems to infer that I can read an Excel file using the ADO interface with Python on Windows. Unfortunately, the usual problem with ADO -- connection strings -- is raising it

Re: Web framework

2005-03-14 Thread Joe
On Mon, 14 Mar 2005 11:18:10 +0100, Josef Meile <[EMAIL PROTECTED]> wrote: >I guess you are reffering to "Python Scripts" and "ZClasses", which >indeed are stuck in the ZODB. But in fact you can write external python >products for zope, which reside on your file system. What is stuck in >the ZODB w

Re: optparse alternative

2005-03-14 Thread Steven Bethard
Henry Ludemann wrote: I've been writing an optparse alternative (using getopt) that is at a stage where I'd be interested in people's opinions. Some more detailed comments: * The more I think about it, the more I like that you're basically constructing options to match a function signature. But I

Re: Escaping filename in http response

2005-03-14 Thread Richard Brodie
"Fuzzyman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Which is the right function to escape the filename urllib.quote or > urllib.quote_plus ? Neither. Just drop quotes around it, after having sanitized it (assuming it's plain ASCII). Alternatively you could use the email pack

Re: how to delete the close button (the X on the right most corner of the window) on a window

2005-03-14 Thread jrlen balane
I am using BOA Constructor in building a GUI On 13 Mar 2005 21:19:07 -0800, Harlin Seritt <[EMAIL PROTECTED]> wrote: > What GUI toolkit are you using? I think this is the point Jeremy is > making. > > Harlin Seritt > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.p

Re: Escaping filename in http response

2005-03-14 Thread Fuzzyman
Nice one - thanks. Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

[Fwd: RE: [PyCON-Organizers] volunteers]

2005-03-14 Thread Steve Holden
PyCon delegates: Here's your chance to achieve fame and fortune (or at least a certain degree of notoriety). If you'd like to help out by chairing one or more sessions please update the Wiki page referenced in Michael Chermside's attached email. regards Steve Original Message

super with only one argument

2005-03-14 Thread Steven Bethard
When would you call super with only one argument? The only examples I can find of doing this are in the test suite for super. Playing around with it: py> class A(object): ... x = 'a' ... py> class B(A): ... x = 'b' ... py> s = super(B) py> s.x Traceback (most recent call last): File

getting data with proper encoding to the finish

2005-03-14 Thread Ksenia Marasanova
Hi, I have a little problem with encoding. Was hoping maybe anyone can help me to solve it. There is some amount of data in a database (PG) that must be inserted into Excel sheet and emailed. Nothing special, everything works. Except that non-ascii characters are not displayed properly. The data

RE: Itertools wishlists

2005-03-14 Thread Robert Brewer
Steven Bethard wrote: > Ville Vainio wrote: > > A simpler API: > > > > def flatten(sequence, atomic_test = lambda o: > isinstance(o,basestring)): > > """ don't recurse into iterables if atomic_test -> True """ > > Yes, this is also the API I would have suggested. Simple, > but flexible enoug

Getting the process list on win98

2005-03-14 Thread Ron
I've written a screen saver which opens multiple copies on windows 98. I'm trying to check the process list to determine if it is already running. So far all the example win32 routines I've found, through google, only work on newer xp and nt versions of windows. This is the current attempt to g

Re: python reading excel thru ADO ?

2005-03-14 Thread Chris Curvey
Chris Curvey wrote: Windows-specific question for you all... I've been reading http://www.mayukhbose.com/python/ado/ad-connection.php , which seems to infer that I can read an Excel file using the ADO interface with Python on Windows. Unfortunately, the usual problem with ADO -- connection stri

Re: Itertools wishlists

2005-03-14 Thread Steven Bethard
Robert Brewer wrote: Steven Bethard wrote: Ville Vainio wrote: A simpler API: def flatten(sequence, atomic_test = lambda o: isinstance(o,basestring)): """ don't recurse into iterables if atomic_test -> True """ Yes, this is also the API I would have suggested. Simple, but flexible enough to han

Re: Itertools wishlists

2005-03-14 Thread Ville Vainio
> "Steven" == Steven Bethard <[EMAIL PROTECTED]> writes: Steven> complex atomicity test). I also have the feeling that any Steven> complicated atomictiy test is more than a simple and-ing Steven> of several tests... I also have the feeling that if the atomicity criterion was any

GET MORE FOR YOUR BUCK

2005-03-14 Thread ml
The biggest store online www.thebuckstore.com http://www.thebuckstore.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: super with only one argument

2005-03-14 Thread Michele Simionato
I asked myself the same question and I am not convinced that using 'super' with one argument really makes sense (i.e. IMO it is more a liability than an asset). BTW, I have a set of notes on the tricky aspects of 'super' you may be interested in. Michele Simionato -- http://mail.pyth

win32 shell extension (virtual drive)

2005-03-14 Thread Tiziano Bettio
Hi there I'm looking for a simple solution of a win32 shell extension (virtual drive). It should make available a new drive with letter, which will be read-only. Instead of a network drive or similar it then should query a server application for directory/file listing. Would be nice to have a lib o

Re: Wishlist item: itertools.flatten

2005-03-14 Thread Michael Spencer
Leif K-Brooks wrote: Michael Spencer wrote: if hasattr(item,"__iter__"): # Avoids iterating over strings That's probably the cleanest way to avoid strings, but it's unfortunately not a good idea IMHO. Many objects (IndexedCatalog's Result objects are what I'm concerned about, but the

Re: How do I pass structures using a C extension?

2005-03-14 Thread [EMAIL PROTECTED]
Thanks for all the replies so far. I'm starting to look at SWIG, but the libraries I want access to are all static. I created a small interface file and a setup.py file, but when I build it, I get undefined symbols. It sounds like the pack/unpack struct method is a little to messy for my tastes.

Re: optparse alternative

2005-03-14 Thread Michael Hoffman
Henry Ludemann wrote: I've been writing an optparse alternative (using getopt) that is at a stage where I'd be interested in people's opinions. Thanks for the work and letting us see it! As far as I can tell, your module has one functional advantage over optparse--it validates arguments as well as

Re: optparse alternative

2005-03-14 Thread Henry Ludemann
Thanks for the comments... Steven Bethard wrote: Looks interesting, but is it really that different from optparse? In the sense that they both do the same thing, no, not really. But the way they do it is quite different; optparse bases itself on setting variables, while this module is for invoking

Re: a program to delete duplicate files

2005-03-14 Thread David Eppstein
In article <[EMAIL PROTECTED]>, "John Machin" <[EMAIL PROTECTED]> wrote: > Just look at the efficiency of processing N files of the same size S, > where they differ after d bytes: [If they don't differ, d = S] I think this misses the point. It's easy to find the files that are different. Just

Re: a program to delete duplicate files

2005-03-14 Thread David Eppstein
In article <[EMAIL PROTECTED]>, Patrick Useldinger <[EMAIL PROTECTED]> wrote: > Shouldn't you add the additional comparison time that has to be done > after hash calculation? Hashes do not give 100% guarantee. When I've been talking about hashes, I've been assuming very strong cryptographic ha

Re: Itertools wishlists

2005-03-14 Thread Raymond Hettinger
> Steven> complex atomicity test). I also have the feeling that any > Steven> complicated atomictiy test is more than a simple and-ing > Steven> of several tests... "Ville Vainio" > I also have the feeling that if the atomicity criterion was any more > complex in the API, the proposal

Re: optparse alternative

2005-03-14 Thread Henry Ludemann
* The more I think about it, the more I like that you're basically constructing options to match a function signature. But I can imagine that this might be too restrictive for some uses. It might be worth having an alternate interface that provides an options object like optparse does. It i

py2app can't find boot_app.py

2005-03-14 Thread Bob Swerdlow
I'm trying to move my application from bundlebuilder to py2app. I upgraded to PyObjC 1.2, which include py2app 1.7, but I got the following error. I saw a note on the py2app site that earlier versions need to be removed before the upgrade, so I deleted the py2app directory and downloaded and

Re: a program to delete duplicate files

2005-03-14 Thread Patrick Useldinger
David Eppstein wrote: When I've been talking about hashes, I've been assuming very strong cryptographic hashes, good enough that you can trust equal results to really be equal without having to verify by a comparison. I am not an expert in this field. All I know is that MD5 and SHA1 can create c

Re: urllib (and urllib2) read all data from page on open()?

2005-03-14 Thread Bengt Richter
On Mon, 14 Mar 2005 14:48:25 -, "Alex Stapleton" <[EMAIL PROTECTED]> wrote: >Whilst it might be able to do what I want I feel this to be a flaw in urllib >that should be fixed, or at least added to a buglist somewhere so I can at >least pretend someone other than me cares. > Someone cares abou

Re: a program to delete duplicate files

2005-03-14 Thread Patrick Useldinger
David Eppstein wrote: The hard part is verifying that the files that look like duplicates really are duplicates. To do so, for a group of m files that appear to be the same, requires 2(m-1) reads through the whole files if you use a comparison based method, or m reads if you use a strong hashin

Re: optparse alternative

2005-03-14 Thread Henry Ludemann
As far as I can tell, your module has one functional advantage over optparse--it validates arguments as well as options. Functionality wise, that is probably about it. It is more from a seperation of command line / functionality code that I wrote this; that the command line code should be sepera

Re: Itertools wishlists

2005-03-14 Thread Ville Vainio
> "Raymond" == Raymond Hettinger <[EMAIL PROTECTED]> writes: Steven> complex atomicity test). I also have the feeling that any Steven> complicated atomictiy test is more than a simple and-ing Steven> of several tests... Raymond> "Ville Vainio" >> I also have the feeling

Re: optparse alternative

2005-03-14 Thread Michael Hoffman
Henry Ludemann wrote: I had actually written most of this module before I became aware > of optparse (it was one of those bash the head against the wall > moments when I found it), I've been there :) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Itertools wishlists

2005-03-14 Thread bearophileHUGS
Thank you for your answers, Raymond Hettinger. >The options also suggest that the abstraction is not as basic or universal as we would hope.< I don't understand, but this is normal. > ll = open("namefile").read().split() > r = partition(map(float, ll), 4) >If you need that to be flattened one

Re: A Font Dialog (Tkinter)

2005-03-14 Thread Raseliarison nirinA
"Harlin Seritt" wrote: > Is there a way to call up the Font dialog box (at least in the > Windows API) from Tkinter or another module? > i'll use the tkFont module and the same way as IDLE calls it. looking at the source code may help you: >>> import tkFont, idlelib.configDialog, inspect >>> pri

Re: Listbox fill=BOTH expand=YES (Tkinter)

2005-03-14 Thread Raseliarison nirinA
"Martin Franklin" wrote: > Harlin Seritt wrote: > > I am trying the following: > > > > Listbox(parent).pack(fill=BOTH, expand=YES) > > > > I notice that the listbox will fill on the X axis but will not on > > the Y axis unlike other widgets. > > Is there any way to force this? > > > > thanks, > >

Re: Listbox fill=BOTH expand=YES (Tkinter)

2005-03-14 Thread Harlin Seritt
That was it Martin. I forgot to expand the parent. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: (Newbie) Restricting inherited methods to operate on element from same subclass

2005-03-14 Thread andy2O
Bruno Desthuilliers wrote: > You've already got the technical answer. About a possible design flaw, > it would seem to me that restricting the join() operation on specific > subclasses breaks the LSP. OTOH, Python being dynamically typed, > inheritence is merely an implementation detail, so that m

Conversion to string: how do `s work?

2005-03-14 Thread Chris Lasher
I'm working my way through _Learning_Python_ 2nd ed., and I saw something peculiar which is not explained anywhere in the text. print " " + file + " size=" + `size` The `s appear to somehow automagically convert the integer to a string for concatenation. How does this work? Is this just a shortcu

yum repository

2005-03-14 Thread Donald L. Dietmeyer
What yum repository do you use to pick up python rpms? Don -- http://mail.python.org/mailman/listinfo/python-list

Re: Beware complexity

2005-03-14 Thread Ron
Philip Smith wrote: I wonder if anyone has any thoughts not on where Python should go but where it should stop? My feelings on this is, it's a problem of organization and documentation. Do both of these well, and things will be manageable. I would like to see a bit cleaner file organization fra

Re: is there a problem on this simple code

2005-03-14 Thread jrlen balane
why is it that here: 1)rx_data = ser.read(10) (rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1, pyra2, voltage, current, rx_checksum) = unpack('10B', rx_data) print rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1, pyra2, voltage, current, rx_checksum >>> type (rx_co

Re: a program to delete duplicate files

2005-03-14 Thread Bengt Richter
On Mon, 14 Mar 2005 10:43:23 -0800, David Eppstein <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, > "John Machin" <[EMAIL PROTECTED]> wrote: > >> Just look at the efficiency of processing N files of the same size S, >> where they differ after d bytes: [If they don't differ, d = S] > >

OS X and Tkinter

2005-03-14 Thread Mike Tuller
I recently purchased a book to learn python, and am at a part where I want to start working with GUIs. I have an OS X system, and am using the default python installed on the system. I have installed Tcl/Tk Aqua from http://tcltkaqua.sourceforge.net/. When I run the file called gui.py that c

Re: Listbox fill=BOTH expand=YES (Tkinter)

2005-03-14 Thread Harlin Seritt
either YES, True, or 1 should work. -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining the length of strings in a list

2005-03-14 Thread Michael Spencer
[EMAIL PROTECTED] wrote: I have a dictionary. Each key contains a list. I am using the contents of the list to build a portion of a command line. However, before I can build the command line, I have to make sure that the command isn't too long. Depending on how you join the list items, you may ju

command line args

2005-03-14 Thread [EMAIL PROTECTED]
Hello, I have the following commands: testb -s testb -s -o testb -s -o How do i split the commands so that all three are valid. And how do i check for missing arguments? Thanks, -Joe -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >