Re: Hard times with packages and instances

2005-05-05 Thread Kay Schluehr
Fredrik Lundh wrote: > Kay Schluehr wrote: > > > I wonder why the isinstance() function is sensitive about the import > > path i.e. the result depends not only on the class and the instance but > > also on how a class is imported? > > isinstance uses class object identity. > > if you manage to impo

Re: New Python regex Doc

2005-05-05 Thread Bryan
Xah Lee wrote: > Extra point: If the Python command line interface is actually a robust > application, like so-called IDE e.g. Mathematica front-end, then things > are very different. In reality, the Python command line interface is a > fucking toy whose max use is as a simplest calculator and dou

Re: Newbie.......Python and Networking

2005-05-05 Thread xeron
Thanks again, and i didn't peek...planning to do it later have my exams for next 14 days then I'll zero in on Python... -- http://mail.python.org/mailman/listinfo/python-list

Re: So many things that need to be decided....

2005-05-05 Thread Mike Meyer
Nick Vargish <[EMAIL PROTECTED]> writes: > Mage <[EMAIL PROTECTED]> writes: > >> - identing with tabs > > Indenting with tabs is pretty much frowned upon in Python, as Guido > relates in PEP 8: > > http://www.python.org/peps/pep-0008.html > > I guess it doesn't matter much if you are the only pers

Multiple-reader-one-writer (MROW) locking -- soliciting improvements

2005-05-05 Thread Matthew Scott
After being introduced to the concept of MROW locking, I sought a general implementation of it in Python that implemented reentrant locks, had a simple interface, and was unit tested. I found some implementations, but none had all three of these qualities, so I wrote this recipe: http://aspn.acti

Re: How to detect a double's significant digits

2005-05-05 Thread Jeremy Bowers
On Thu, 05 May 2005 20:08:46 -0700, Erik Max Francis wrote: > Grant's point was that as significance is used in scientific studies, > there's no way to answer the question without having the number in > advance. My point was that the original poster never defined "significance" in that manner, and

win32: structured storage

2005-05-05 Thread tlviewer
hello, In honor of the chm exploit that I got hit by last week, I trying to code some ActivePython to list the directory inside a CHM. CHM is supposed to be structured storage (ITSF). If a given CHM file is infected it most likely has an embedded EXE file -- mine had one called [Open.exe]. The f

Re: How to detect a double's significant digits

2005-05-05 Thread Dan Bishop
Fredrik Lundh wrote: > "mrstephengross" wrote: > > > >But, assuming you have your numbers as strings, I would suggest > > looking > > at str.split() and len(). > > > > Well, the numbers are in fact stored as numbers, so string processing > > won't work. > > if they're not strings, your question is

Re: How to detect a double's significant digits

2005-05-05 Thread Erik Max Francis
Jeremy Bowers wrote: > Not necessarily; consider the str() of a float in Python, especially given > the "significant digits" aspect (it may be ill-defined, but I can think of > several well-defined ways to mean that, where str() embodies one of them). > The easiest way to tell how long the number

Re: How to detect a double's significant digits

2005-05-05 Thread Jeremy Bowers
On Fri, 06 May 2005 02:44:43 +, Grant Edwards wrote: > On 2005-05-05, Jeremy Bowers <[EMAIL PROTECTED]> wrote: > >> Since I think he mentioned something about predicting how much space it >> will take to print out, my suggestion is to run through whatever >> printing routines there are and ge

Re: How to detect a double's significant digits

2005-05-05 Thread Grant Edwards
On 2005-05-05, mrstephengross <[EMAIL PROTECTED]> wrote: >>This doesn't look like Python to me. Are you sure you're on the right > newsgroup? > > Er, ok, I'm an idiot. This was all supposed to be on > comp.lang.c++, but obviously I posted on the wrong one. Sorry > for all the hassle. In python, th

Re: How to detect a double's significant digits

2005-05-05 Thread Grant Edwards
On 2005-05-05, Erik Max Francis <[EMAIL PROTECTED]> wrote: > Especially since all of his examples have the same number of > significant digits (3), as the term is usually meant. Zeroes > to the right are significant, not zeroes to the left. And only the person who performed the measurement knows

Re: How to detect a double's significant digits

2005-05-05 Thread Grant Edwards
On 2005-05-05, Jeremy Bowers <[EMAIL PROTECTED]> wrote: > Since I think he mentioned something about predicting how much > space it will take to print out, my suggestion is to run > through whatever printing routines there are and get a string > out, A step which will require him to tell the prin

py2exe + svn - the final drama

2005-05-05 Thread Timothy Smith
ok, i am updating my program from my svn - this works, however, i am getting the following error when i close the program. the zip file successfully updates, so i'm curious as to the meaning of this. Traceback (most recent call last): File "Main.pyo", line 820, in ValidateLogin File "Main.py

Python at MS Event!

2005-05-05 Thread James
Just back from an MS event. They normally don't show anything non-MS. This time they showed a Python client (interpreter in interactive mode) interop with a .NET web service. They even had a few nice things to say of Python. Of course, then the rest of the presentation was about WSE which doesn't

Re: New Python regex Doc

2005-05-05 Thread André Roberge
alex23 wrote: > Xah Lee wrote: > >>99% of programers really don't need to give a flying fuck about the >>history of a language. > > > Ironically, I'm pretty confident that the same percentage of readers on > this group feel _exactly the same way_ about your 'improvements'. > > -alex23 > I take

Re: New Python regex Doc (was: Python documentation moronicities)

2005-05-05 Thread alex23
Xah Lee wrote: > 99% of programers really don't need to give a flying fuck about the > history of a language. Ironically, I'm pretty confident that the same percentage of readers on this group feel _exactly the same way_ about your 'improvements'. -alex23 -- http://mail.python.org/mailman/list

Re: F.readline

2005-05-05 Thread Alex N
Erik Max Francis wrote: > Robert Kern wrote: > > > There is no such command built in. You will have to build it yourself > > out of the components that are available. > > linecache is probably what he's looking for. > > -- > Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ > Sa

Re: F.readline

2005-05-05 Thread Robert Kern
Erik Max Francis wrote: > Robert Kern wrote: > >>There is no such command built in. You will have to build it yourself >>out of the components that are available. > > linecache is probably what he's looking for. Well, I'll be darned, indeed it is. Hooray for the time machine. -- Robert Kern [

Re: F.readline

2005-05-05 Thread Erik Max Francis
Robert Kern wrote: > There is no such command built in. You will have to build it yourself > out of the components that are available. linecache is probably what he's looking for. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && A

Re: F.readline

2005-05-05 Thread Robert Kern
Alex Nordhus wrote: > Having some trouble with f.readline and python. Specifically looking for > the command to tell it to go and read a specific line. There is no such command built in. You will have to build it yourself out of the components that are available. -- Robert Kern [EMAIL PROTECTED

Re: py2exe and library.zip

2005-05-05 Thread David Bolen
Timothy Smith <[EMAIL PROTECTED]> writes: > I've got this working now, and fyi it downloads the entire zip every > time. and svn appears to be very slow at it to. Hmm, not what I would have expected, and certainly unfortunate for your desired use case. I just tried some experiments with rsync (e

F.readline

2005-05-05 Thread Alex Nordhus
Having some trouble with f.readline and python. Specifically looking for the command to tell it to go and read a specific line. Alex Nordhus Keystroke clipboard Copy and Paste ! http://www.pasteaway.com -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe and library.zip

2005-05-05 Thread David Bolen
Peter Hansen <[EMAIL PROTECTED]> writes: > Good point. When I wrote that I was picturing the form of compression > that a .tar.gz file would have, not what is actually used inside a > .zip file which is -- quite logically now that you point it out -- > done on a file-by-file basis. (Clearly to d

Re: Tons of stats/opens to non-existing files increases Python's startupon loaded NFS servers

2005-05-05 Thread Fredrik Lundh
Quentin Crain wrote: > I am being told by my systems people that the load on > the NFS servers is nasty. Our python installs are up > on NFS. Also, on a bureaucratic note, I have very > little input/control into the python builds (sigh). > > I have found the following (linux): > > strace -f -F pyt

Re: py2exe and library.zip

2005-05-05 Thread Timothy Smith
David Bolen wrote: >Peter Hansen <[EMAIL PROTECTED]> writes: > > > >>Do you know that Subversion has (as I understand it) a fairly >>intelligent binary file comparison routine, and it will (again, as I >>understand it) not transmit the entire contents of the zip file but >>would actually send on

Re: py2exe and library.zip

2005-05-05 Thread Peter Hansen
David Bolen wrote: > Peter Hansen <[EMAIL PROTECTED]> writes: >>Do you know that Subversion has (as I understand it) a fairly >>intelligent binary file comparison routine, and it will (again, as I >>understand it) not transmit the entire contents of the zip file but >>would actually send only the p

Re: how to look up functions

2005-05-05 Thread Juan Comesaña
slayer wrote: > Hi all, > I am a python newbie. I need some help to loop up about API, or reference. > If any web that Java API Document, I will try it. Is there some one like it > or other ways? > -- Go to http://www.python.org, there is a complete module reference there. If you installed Python

Tons of stats/opens to non-existing files increases Python's startup on loaded NFS servers

2005-05-05 Thread Quentin Crain
Hello All: I am being told by my systems people that the load on the NFS servers is nasty. Our python installs are up on NFS. Also, on a bureaucratic note, I have very little input/control into the python builds (sigh). I have found the following (linux): strace -f -F python2.2.2 -c 'pass' |& fg

Re: New Python regex Doc (was: Python documentation moronicities)

2005-05-05 Thread Fredrik Lundh
Xah Lee wrote: > I have now also started to rewrite the re-syntax page. At first i > thought that page needs not to be rewritten, since its about regex and > not really involved with Python. But after another look, that page is > as incompetent as every other page of Python documentation. > > The

Re: py2exe and library.zip

2005-05-05 Thread David Bolen
Peter Hansen <[EMAIL PROTECTED]> writes: > Do you know that Subversion has (as I understand it) a fairly > intelligent binary file comparison routine, and it will (again, as I > understand it) not transmit the entire contents of the zip file but > would actually send only the portions that have ch

Re: Documenting Python code.

2005-05-05 Thread Fredrik Lundh
Isaac Rodriguez wrote: > Since Python is a very powerful language parsing strings, replacing > expressions, and processing XML, I was wondering if people documents the > code using constructs similar to JavaDoc if you want something very similar to JavaDoc, you can use PythonDoc: http://effb

UnicodeDecodeError

2005-05-05 Thread Thomas
Thanks a lot.. Fredrik..   That’s says it all..   Cheers Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Encryption with Python?

2005-05-05 Thread Steve Christensen
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > "Blake T. Garretson" <[EMAIL PROTECTED]> writes: > >> I found a few modules out there, but they seem to be all but abandoned. >> Most seem to have died several years ago. The most promising package >> is A.M. Kuchling's Python Cryptography Tool

Re: Py2Exe security

2005-05-05 Thread Timothy Smith
i used to work in a place that did this exact same thing. they attempted to hide passwords in source code. there is an even bigger problem with this then security of it in source - if someone comprimises the password, how are you going to change it quickly? all those systems will have to update the

Re: properties vs. eval()

2005-05-05 Thread Bob Rogers
So you're saying you don't know the answer? The question wasn't "should I use setattr?" -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary comparison

2005-05-05 Thread James Stroud
On Thursday 05 May 2005 01:18 pm, so sayeth Bengt Richter: > On Thu, 5 May 2005 10:37:23 -0700, James Stroud <[EMAIL PROTECTED]> > wrote: [...] > We had the same impulse ;-) > (see my other post in this thread) > > ># use patch as value and version as key > > ??? seems the other way around (as it s

Re: New Python regex Doc (was: Python documentation moronicities)

2005-05-05 Thread Xah Lee
I have now also started to rewrite the re-syntax page. At first i thought that page needs not to be rewritten, since its about regex and not really involved with Python. But after another look, that page is as incompetent as every other page of Python documentation. The rewritten page is here: htt

Re: Py2Exe security

2005-05-05 Thread Luciano Rodrigues da Silva
I think that encrypt with public/private key will be a solution in your case. I don't know if python has a module to do this kind of encrypt. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hard times with packages and instances

2005-05-05 Thread Fredrik Lundh
Kay Schluehr wrote: > I wonder why the isinstance() function is sensitive about the import > path i.e. the result depends not only on the class and the instance but > also on how a class is imported? isinstance uses class object identity. if you manage to import the same thing multiple times, yo

Re: Encryption with Python?

2005-05-05 Thread Fredrik Lundh
Blake T. Garretson wrote: > I found a few modules out there, but they seem to be all but abandoned. > Most seem to have died several years ago. a lack of recent releases can also mean that they just work... > Is this the defacto Python encryption solution? What does everyone > else use? Any o

Re: Encryption with Python?

2005-05-05 Thread Paul Rubin
"Blake T. Garretson" <[EMAIL PROTECTED]> writes: > I want to save some sensitive data (passwords, PIN numbers, etc.) to > disk in a secure manner in one of my programs. What is the > easiest/best way to accomplish strong file encryption in Python? Any > modern block cipher will do: AES, Blowfish,

Re: How to detect a double's significant digits

2005-05-05 Thread Erik Max Francis
Jeremy Bowers wrote: > Step one for mrstephengross is to *rigorously* define what he means by > "significant digits", then go from there. Since I think he mentioned > something about predicting how much space it will take to print out, my > suggestion is to run through whatever printing routines t

Re: How to detect a double's significant digits

2005-05-05 Thread Jeremy Bowers
On Thu, 05 May 2005 18:42:17 +, Charles Krug wrote: > On 5 May 2005 10:37:00 -0700, mrstephengross <[EMAIL PROTECTED]> > wrote: >> Hi all... How can I find out the number of significant digits (to the >> right of the decimal place, that is) in a double? At least, I *think* >> that's what I'm a

Re: Encryption with Python?

2005-05-05 Thread phil
Bill Gates us MD5. Hah! Sorry. :-) Blake T. Garretson wrote: > I want to save some sensitive data (passwords, PIN numbers, etc.) to > disk in a secure manner in one of my programs. What is the > easiest/best way to accomplish strong file encryption in Python? Any > modern block cipher will do:

Re: How to write this regular expression?

2005-05-05 Thread Fredrik Lundh
"D H" <[EMAIL PROTECTED]> wrote: > > Why do you think you need a regular expression? > > > > If another approach that involved no regular expressions worked much > > better, would you reject it for some reason? > > A regular expression will work fine for his problem. > Just match the digits separa

Encryption with Python?

2005-05-05 Thread Blake T. Garretson
I want to save some sensitive data (passwords, PIN numbers, etc.) to disk in a secure manner in one of my programs. What is the easiest/best way to accomplish strong file encryption in Python? Any modern block cipher will do: AES, Blowfish, etc. I'm not looking for public key stuff; I just want

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-05 Thread willitfw
yes, I have done that. i'll keep working on it. thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: UnicodeDecodeError

2005-05-05 Thread Fredrik Lundh
"thomas ct" wrote: > what i was trying to say was how the various tuples behave..if i use > > file = ('file', filename, data) #it gives me unicode error > in this case I am using binary data.. > > file = ('file', filename, 'data'*100) > but the same filename works fine if i pass text data > > fil

Re: FTP/TLS connection using python

2005-05-05 Thread scrimp
Does anyone know how I can get m2crypto installed on a windows box w/o paying for the installer? I think thats dumb to charge for the windows version and the unix version is free...o well --Barry -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary comparison

2005-05-05 Thread Bengt Richter
On Thu, 5 May 2005 10:37:23 -0700, James Stroud <[EMAIL PROTECTED]> wrote: [...] We had the same impulse ;-) (see my other post in this thread) > ># use patch as value and version as key ??? seems the other way around (as it should be?) >recc_dct = dict([x.split("-") for x in recc_ary]) >serv_dct

UnicodeDecodeError

2005-05-05 Thread thomas ct
Hi Fredrik   Sorry that I confused u Thomas Thomas wrote:>there's no way the tuple creation will generate a UnicodeDecodeError>all by itself.  are you sure the error occurs on that line?u r right, the error is not generated in tuple creation . it generated where join the strings at the line   bod

Re: python and glut

2005-05-05 Thread Lonnie Princehouse
Welcome to the exciting world of trying to make graphics work on Linux =) DRI is direct rendering. The Module section of your XF8Config should have: Load "glx" Load "dri" Load "GLCore" That probably won't solve things. Google for some combination of ("debian" + "xfree86" + your vide

Re: dictionary comparison

2005-05-05 Thread Bengt Richter
On 5 May 2005 08:19:31 -0700, "rickle" <[EMAIL PROTECTED]> wrote: >I'm trying to compare sun patch levels on a server to those of what sun >is recommending. For those that aren't familiar with sun patch >numbering here is a quick run down. > >A patch number shows up like this: >113680-03 >^^

Re: min max of a list

2005-05-05 Thread querypk
what if we do something like this. Assume the values list is the content of a histogram. Then we see that values = [ 0, 72, 0, 4, 9, 2, 0, 0, 42, 26, 0, 282, 23, 0, 101, 0, 0, 0, 0, 0] 1 is repeated 72 times, 3 -> 4 times and so on. That is the index would be the value

Re: How to detect a double's significant digits

2005-05-05 Thread Fredrik Lundh
"mrstephengross" wrote: > >But, assuming you have your numbers as strings, I would suggest > looking > at str.split() and len(). > > Well, the numbers are in fact stored as numbers, so string processing > won't work. if they're not strings, your question is meaningless. as others have pointed ou

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-05 Thread Martijn Pieters
willitfw wrote: any help on level 4 would be appreciated. i've looked at the hints, but isn't obvious It isn't meant to be too obvious.. If you're expecting obvious solutions, you won't like the rest of the challenge. ;) What have you tried? Have you studied the source of the page, tried the link,

Re: So many things that need to be decided....

2005-05-05 Thread Nick Vargish
Mage <[EMAIL PROTECTED]> writes: > - identing with tabs Indenting with tabs is pretty much frowned upon in Python, as Guido relates in PEP 8: http://www.python.org/peps/pep-0008.html I guess it doesn't matter much if you are the only person who will ever touch your code, and you never, ever, ac

Re: How to detect a double's significant digits

2005-05-05 Thread Peter Otten
mrstephengross wrote: > This was all supposed to be on comp.lang.c++, but You may still want to read the following thread on Python-Dev: http://mail.python.org/pipermail/python-dev/2004-March/043703.html A link mentioned by Andrew Koenig may be helpful: http://www.netlib.org/fp/ """ fileg_f

Re: How to detect a double's significant digits

2005-05-05 Thread phil
Bollocks, works here. That looks like Java!!! Aaaihh! mrstephengross wrote: > Ok, that won't work. First of all, str() is not a function. If I want > to convert the float into a string, the conversion function will have > to use some kind of numeric precision, which will screw things up. > Cons

Re: How to detect a double's significant digits

2005-05-05 Thread mrstephengross
>This doesn't look like Python to me. Are you sure you're on the right newsgroup? Er, ok, I'm an idiot. This was all supposed to be on comp.lang.c++, but obviously I posted on the wrong one. Sorry for all the hassle. In python, this stuff is a heck of a lot easier. --Steve -- http://mail.pytho

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-05 Thread willitfw
any help on level 4 would be appreciated. i've looked at the hints, but isn't obvious -- http://mail.python.org/mailman/listinfo/python-list

Re: How to detect a double's significant digits

2005-05-05 Thread Grant Edwards
On 2005-05-05, mrstephengross <[EMAIL PROTECTED]> wrote: >>But, assuming you have your numbers as strings, I would suggest > looking > at str.split() and len(). > > Well, the numbers are in fact stored as numbers, Then your question is in fact meaningless. The related question that can be answere

Re: How to detect a double's significant digits

2005-05-05 Thread Charles Krug
On 5 May 2005 10:37:00 -0700, mrstephengross <[EMAIL PROTECTED]> wrote: > Hi all... How can I find out the number of significant digits (to the > right of the decimal place, that is) in a double? At least, I *think* > that's what I'm asking for. For instance: > > 0.103 --> 3 > 0.0103 --> 4 > 0.001

phyton memory management

2005-05-05 Thread Carlos Garcia
Hi all,      I do have a problem with python and it is that it raise an outofmemory (i comment lines in Py.java to avoid system.exit, to debug), i try to debug this issue with jprobe and realize that i get the exception even although the java heap is not in the limit, i can notice that pytho

Re: How to detect a double's significant digits

2005-05-05 Thread Steven Bethard
mrstephengross wrote: >>But, assuming you have your numbers as strings, I would suggest > > looking > at str.split() and len(). > > Well, the numbers are in fact stored as numbers, so string processing > won't work. How about: py> def digits(f): ... return len(str(f).split('.')[1].rstrip('0

Re: How to detect a double's significant digits

2005-05-05 Thread Steven Bethard
mrstephengross wrote: > Well, the numbers are in fact stored as numbers, so string processing > won't work. What kind of numbers? Python floats? STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: How to detect a double's significant digits

2005-05-05 Thread mrstephengross
>But, assuming you have your numbers as strings, I would suggest looking at str.split() and len(). Well, the numbers are in fact stored as numbers, so string processing won't work. >I'd give you an example, but this sounds kinda like a homework assignment. The task may sound like it comes from c

Re: How to detect a double's significant digits

2005-05-05 Thread Steven Bethard
mrstephengross wrote: > First of all, str() is not a function. Yes it is. > float f = 1.004; > ostringstream s; > s << f; > cout << s.str(); This doesn't look like Python to me. Are you sure you're on the right newsgroup? STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: How to detect a double's significant digits

2005-05-05 Thread Steven Bethard
mrstephengross wrote: > So how can I get the kind of information I want then? > > For example: > > 0.103 --> 3 > 0.0103 --> 4 > 0.00103 --> 5 > 0.000103 --> 6 > 0.103 --> 7 Beware that this is probably only relevant if you have your numbers as strings, not as floats: py> 0.103 0.102

Re: How to detect a double's significant digits

2005-05-05 Thread mrstephengross
Ok, that won't work. First of all, str() is not a function. If I want to convert the float into a string, the conversion function will have to use some kind of numeric precision, which will screw things up. Consider this: float f = 1.004; ostringstream s; s << f; cout << s.str(); The above code m

Re: min max of a list

2005-05-05 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Thanks for that. My version of python does'nt find "groupby". I am > using python 2.3.2. Is there a way I could do it with out using groupby itertools.groupby is in Python 2.4. The docs[1] give a Python equivalent, so if for some reason you can't upgrade to the current

Re: How to detect a double's significant digits

2005-05-05 Thread phil
fl = 1.0002 x = str(fl) pos = x.find('.') print len( x[pos+1:] ) >>> 4 mrstephengross wrote: > Hi all... How can I find out the number of significant digits (to the > right of the decimal place, that is) in a double? At least, I *think* > that's what I'm asking for. For instance: > > 0.103 -->

Re: How to detect a double's significant digits

2005-05-05 Thread mrstephengross
So how can I get the kind of information I want then? For example: 0.103 --> 3 0.0103 --> 4 0.00103 --> 5 0.000103 --> 6 0.103 --> 7 Any ideas? --Steve -- http://mail.python.org/mailman/listinfo/python-list

[ANN] Voidspace Guestbook 1.4.2

2005-05-05 Thread Fuzzyman
Oops, embarrasing bugix release time. Guestbook 1.4.1 worked fine (wonderfully even) with Python 2.4, but not with Python 2.3. This release fixes that, and also another Python 2.2 compatibility problem (yes I'm testing now...). Homepage : http://www.voidspace.org.uk/python/guestbook.html Example

Europython update

2005-05-05 Thread Jacob Hallen
This is a news update about the Europython 2005 conference, to be held in Göteborg, Sweden 27-29 June - Due to some technical prolems with the registration website we have decided to extend the registration of talks until 8 May. We already have an impressive array of talks, but we do have room

Re: How to detect a double's significant digits

2005-05-05 Thread James Stroud
Significant digits are an accounting concept. As such, it is up to the accountant to keep track of these as only she knows the precision of her measurements. Koan for the day: What are the significant digits of 0.1? Hint: >>> `0.1` James On Thursday 05 May 2005 10:37 am, so sayeth mrstephe

Re: Does the Python/C interface support Queue objects?

2005-05-05 Thread Fredrik Lundh
"[EMAIL PROTECTED]" wrote: > A little background. I made a C dll that sets up a thread for > collecting data from an NI data aquisition card. The thread builds a > list and passes the list to to python via a callback, then python puts > them in the Queue. I would prefer to put the data in the

How to detect a double's significant digits

2005-05-05 Thread mrstephengross
Hi all... How can I find out the number of significant digits (to the right of the decimal place, that is) in a double? At least, I *think* that's what I'm asking for. For instance: 0.103 --> 3 0.0103 --> 4 0.00103 --> 5 0.000103 --> 6 0.103 --> 7 Thanks in advance! --Steve ([EMAIL PROTECTED]

Re: dictionary comparison

2005-05-05 Thread James Stroud
On Thursday 05 May 2005 10:20 am, so sayeth rickle: > Bill and Jordan, thank you both kindly. I'm not too well versed in > functions in python and that's exactly what I needed. I could see I > was doing something wrong in my original attempt, but I didn't know how > to correct it. > > It's workin

Re: dictionary comparison

2005-05-05 Thread rickle
Bill and Jordan, thank you both kindly. I'm not too well versed in functions in python and that's exactly what I needed. I could see I was doing something wrong in my original attempt, but I didn't know how to correct it. It's working like a charm now, thank you both very much. -Rick -- http:/

Re: python and glut

2005-05-05 Thread max(01)*
Lonnie Princehouse wrote: > See if you can run `glxgears`, and read the output of `glxinfo`. If > neither of those work, you will probably have better luck on a debian > or XFree86/xorg forum than on c.l.py > your hints were helpful anyway. thanks! ok, i uncommented the line: Load "glx"

Re: annonymous functions -- how to

2005-05-05 Thread Bengt Richter
On Thu, 05 May 2005 07:45:33 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote: >Jason Mobarak wrote: >> What's wrong with: >> >> def blah(): >> def _ (a, b, c): >> a = a + 2 >> print "stmt 2" >> return a+b/c >> return doSomethingWith(_) >> >> It's basically "anonymous", it just uses

Re: dictionary comparison

2005-05-05 Thread Jordan Rastrick
rickle wrote: > I'm trying to compare sun patch levels on a server to those of what sun > is recommending. For those that aren't familiar with sun patch > numbering here is a quick run down. > > A patch number shows up like this: > 113680-03 > ^^ ^^ > patch# revision > > What I want to do is

Re: python and glut

2005-05-05 Thread max(01)*
Lonnie Princehouse wrote: > See if you can run `glxgears`, and read the output of `glxinfo`. $ glxgears Xlib: extension "GLX" missing on display ":0.0". Error: couldn't get an RGB, Double-buffered visual $ glxinfo name of display: :0.0 Xlib: extension "GLX" missing on display ":0.0". Xlib: exte

Re: Adding new methods to new-style classes dynamically

2005-05-05 Thread Jack Diederich
On Thu, May 05, 2005 at 01:35:09AM -0700, Max Derkachev wrote: > Good day to all. > > Some time ago I'd been playing with a framework which uses dynamic > class creation havily. Say, I could do: > > #well, try this with the new-style class > class A(object): > pass > > # the new-style __dic

Re: python and glut

2005-05-05 Thread max(01)*
Mike Meyer wrote: > "max(01)*" <[EMAIL PROTECTED]> writes: > > >>$ python GLE.py >>freeglut (GLE.py): OpenGL GLX extension not supported by display ':0.0' >> >>what's up? what's missing? > > > The GLX extension to your X server. > > >>i use a standard debian installation. > > > I don't know

Re: annonymous functions -- how to

2005-05-05 Thread Dave Benjamin
Peter Hansen wrote: > I doubt there's a valid usecase for a "anonymous" function that has more > than a line or two. Personally, I don't think there's a good usecase > for an anonymous function longer than one line... The case that I keep running into regards event-driven programming. I need t

Re: dictionary comparison

2005-05-05 Thread Bill Mill
On 5 May 2005 08:19:31 -0700, rickle <[EMAIL PROTECTED]> wrote: > I'm trying to compare sun patch levels on a server to those of what sun > is recommending. For those that aren't familiar with sun patch > numbering here is a quick run down. > > A patch number shows up like this: > 113680-03 > ^^^

Does the Python/C interface support Queue objects?

2005-05-05 Thread scott . manton
I'm a new user of the Python C interface. I would like to know if it is possible to put items on a standard python Queue object in C, and pop them from Python. Does the Python/C interface support Queue objects? A little background. I made a C dll that sets up a thread for collecting data from

Re: SWIG and Python incompatibilities?

2005-05-05 Thread adsheehan
Thanks Steve! appreciate the response. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie.......Python and Networking

2005-05-05 Thread phil
xeron wrote: > Thanks phil, I think I'll start off with your chat prog (UDP-- 50 lines > code ) and then try for routing and firewall scripts for linux, yepp > that would be really tough but why not give it a try, i am going to > have my vacations for like 13 days so will be preparing for my CCNA

Hard times with packages and instances

2005-05-05 Thread Kay Schluehr
Hi people, I wonder why the isinstance() function is sensitive about the import path i.e. the result depends not only on the class and the instance but also on how a class is imported? Example: MyPackage/ Top-level package __init__.py Initialize package

dictionary comparison

2005-05-05 Thread rickle
I'm trying to compare sun patch levels on a server to those of what sun is recommending. For those that aren't familiar with sun patch numbering here is a quick run down. A patch number shows up like this: 113680-03 ^^ ^^ patch# revision What I want to do is make a list. I want to show wha

Re: How to write this regular expression?

2005-05-05 Thread D H
Peter Hansen wrote: > could ildg wrote: > >> I need a regular expression to check if a string matches it. > > > Why do you think you need a regular expression? > > If another approach that involved no regular expressions worked much > better, would you reject it for some reason? > > -Peter A

Re: a cx_Oracle ORA-01036 problem

2005-05-05 Thread Damjan
vincent wehren wrote: > |c = db.cursor() > |c.execute(SQL, **args) > > > Shouldn't that be c.execute(SQL, args) (no **-unpacking of the > dictionary)? Actually I tried that too, I still get the same error. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: How To Reply

2005-05-05 Thread D H
phil wrote: > I get a digest several times a day. > When I wish to respond to an item I must > cut and paste the item and the subject line. > Is there something to click on for a simple reply? > Using an old mozilla mail. > Thanks > Perfectly valid question. Add an nntp connection in mozilla mail

Re: annonymous functions -- how to

2005-05-05 Thread D H
Peter Hansen wrote: > Jason Mobarak wrote: > >> What's wrong with: >> >> def blah(): >> def _ (a, b, c): >> a = a + 2 >> print "stmt 2" >> return a+b/c >> return doSomethingWith(_) >> >> It's basically "anonymous", it just uses a name that you don't care >> about. AFAIK, it can be

Re: Newbie.......Python and Networking

2005-05-05 Thread xeron
Thanks phil, I think I'll start off with your chat prog (UDP-- 50 lines code ) and then try for routing and firewall scripts for linux, yepp that would be really tough but why not give it a try, i am going to have my vacations for like 13 days so will be preparing for my CCNA and also learning pyth

Re: SWIG and Python incompatibilities?

2005-05-05 Thread Steve Juranich
On 5 May 2005 07:19:34 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi all, > > Has anyone experienced issues incompatible versions of the above? > On solaris, we are experiencing suspect crashes & memory leaks? > > How do I determine which versions are proven to be > compatible/incompat

  1   2   >