Spyce 2.0 beta

2005-05-05 Thread Jonathan Ellis
The beta of Spyce 2.0 is available at http://spyce.sourceforge.net/docs/get.html. Spyce is a python web application server, combining the features of popular frameworks such as JSP and ASP.NET with Pythonic elegance. Spyce may be deployed as a standalone server (or proxied behind Apache), or

Re: OOPS concept

2005-05-05 Thread km
Hi all, Well this doesnt explain new style classes. let me be more clear. is there any online tutorial/ recommended book which deals explicitly with object oriented programming in python? regards, KM --- Try this online

Re: If you use PayPal you might consider an alternative

2005-05-05 Thread Tim Roberts
Allan [EMAIL PROTECTED] wrote: If you used PayPal and are not satisifed with their service there is a new and better service opening. They will be starting up during the early summer this year. The best of all - signup is FREE. Check out their benefits: www.greenzap.com/benefits That web zite

Re: OOPS concept

2005-05-05 Thread monkey
Google, search. km [EMAIL PROTECTED] ??? news:[EMAIL PROTECTED] ???... Hi all, Well this doesnt explain new style classes. let me be more clear. is there any online tutorial/ recommended book which deals explicitly with object oriented programming in python? regards, KM

[wxPython] own maximize for wxMDIChildFrame - bugs?

2005-05-05 Thread w.p.
I use code below: 1) frame receive too many maximize events on create and on close child window - why? 2) how to catch key events for wxMDIParentFrame ? 3) childWin.SetSize() in OnMaximize send additional maximize event (?) 4) wxMDIChildFrame is initially visible! 5) sorry for english :) 6)

Re: Looking for Example of wxFontEnumerator Use

2005-05-05 Thread vincent wehren
weston [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] | Can anyone give an example of proper usage of wxFontEnumerator? In the wxPython Demo: wxPython Overview Miscellaneous FontEnumerator If you haven't downloaded the demo/docs yet, you should. You can get your version

Re: Determine ip address

2005-05-05 Thread ontiscal
http://checkip.tk/ codecraig ha scritto: hi, how can i use python to figure the ip address of the machine which the python script is running on? I dont mean like 127.0.0.1but i want the external IP address (such as ipconfig on windows displays). any ideas?? THanks --

Adding new methods to new-style classes dynamically

2005-05-05 Thread Max Derkachev
Good day to all. Some time ago I'd been playing with a framework which uses dynamic class creation havily. Say, I could do: class A: pass # I method name is dynamic meth_name = 'foo' #method code can also be dynamic - any executable object will be good enough func = lambda self:

Re: properties vs. eval()

2005-05-05 Thread Jason Mobarak
Why are you using eval in the first place? This isn't bash. Use setattr and getattr for dynamic attribute access. -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding new methods to new-style classes dynamically

2005-05-05 Thread Michele Simionato
Do you mean setattr? setattr(A, meth_name, lambda self: type(self)) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding new methods to new-style classes dynamically

2005-05-05 Thread John Machin
Max Derkachev wrote: [snip] #well, try this with the new-style class class A(object): pass # the new-style __dict__ is a dictproxy object A.__dict__[meth_name] = lambda self: type(self) Traceback (most recent call last): File interactive input, line 1, in ? TypeError: object does

Sockets

2005-05-05 Thread Dan
I have a problem and I don't quite know how to implement the solution. I'll have a server application that will listen on a tcp port and make many similtaneous connections to remote clients. From time to time, I'll need to write a small amount of data on one of those sockets. A notification

Strange behaviour of __cmp__

2005-05-05 Thread janeaustine50
See the following... class X(list): def __cmp__(self,anX): print comparing from,id(self) return cmp(self.v,anX.v) x1=X() x2=X() x1.v=-1 x2.v=100 x1x2 False x1x2 False I expected x1x2 or x1x2 were False and True respectively. --

Re: UnicodeDecodeError

2005-05-05 Thread Fredrik Lundh
Thomas Thomas wrote: filename=unicode(filename); #file = ('file', filename, data) #This won't work will give a UnicodeDecodeError: 'ascii' codec can't decode byte 0xc7 in position 10: ordinal not in range(128) there's no way the tuple creation will generate a UnicodeDecodeError all by

Re: Determine ip address

2005-05-05 Thread Mike Meyer
[Format recovered from top-posting.] [EMAIL PROTECTED] writes: codecraig ha scritto: how can i use python to figure the ip address of the machine which the python script is running on? I dont mean like 127.0.0.1but i want the external IP address (such as ipconfig on windows displays).

using variables with modules

2005-05-05 Thread marc . wyburn
Hi, I am trying to move away from Windows only scripting to Python. I've written a quick script that will pull the product version from the client registry. I can get the IP addresses from a file into a list and then pull each element in the list using the for loop. I am setting each element to

Re: Strange behaviour of __cmp__

2005-05-05 Thread Robert Kern
[EMAIL PROTECTED] wrote: See the following... class X(list): def __cmp__(self,anX): print comparing from,id(self) return cmp(self.v,anX.v) x1=X() x2=X() x1.v=-1 x2.v=100 x1x2 False x1x2 False I expected x1x2 or x1x2 were False and True

Re: Adding new methods to new-style classes dynamically

2005-05-05 Thread Max Derkachev
John Machin wrote: A.foo 123 Oh, I've been a little dumb to forget about it :) Thanks. Max. -- http://mail.python.org/mailman/listinfo/python-list

Re: using variables with modules

2005-05-05 Thread runes
The only problem I can see, is trailing whitespace from the ip.txt file. Perhaps ClientIP.strip() will help? -- http://mail.python.org/mailman/listinfo/python-list

Re: using variables with modules

2005-05-05 Thread runes
I tested your code and made a few changes: import _winreg import sys readfile = open(C:\scripts\ip.txt, 'r') IPList = readfile.readlines() for ClientIP in IPList: ClientIP = ClientIP.strip() ClientIP = r'\\' + ClientIP try: key = _winreg.ConnectRegistry(ClientIP,

Re: postgresql plpython bug

2005-05-05 Thread Mage
Jonathan Ellis wrote: First, you don't give enough context to see where your python code generates a timestamp, but in any case it's more of a limitation than a bug that plpython doesn't try to autoconvert certain datatypes. (Are you even returning a datetime class, or a string?) I gave

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-05 Thread Martijn Pieters
[SNIP me whining then cheering about level 13] Dan Bishop wrote: You mean there's a hint in that XML-RPC fault? No, there is a hint in level 12. Remember how you could manipulate the URL of the image of level 12 to get to the data file for that level. Now continue that manipulation and don't

Re: If you use PayPal you might consider an alternative

2005-05-05 Thread Martijn Pieters
Tim Roberts wrote: That web zite iz juzt too cutezy. I could never truzt it, even if I hadn't learned about it through a newzgroup zpam. And a quick Google shows you to be very right: http://www.greenzapscam.com/

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-05 Thread Martijn Pieters
Michael Spencer wrote: Dan Bishop wrote: You mean there's a hint in that XML-RPC fault? No - the hint is associated with another error message Assuming a web browser (firefox in my case) is being used. ;) I got no error message when I retrieved that URL with urllib and examined the result..

Re: annonymous functions -- how to

2005-05-05 Thread Peter Hansen
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 immediately clobbered later if need be.

Re: using variables with modules

2005-05-05 Thread marc . wyburn
thanks runes, that makes sense, time for me to go off and read some more about strip and try: Cheers, MW. -- http://mail.python.org/mailman/listinfo/python-list

[newbie] how to look up functions

2005-05-05 Thread slayer
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? --  BBS telnet://bbs.wretch.cc    

Re: [newbie] how to look up functions

2005-05-05 Thread Simon Brunning
On 05 May 2005 06:27:14 GMT, slayer [EMAIL PROTECTED] 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? http://www.google.com/search?q=python+documentation --

Re: problem in the compiler ?

2005-05-05 Thread Glauco Silva
So , I will try to explain ! I´m trying to modify a code that doesn´t belong to me. I thought that there was a bug in the compilation of Pmw.RadioSelect, but there wans't. I hadn't noticed that the code invoked the button of radioselect in another part of it. Now I simply took off the part of

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-05 Thread James Carroll
Och! Thanks for the hint! I actually guessed the answer of who to phone earlier in the day, but didn't have the capitolization correct... Damn! Great riddles! -Jim On 5/5/05, Martijn Pieters [EMAIL PROTECTED] wrote: [SNIP me whining then cheering about level 13] Dan Bishop wrote: You

Re: Sockets

2005-05-05 Thread Jp Calderone
On Thu, 05 May 2005 17:11:08 +0800, Dan [EMAIL PROTECTED] wrote: I have a problem and I don't quite know how to implement the solution. I'll have a server application that will listen on a tcp port and make many similtaneous connections to remote clients. From time to time, I'll need to write

Best way to convert a list into function call arguments?

2005-05-05 Thread bwooster47
I'm a newcomer to python - what is the best way to convert a list into a function call agruments? For example: list = (2005, 5, 5) date = datetime.date( list ) fails with: TypeError: function takes exactly 3 arguments (1 given) I assumed that since Python allows multiple assignments per

Re: Best way to convert a list into function call arguments?

2005-05-05 Thread Jeff Epler
Your question is answered in the tutorial: http://docs.python.org/tut/node6.html#SECTION00674 4.7.4 Unpacking Argument Lists The reverse situation occurs when the arguments are already in a list or tuple but need to be unpacked for a function call requiring separate positional

Re: OOPS concept

2005-05-05 Thread gene . tani
Chapter 5, Python in Nutshell: concise explanations of everythin' you need to know about inheritance, instantiation, method resolution, namespaces, class/instance methods, getting under the hood with special methods, whatever. I couldn't code without it: http://www.oreilly.com/catalog/pythonian/

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-05 Thread Dan Bishop
James Carroll wrote: Och! Thanks for the hint! I actually guessed the answer of who to phone earlier in the day, but didn't have the capitolization correct... Damn! Great riddles! I found the answer with a brute-force search (using /usr/share/dict/words). --

Re: ERP CRM in Python

2005-05-05 Thread pinky
Wolfgang Keller wrote: pinky wrote: download, doc, forum ; http://tinyerp.org Why not downloadable and printable PDF documentation instead of online-HTML. Because 1. we need interaction with contributors in our doc. 2. we write docs in the wiki: http://tinyerp.org/wiki We are writing

SWIG and Python incompatibilities?

2005-05-05 Thread adsheehan
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/incompatible etc? Thanks for helping. Alan --

a cx_Oracle ORA-01036 problem

2005-05-05 Thread Damjan
I'm using Python 2.4, cx_Oracle-4.1 on Linux with Oracle instant client 10.1.0.3. This is the sql string: SQL = insert into D.D_NOTIFY values (:CARDREF, :BANKKEY, :OK1, :OK2 \ :DEBTEUR, :DEBTDEN, to_date(:INVOICE_DATE,'DD.MM.YY'), to_date(:PAYMENT_DEADLINE,'DD.MM.YY'), :POINTS)

Re: a cx_Oracle ORA-01036 problem

2005-05-05 Thread vincent wehren
Damjan [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] | I'm using Python 2.4, cx_Oracle-4.1 on Linux with Oracle instant client | 10.1.0.3. This is the sql string: | | SQL = insert into D.D_NOTIFY values (:CARDREF, :BANKKEY, :OK1, :OK2 \ |:DEBTEUR, :DEBTDEN,

Re: wxPython custom list drawing?

2005-05-05 Thread Will McGugan
Ivan Voras wrote: Does wxPython (actually, the wx toolkit) support setting up ListCtrls or similar to allow custom element drawing? Something like generating an 'OnPaint()' event in which I could paint whatever I like in a listbox element. (example from some other toolkits) wx.VListBox

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/incompatible etc?

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

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 immediately clobbered later

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 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 regular

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

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 and

Re: SWIG and Python incompatibilities?

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

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

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 ^^ ^^

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 to do

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 which X debian uses,

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: snip #well, try this with the new-style class class A(object): pass # the new-style __dict__

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: extension

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 make a

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 a name that you don't

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 in

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 --

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 working

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: 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 Queue

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

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

[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

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

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 -- 3

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 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.10299

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 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

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 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')) ...

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 python

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.00103 -- 5

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 answered is

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 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 --

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.

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/ file

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,

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

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 out, the

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: 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 ^^ ^^ patch#

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 video card),

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 UnicodeDecodeErrorall 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 body =

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 =

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: 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 file =

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

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: 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 separated by

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 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 asking

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 there

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, etc.

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

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,

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: 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:

  1   2   >