Re: A new to Python question

2005-05-14 Thread Bernd Nawothnig
On 2005-05-14, M.E.Farmer wrote: > I explained what i meant in previous post there was nothing more than > just a discussion No. You claimed This will only create a tuple in memory But we just learned that this is not the case. > I have no real problem here just more of a sore point in style

Re: space saving retitle of thread

2005-05-14 Thread Mike Painter
Johnny Gentile wrote: > aa. I just added a second monitor and have over two feet of monitor as 1280 x 1024. Outlook expands this message and it still runs off the right side of the second monitor. -- http://mail.python.org/mailman/listinfo/python-list

Paranoider Deutschenmoerder kommt in Psychiatrie

2005-05-14 Thread zip . pritchard
Lese selbst: http://brandenburg.rz.fhtw-berlin.de/poetschke.html -- http://mail.python.org/mailman/listinfo/python-list

In search of prothon source

2005-05-14 Thread Alex
Since the DNS servers hosting prothon.org have stopped responding, the sole source of the source of prothon online that I can find has become inaccessable. I was wondering if anyone subscribed has a copy of the source for the last C version of prothon, and would be kind enough to post a copy o

Re: converting a set into a sorted list

2005-05-14 Thread MackS
Thank you for the pointer. I'll upgrade to 2.4. Best, Mack -- http://mail.python.org/mailman/listinfo/python-list

Re: A new to Python question

2005-05-14 Thread Fredrik Lundh
Bernd Nawothnig wrote: > > You're thinking you're passing the arguments as reference > > That is the way Fortran handles them: which is one of the things you really love when you link against underdocumented Fortran programs from C. ("is that parameter a scalar or an array? crash! oh, an array.

Re: pygame on win32, image.fromstring()

2005-05-14 Thread tlviewer
tlviewer wrote: > Next I'm going to load all 53 card resources into a list (array) of > strings, then write it out, pickled. That should smooth out loading the >game when I use 4-6 decks (Blackjack-21). # -*- coding: cp1252 -*- """ keywords: resource bitmap pickle description: pickle reso

Re: A new to Python question

2005-05-14 Thread Fredrik Lundh
M.E.Farmer wrote: > I said exactly what I meant, the parentheses around the values creates > a tuple that you have no reference to! repeating it doesn't make you right; no extra tuple is created, and the parens are part of the syntax: If the target is a target list enclosed in parentheses or

Re: Modifying a built-in function for logging purposes

2005-05-14 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I wonder if it is possible to change (temporarily) a built-in function > for logging purposes. > Let me explain: > I want to log all the 'open' operations, recording the file to be > opened, the "mode" (r/w/a...) and (possibly) the module which made the > call. import s

Re: Faster GUI text control

2005-05-14 Thread Fredrik Lundh
"none <"@bag.python.org> wrote: > > no, it would mean writing some python code. if all you need is a scrolling > > text list, you can simply use the code on this page: > > > > http://effbot.org/zone/wck-4.htm > > > > (see "A scrollable list view, with scrollbar support" and, optionally, > > t

Re: incorrect(?) shlex behaviour

2005-05-14 Thread M.E.Farmer
bill wrote: > Consider: > >>> import shlex > >>> shlex.split('$(which sh)') > ['$(which', 'sh)'] > > Is this behavior correct? It seems that I should > either get one token, or the list > ['$','(','which','sh',')'], > but certainly breaking it the way it does is > erroneous. > > Can anyone explain

Re: Exception question

2005-05-14 Thread Steven Bethard
Ron Adam wrote: > > Do exceptions that take place get stored in a stack or list someplace? [snip] > I know I can catch the error and store it myself with, > > except Exception, exc: > > or possibly, > > errlist = [] > errlist.append(sys.exc_info()) > > But what I want to know is do

stop

2005-05-14 Thread Johnny Gentile
Enough salvation for one day. -- http://mail.python.org/mailman/listinfo/python-list

Massenhafter Steuerbetrug durch auslaendische Arbeitnehmer

2005-05-14 Thread mal
Lese selbst: http://www.rp-online.de/public/article/nachrichten/wirtschaft/finanzen/deutschland/85815 -- http://mail.python.org/mailman/listinfo/python-list

Transparenz ist das Mindeste

2005-05-14 Thread dstamsta
Lese selbst: http://www.npd.de/npd_info/deutschland/2005/d0405-39.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Jesus said, "I am the way, the truth and the life: no one can come to the Father(God)(in Heaven), but by me." (John 14:6) This means that if you die without trusting in Jesus Christ as your Lord and Saviour you will die in your sins and be forever sepa

2005-05-14 Thread Bubba
I'm so glad you've decided what everyone believes "don freeman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > > http://www.gotquestions.org/sinners-prayer.html << I saw this site on a > > search directory. Great Resource! > > > > > C'mon, this is the 21st century. Nobody be

Re: converting a set into a sorted list

2005-05-14 Thread Brian Beck
Robert Kern wrote: > MackS wrote: > >> Dear all, >> >> I've got several large sets in my program. After performing several >> operations on these I wish to present one set to the user [as a list] >> sorted according to a certain criterion. Is there any direct way to do >> so? Or must I >> >> list

Re: converting a set into a sorted list

2005-05-14 Thread Terry Reedy
"MackS" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Can I somehow avoid doing this in two stages? Can I somehow avoid first > creating a long list only to immediately sort it afterwards? Yes, you could interatively extract and append the min of the set (selection sort), but th

Exception question

2005-05-14 Thread Ron Adam
I'm trying to understand exception handling better and have a question I haven't been able to find an answer too. Which probably means It won't work, but... Do exceptions that take place get stored in a stack or list someplace? For example in: try: try: try: riskyf

Please confirm (conf#8d26af0fb789e6023d272db682e0f9b4)

2005-05-14 Thread MQ Feedback
Thank you for your feedback. Due to high levels of spam and virus activity on this mailing list the message you sent (attached below) requires confirmation before it can be delivered. To confirm that you sent the message below, simply reply to this message, leaving the Subject line unchanged (yo

Re: converting a set into a sorted list

2005-05-14 Thread Robert Kern
MackS wrote: > Dear all, > > I've got several large sets in my program. After performing several > operations on these I wish to present one set to the user [as a list] > sorted according to a certain criterion. Is there any direct way to do > so? Or must I > > list = [] > > for item in set1: >

Re: Modifying a built-in function for logging purposes

2005-05-14 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi Greg, > thank for your replay, but I didn't succeed in any way. You must > consider however that I'm not a Python "expert"... > IMHO, it must be a script that change part of the interpreter, and > substitute a new module (py) in the place of the standard one (py or > p

Paranoider Deutschenmoerder kommt in Psychiatrie

2005-05-14 Thread admin
Lese selbst: http://brandenburg.rz.fhtw-berlin.de/poetschke.html -- http://mail.python.org/mailman/listinfo/python-list

converting a set into a sorted list

2005-05-14 Thread MackS
Dear all, I've got several large sets in my program. After performing several operations on these I wish to present one set to the user [as a list] sorted according to a certain criterion. Is there any direct way to do so? Or must I list = [] for item in set1: list.append(item) list.sort(...

Re: A new to Python question

2005-05-14 Thread Terry Reedy
"M.E.Farmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > But if the parens are just fluff then get rid of them, it is clearer * > at least to me * ;) While I find unnecessary parens on the right of '=' tolerable, I agree as to the style preference. Terry J. Reedy -- http:

Re: Multiple "cmp"s chained one after another

2005-05-14 Thread Peter Hansen
Volker Grabsch wrote: > Peter Hansen wrote: > >>Or just use the .timetuple() method on datetime objects and sort on the >>8th element of the 9-element tuple, which is the day-of-the-year. > > An interesting idea. But wouldn't sorting by (dd.month,dd.day) be more > effective? Depending on the me

space saving retitle of thread

2005-05-14 Thread Johnny Gentile
aa. -- http://mail.python.org/mailman/listinfo/python-list

Re: A new to Python question

2005-05-14 Thread M.E.Farmer
Ok I give up you have convinced me. Of what I am not sure ;) Anyway I have always viewed : a,b,c= (1,2,3) as unpacking a tuple and : (a,b,c) = (1,2,3) as creation of a tuple It was a false assumption, I have used Python for years and have never written an unpacking as: (a,b,c) = (1,2,3) I have alwa

Re: Jesus said, "I am the way, the truth and the life: no one can come to the Father(God)(in Heaven), but by me." (John 14:6) This means that if you die without trusting in Jesus Christ as your Lord and Saviour you will die in your sins and be forever separated from the love of God in a place called Hell. The Holy Bible descibes Hell as a place of eternal torment, suffering, pain and agony for all those who have rejected Jesus Christ. The good news is that you can be sure you are going to Heaven when this life is over if you allow Jesus Christ to save you today. Do not wait until later to be saved because you do not know exactly when you will die. [ Posted by: RonaldGrossi3848@yahoo.com on May 14, 2005 ] [ 2:52:09 pm ]

2005-05-14 Thread don freeman
> http://www.gotquestions.org/sinners-prayer.html << I saw this site on a > search directory. Great Resource! > C'mon, this is the 21st century. Nobody believes that silly story about God having a son anymore. Think about it. The original story is always the best. The sequel is always a com

Re: Multiple "cmp"s chained one after another

2005-05-14 Thread Volker Grabsch
vincent wehren wrote: > >| > If you don't care about the year, why not just "normalize" the year >| > to all be the same using the replace method of the date instance? >| >| That's a very bad idea. In my example, this would work, but in "reality" >| I don't sort datetime objects, of course! (Is th

Re: A new to Python question

2005-05-14 Thread M.E.Farmer
I explained what i meant in previous post there was nothing more than just a discussion I have no real problem here just more of a sore point in style for me. I feel that parens are quite overloaded and it can be confusing to newbies. But if the parens are just fluff then get rid of them, it is cle

Re: A new to Python question

2005-05-14 Thread Steven Bethard
M.E.Farmer wrote: >>They're both an UNPACK_SEQUENCE byte-code. > > I have dissed it myself ;) > My argument, if you can call it that, is that it is not clear that > Python is going to do a tuple unpacking here or not ! Hmm... Well, I wouldn't say that. I think it's quite clear that Python's do

Re: Modifying a built-in function for logging purposes

2005-05-14 Thread qwweeeit
Hi Greg, thank for your replay, but I didn't succeed in any way. You must consider however that I'm not a Python "expert"... IMHO, it must be a script that change part of the interpreter, and substitute a new module (py) in the place of the standard one (py or pyc). The standard module must be save

Re: A new to Python question

2005-05-14 Thread M.E.Farmer
>It actually is the same, and I don't think implicit or explicit is the >difference you should be citing here. Why not it is relevant and true that Python is doing an implicit unpacking of the values in that unnamed tuple. Quoting myself """It might be the "same" as no parens but it isn't very clea

Re: A new to Python question

2005-05-14 Thread Bengt Richter
On 14 May 2005 13:25:55 -0700, "M.E.Farmer" <[EMAIL PROTECTED]> wrote: >I said exactly what I meant, the parentheses around the values creates >a tuple that you have no reference to! It also has a side effect of I don't understand what you are saying, or meaning ;-) BTW, the function call has noth

Re: A new to Python question

2005-05-14 Thread Bengt Richter
On 14 May 2005 10:44:30 -0700, "M.E.Farmer" <[EMAIL PROTECTED]> wrote: [...] >Be sure to study up on namespaces, it will ease your Python woes. >Namespaces are the most fundamental part of Python that new users don't >understand. Namespace mastery will take you far. >Just remember there are only tw

Re: A new to Python question

2005-05-14 Thread Steven Bethard
Steven Bethard wrote: > > I don't know the implementation enough to know whether or not a tuple is > actually created when "b" and "c" are bound to their values, but I'd be > willing to bet that whatever happens to "(b, c)" is exactly the same as > what happens to "b, c". Some corroborating ev

Re: A new to Python question

2005-05-14 Thread Steven Bethard
M.E.Farmer wrote: > I said exactly what I meant, the parentheses around the values creates > a tuple that you have no reference to! It also has a side effect of > binding the names inside the tuple to a value and placing them in the > local namespace( implicit tuple unpacking ). It might be the "sa

Re: tkinter puzzler

2005-05-14 Thread Paul Rubin
Martin Franklin <[EMAIL PROTECTED]> writes: > I suspect you need to look at the columnconfigure / rowconfigure methods > of the container (toplevel or frame) Thanks, columnconfigure turned out to be the answer and Peter Otten's post showing how to use it was very informative. For some reason colu

incorrect(?) shlex behaviour

2005-05-14 Thread bill
Consider: >>> import shlex >>> shlex.split('$(which sh)') ['$(which', 'sh)'] Is this behavior correct? It seems that I should either get one token, or the list ['$','(','which','sh',')'], but certainly breaking it the way it does is erroneous. Can anyone explain why the string is being split t

Re: Modifying a built-in function for logging purposes

2005-05-14 Thread Greg Krohn
[EMAIL PROTECTED] wrote: > Hi all, > I wonder if it is possible to change (temporarily) a built-in function > for logging purposes. > Let me explain: > I want to log all the 'open' operations, recording the file to be > opened, the "mode" (r/w/a...) and (possibly) the module which made the > call.

Re: A new to Python question

2005-05-14 Thread M.E.Farmer
I said exactly what I meant, the parantheses around the values creates a tuple that you have no reference to! It also has a side effect of binding the names inside the tuple to a value and placing them in the local namespace. It might be the "same" but it isn't very clear. If you want a tuple make

Re: A new to Python question

2005-05-14 Thread M.E.Farmer
I said exactly what I meant, the parentheses around the values creates a tuple that you have no reference to! It also has a side effect of binding the names inside the tuple to a value and placing them in the local namespace( implicit tuple unpacking ). It might be the "same" as no parens but it is

Re: A new to Python question

2005-05-14 Thread Bengt Richter
On Sat, 14 May 2005 20:38:26 +0200, Bernd Nawothnig <[EMAIL PROTECTED]> wrote: > >> On 2005-05-14, M.E.Farmer wrote: > >> (x,y,dotp,sumx,maxv) = abc(x,y,dotp,sumx,maxv) >> This will only create a tuple in memory that has no name to reference >> it by! > >Maybe. But it does not seem to hurt. And I

Re: Multiple "cmp"s chained one after another

2005-05-14 Thread vincent wehren
"Volker Grabsch" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] | vincent wehren wrote: | > | > If you don't care about the year, why not just "normalize" the year | > to all be the same using the replace method of the date instance? | | That's a very bad idea. In my example, t

Re: Faster GUI text control

2005-05-14 Thread none
That's a good point about the amount of text available at once. As long as I could swap the visible section fast enough that might be a good solution. This will run mostly on Windows, but I'd like for it to be equally usable on Linux. -- http://mail.python.org/mailman/listinfo/python-lis

Re: Faster GUI text control

2005-05-14 Thread none
> > no, it would mean writing some python code. if all you need is a scrolling > text list, you can simply use the code on this page: > > http://effbot.org/zone/wck-4.htm > > (see "A scrollable list view, with scrollbar support" and, optionally, > the virtual data modifications under "Displ

Re: A new to Python question

2005-05-14 Thread Robert Kern
David wrote: > Thank you very much. Tulpes are really neat now that I've looked at > them. So after just fixing it, I changed it up and I would like to > show it off now. > > #! /usr/bin/python > #This program takes two vectors and multiplies them > #against a 10X10 array. It also then gives th

Re: Returning Date As String ?

2005-05-14 Thread Brian Beck
Peter Moscatt wrote: > I am wanting to return the system date using the following: > > date.today() > > How would I then convert this to a string ? Use the strftime method. The formatting directives are documented here: http://docs.python.org/lib/module-time.html Example: date.today().str

Modifying a built-in function for logging purposes

2005-05-14 Thread qwweeeit
Hi all, I wonder if it is possible to change (temporarily) a built-in function for logging purposes. Let me explain: I want to log all the 'open' operations, recording the file to be opened, the "mode" (r/w/a...) and (possibly) the module which made the call. After that the 'open' can carry on foll

Re: Jesus said, "I am the way, the truth and the life: no one can come to the Father(God)(in Heaven), but by me." (John 14:6) This means that if you die without trusting in Jesus Christ as your Lord and Saviour you will die in your sins and be forever separated from the love of God in a place called Hell. The Holy Bible descibes Hell as a place of eternal torment, suffering, pain and agony for all those who have rejected Jesus Christ. The good news is that you can be sure you are going to Heaven when this life is over if you allow Jesus Christ to save you today. Do not wait until later to be saved because you do not know exactly when you will die. [ Posted by: RonaldGrossi3848@yahoo.com on May 14, 2005 ] [ 2:52:09 pm ]

2005-05-14 Thread Do
Abuse reports to [EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple "cmp"s chained one after another

2005-05-14 Thread Volker Grabsch
Peter Hansen wrote: > > Or just use the .timetuple() method on datetime objects and sort on the > 8th element of the 9-element tuple, which is the day-of-the-year. An interesting idea. But wouldn't sorting by (dd.month,dd.day) be more effective? In other words: Does .timetuple() create a tuple,

Jesus said, "I am the way, the truth and the life: no one can come to the Father(God)(in Heaven), but by me." (John 14:6) This means that if you die without trusting in Jesus Christ as your Lord and Saviour you will die in your sins and be forever separated from the love of God in a place called Hell. The Holy Bible descibes Hell as a place of eternal torment, suffering, pain and agony for all those who have rejected Jesus Christ. The good news is that you can be sure you are going to Heaven when this life is over if you allow Jesus Christ to save you today. Do not wait until later to be saved because you do not know exactly when you will die. [ Posted by: RonaldGrossi3848@yahoo.com on May 14, 2005 ] [ 2:52:09 pm ]

2005-05-14 Thread RonaldGrossi3848
http://www.gotquestions.org/sinners-prayer.html << I saw this site on a search directory. Great Resource! -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple "cmp"s chained one after another

2005-05-14 Thread Volker Grabsch
vincent wehren wrote: > > If you don't care about the year, why not just "normalize" the year > to all be the same using the replace method of the date instance? That's a very bad idea. In my example, this would work, but in "reality" I don't sort datetime objects, of course! (Is there any real a

Re: A new to Python question

2005-05-14 Thread Philippe C. Martin
Yes, I gathered. We all get our habits from somewhere :-) Regards, Philippe Bernd Nawothnig wrote: > On 2005-05-14, Philippe C. Martin wrote: > >> You're thinking you're passing the arguments as reference > > That is the way Fortran handles them: > > [...] > >>> Right now I'm taking a simp

Re: sockets don't play nice with new style classes :(

2005-05-14 Thread Skip Montanaro
Paul> It seems to me that the socket module itself should be rewritten Paul> to use new style classes, so that socket.socket objects can extend Paul> _socket.socket instead of wrapping them. Paul> Am I missing something? Probably not. The socket module could use some attention.

Re: Multiple "cmp"s chained one after another

2005-05-14 Thread Volker Grabsch
Steven Bethard wrote: > Robert Kern wrote: > def mykey(d): > return (d.month, d.day) > > The point here is that rather than chaining cmp() calls with ors, you > should just use a tuple -- the standard comparison order in tuples is > exactly what you're looking for. That's an excel

Re: A new to Python question

2005-05-14 Thread Bernd Nawothnig
> On 2005-05-14, M.E.Farmer wrote: > (x,y,dotp,sumx,maxv) = abc(x,y,dotp,sumx,maxv) > This will only create a tuple in memory that has no name to reference > it by! Maybe. But it does not seem to hurt. And I am not sure the tupel _is_ really created in that situation. > How would you access the

Re: A new to Python question

2005-05-14 Thread David
Hmm don't know what happened. I guess the formatting got all chewed up. -- http://mail.python.org/mailman/listinfo/python-list

Re: A new to Python question

2005-05-14 Thread David
Thank you very much. Tulpes are really neat now that I've looked at them. So after just fixing it, I changed it up and I would like to show it off now. #! /usr/bin/python #This program takes two vectors and multiplies them #against a 10X10 array. It also then gives the dot product, #sum, and ma

Re: A new to Python question

2005-05-14 Thread Steven Bethard
M.E.Farmer wrote: > (x,y,dotp,sumx,maxv) = abc(x,y,dotp,sumx,maxv) > This will only create a tuple in memory that has no name to reference > it by! Huh? This binds the names "x", "y", "dotp", "sumx" and "maxv" to the values returned by abc: py> def abc(*args): ... return args ... py> (x,y,d

Re: A new to Python question

2005-05-14 Thread M.E.Farmer
(x,y,dotp,sumx,maxv) = abc(x,y,dotp,sumx,maxv) This will only create a tuple in memory that has no name to reference it by! How would you access the returned value? If you want a tuple you need to assign all the return vales to a single name. mytup = abc(x,y,dotp,sumx,maxv) M.E.Farmer -- http://m

Re: A new to Python question

2005-05-14 Thread M.E.Farmer
David wrote: > Hi I'm trying to teach myself python and so far to good, but I'm having > a bit of trouble getting a function to work the way I think it should > work. Right now I'm taking a simple program I wrote in Fortran and > trying to do it in Python. I got it to work, but now I'm trying to

Re: pygame on win32, image.fromstring()

2005-05-14 Thread tlviewer
"Greg Krohn" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > tlviewer wrote: > > hello, > > hi > > > fp = open( "e:/batch/python/aceclub.bmp", "wt") > > wt? Should this be wb? > > > # gives: ValueError: String length does not equal format and resolution size > > img = gm.image.fromst

Re: A new to Python question

2005-05-14 Thread Bernd Nawothnig
On 2005-05-14, Philippe C. Martin wrote: > You're thinking you're passing the arguments as reference That is the way Fortran handles them: [...] >> Right now I'm taking a simple program I wrote in Fortran Bernd -- Those who desire to give up freedom in order to gain security, will not hav

Re: Python Documentation (should be better?)

2005-05-14 Thread kaerbuhez
bruno modulix a écrit : > > I fail to see why would it would be better to have to open a browser, go > to python.org, go to the doc, find the right link etc instead of just > typing dir(xxx) and/or help(xxx). > I fully agree with you. I just suspect that you are not more than me a web develo

Re: A new to Python question

2005-05-14 Thread Philippe C. Martin
Hi, You're thinking you're passing the arguments as reference (look at mutable vs non-mutable) Your function returns the values in a tupple (x,y,...); you need to fetch the values from that tupple Regards, Philippe David wrote: > Hi I'm trying to teach myself python and so far to good, bu

Re: A new to Python question

2005-05-14 Thread Bernd Nawothnig
On 2005-05-14, David wrote: > abc(x,y,dotp,sumx,maxv) (x,y,dotp,sumx,maxv) = abc(x,y,dotp,sumx,maxv) Bernd -- Those who desire to give up freedom in order to gain security, will not have, nor do they deserve, either one. [T. Jefferson] -- http://mail.python.org/mailman/listinfo/python-list

A new to Python question

2005-05-14 Thread David
Hi I'm trying to teach myself python and so far to good, but I'm having a bit of trouble getting a function to work the way I think it should work. Right now I'm taking a simple program I wrote in Fortran and trying to do it in Python. I got it to work, but now I'm trying to modularize it. My fo

Anyway to designating the encoding of the "source" for compile?

2005-05-14 Thread janeaustine50
Python's InteractiveInterpreter uses the built-in compile function. According to the ref. manual, it doesn't seem to concern about the encoding of the source string. When I hand in an unicode object, it is encoded in utf-8 automatically. It can be a problem when I'm building an interactive enviro

Quick Reference from module doc strings.

2005-05-14 Thread Ron Adam
Does anyone have suggestions on how to improve this further? Cheers, Ron_Adam def getobjs(object, dlist=[], lvl=0, maxlevel=1): """ Retrieve a list of sub objects from an object. """ if object not in dlist: dlist.append(object) if lvl200: s = object[0:

Re: Python 2.4 & BLT ?

2005-05-14 Thread Ron Adam
StepH wrote: >> >> A little googling found the following which may give you a clue or >> ideas of further searches. Also run a virus scanner on the file >> before hand. >> >> http://www.noteworthysoftware.com/composer/faq/90.htm > > > Argg... I always find me stupid when i don't have find my

Re: Multiple "cmp"s chained one after another

2005-05-14 Thread Steven Bethard
Robert Kern wrote: > I find that using the "key" argument to sort is much nicer than "cmp" > for these tasks. > > In [5]:L = [datetime.date(2005,5,2), datetime.date(1984,12,15), > datetime.date(1954,1,1)] > > In [7]:L.sort(key=lambda x: (x.month, x.day)) > > In [8]:L > Out[8]: > [datetime.date

Re: Encryption with Python?

2005-05-14 Thread Philippe C. Martin
Hi, I am a very happy user of http://www.amk.ca/python/code/crypto.html Regards, Philippe 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 fil

Re: Build-in or user-defined exceptions?

2005-05-14 Thread Peter Hansen
Torsten Bronger wrote: > I write a module, and so I must raise exceptions at several points. > The PEP 8 says that a module should define their own exceptions base > class, derived from "Exception", and derivatives of that. > > However, the build-in exceptions cover most of the error types that >

Re: Multiple "cmp"s chained one after another

2005-05-14 Thread Peter Hansen
vincent wehren wrote: > "Volker Grabsch" <[EMAIL PROTECTED]> schrieb im > Newsbeitrag news:[EMAIL PROTECTED] > | However, I don't want to sort them the default way. These are birthdays, > | so only the month and day do matter, not the year. E.g.: > | ... > If you don't care about the year, why not

Re: Build-in or user-defined exceptions?

2005-05-14 Thread Fredrik Lundh
Torsten Bronger wrote: > Is it considered good style to raise build-in exceptions whereever > one thinks it's appropriate? yes. > Is the definition of module exceptions derived from "IOError", "TypeError" > etc. a good idea? sure (when absolutely necessary). > Is there some sort of style guide

Re: function with variable arguments

2005-05-14 Thread Harald Schmidt
Xah Lee wrote: > I think it would be a improvement for the built-in range() so that step > needs not be an integer. [...] > > Range( 5, 7, 0.3); # returns [5, 5.3, 5.6, 5.9, 6.2, 6.5, 6.8] This may not return what you expect it to return. For example let's use a naive implementation like this:

Re: A question about inheritance

2005-05-14 Thread arserlom
Ok, thanks. I didn't know about new-style classes (I had learned python from a book prior to them). After reading about new-style classes, I find that your solution is better because, using super (in general) avoids cl2 from having to know the implementation details of cl1. This is clearly explai

Re: replace text in unicode string

2005-05-14 Thread John Machin
On 14 May 2005 02:23:55 -0700, "Dan Bishop" <[EMAIL PROTECTED]> wrote: >Svennglenn wrote: >> I'm having problems replacing text in a >> unicode string. >> Here's the code: >> >> # -*- coding: cp1252 -*- >> >> titel = unicode("ä", "iso-8859-1") To the OP: This is not causing the later problem, but

Build-in or user-defined exceptions?

2005-05-14 Thread Torsten Bronger
HallÃchen! I write a module, and so I must raise exceptions at several points. The PEP 8 says that a module should define their own exceptions base class, derived from "Exception", and derivatives of that. However, the build-in exceptions cover most of the error types that occur in a standard pro

Re: win32com and apache and permissions

2005-05-14 Thread Chris Curvey
found the answer five minutes after posting the question. Isn't that always the way? I had not granted the Apache user permission to launch IE. To do so: * launch DCOMCNFG.exe * choose "internet explorer" and click "properties" * choose the "security" tab and and "custom launch permissions" * "

problem uploading ZIP file tp PyPI

2005-05-14 Thread John Machin
Sorry in advance if this is not the correct forum ... I'm trying to upload what appears to be a perfectly OK zip file as a "source" file type to PyPI, and am getting this response: Error... There's been a problem with your request exceptions.ValueError: invalid distribution file I have managed

win32com and apache and permissions

2005-05-14 Thread Chris Curvey
I'm trying to have a Python script (which is being launched by Apache as a CGI) control Internet Explorer. I have this working on my development box, but when I moved the code to my integration test box, I get "Access Denied" when trying to launch IE. This only seems to happen when running Apache

Re: Multiple "cmp"s chained one after another

2005-05-14 Thread Robert Kern
Volker Grabsch wrote: > Hello! > > Ich just found a very nice 'pythonic' solution for an often appearing > problem. I didn't find it documented anywhere, so I'm posting it here. > If this isn't new in any way, I'd really like to get to know it. > > Example problem: > I have some "datetime" object

Re: function with variable arguments

2005-05-14 Thread tiissa
Xah Lee wrote: > on a related topic, > I think it would be a improvement for the built-in range() so that step > needs not be an integer. There are easy workarounds but I'd find it useful as well. > Further, it'd be better to support decreasing range. e.g. > > Range( 5, 7, 0.3); # returns [5, 5.

Re: wxTimer problem

2005-05-14 Thread F. GEIGER
As Jp asked already: "indepenedent" from what? I do such things all the time in a wx-App that controls a 6-axes robot. For example, there I have a LED-Widget for displaying the actual pos. and orient. of the tool. In a wxTimer handler I read OPC variables, whose values are displayed in the LED-Wid

Re: Importing modules

2005-05-14 Thread jmdeschamps
CONTEXT: Trying to modularize (is this english?) application development : MVC style, team distributed so that a visual component can be in one module imported and used by the __main__, and connected (read packed) at runtime to other components coming from the main or other modules. PROBLEM: Afte

Re: Multiple "cmp"s chained one after another

2005-05-14 Thread vincent wehren
"Volker Grabsch" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] | Hello! | | Ich just found a very nice 'pythonic' solution for an often appearing | problem. I didn't find it documented anywhere, so I'm posting it here. | If this isn't new in any way, I'd really like to get to

Modifying CallTips.py to work with with new-style classes in IDLE.

2005-05-14 Thread arserlom
When using Idle, Call Tips are floating windows which display function, class, and method parameter and docstring information when you type an opening parenthesis, and which disappear when you type a closing parenthesis. But when you use new-style classes, they don't work fine and don't show the a

Re: 80 bit precision ?

2005-05-14 Thread chris
"km" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > does python currently support 80 bit precision Floating Point Unit ? > > regards, > KM I've just been using the decimal module for Python 2.3 (native in Python 2.4) at 100 digit precision to solve some very high order

Re: Returning Date As String ?

2005-05-14 Thread Roy Smith
Peter Moscatt <[EMAIL PROTECTED]> wrote: > I am wanting to return the system date using the following: > > date.today() > > How would I then convert this to a string ? > > Pete datetime.data objects have a __str__() method. To convert one to a string, you just have to cause its __str__

Re: Python 2.4 & BLT ?

2005-05-14 Thread StepH
Ron Adam a écrit : > StepH wrote: > >> Ron Adam a écrit : >> >>> StepH wrote: >>> >>> Ron Adam a écrit : > StepH wrote: > > > >> Hi, >> >> I'm not able to install BLT on my Python 2.4 (upgraded to 2.4.1) >> distibution... >> >> I'v try to dow

Python on a public library computer

2005-05-14 Thread [EMAIL PROTECTED]
Here's my situation: I'm typing this in a public library on a computer with OS windows 2000 server. I can run Internet explorer, word, excel and powerpoint, that's it. Maybe java, but it seems to be flaky. I want to run python scripts from this computer. At home I have a multi-computer network (f

Re: Returning Date As String ?

2005-05-14 Thread [EMAIL PROTECTED]
if you're using date.today(): x=date.today() -- http://mail.python.org/mailman/listinfo/python-list

Returning Date As String ?

2005-05-14 Thread Peter Moscatt
I am wanting to return the system date using the following: date.today() How would I then convert this to a string ? Pete -- http://mail.python.org/mailman/listinfo/python-list

Re: function with variable arguments

2005-05-14 Thread Xah Lee
Thanks to all for the reply. (i should've known better) on a related topic, I think it would be a improvement for the built-in range() so that step needs not be an integer. Further, it'd be better to support decreasing range. e.g. Range( 5, 7, 0.3); # returns [5, 5.3, 5.6, 5.9, 6.2, 6.5, 6.8] Ran

Multiple "cmp"s chained one after another

2005-05-14 Thread Volker Grabsch
Hello! Ich just found a very nice 'pythonic' solution for an often appearing problem. I didn't find it documented anywhere, so I'm posting it here. If this isn't new in any way, I'd really like to get to know it. Example problem: I have some "datetime" objects and want to sort them, as here:

Re: 80 bit precision ?

2005-05-14 Thread Sébastien Boisgérault
Terry Reedy a écrit : > [...] > Last I read, in CPython, the float type encapsulates a C double. > So, does any C compiler implements doubles as 80 bit floats? I seriously doubt it. > Or, if it has 64 bit > doubles and 80 bit long doubles, are the latter transparently > substitutible for the form

Re: replace text in unicode string

2005-05-14 Thread Dan Bishop
Svennglenn wrote: > I'm having problems replacing text in a > unicode string. > Here's the code: > > # -*- coding: cp1252 -*- > > titel = unicode("ä", "iso-8859-1") > print titel > print type(titel) > > titel.replace("ä", "a") > > When i run this program I get this error: > > titel.replace("ä",

  1   2   >