Re: subexpressions (OT: math)

2007-06-03 Thread Leonhard Vogt
>> Yes, I understand that, but what is the geometrical >> meaning of the square root of an arc length? > > That's a different question to your original question, which was asking > about the square root of an angle. > >> And what would the units be? > > Angles are a ratio of two lengths, and

Re: How to control the creation of an instance?

2007-06-03 Thread 7stud
On Jun 3, 12:50 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 02 Jun 2007 23:25:49 -0700, 7stud wrote: > > Oops. This line: > > >> temp = object.__new__(Sample, args, kwds) > > > should be: > > > temp = object.__new__(cls, args, kwds) > > > although it would seem that cls is always goin

getting rid of leading zeros in float expotential

2007-06-03 Thread tom
Hi! I'm wondering whether there's an easy way to remove unnecessary leading zeros from my floating point number. realS = float(-1.25e-5) imgS = float(-7.6e4) print complex(realS, imgS) >> (-1.25e-005-76000j) I would like it to look like (-1.25e-5-76000j) -- http://mail.python.org/mailman/lis

Re: M2Crypto-0.17 blocks python threads?

2007-06-03 Thread John Nagle
Heikki Toivonen wrote: > [EMAIL PROTECTED] wrote: > >>I am having a problem with python threads and M2Crypto. It appears >>the M2Crypto used in multi-thread application blocks other threads >>from running: > > > This turned into https://bugzilla.osafoundation.org/show_bug.cgi?id=9401 > > Thank

Re: Python 2.5.1 broken os.stat module

2007-06-03 Thread Martin v. Löwis
> The short explaination of this issue is that the timestamp shown when > you do a dir on a file that is on an NTFS volume changes by an hour > when DST starts and also when DST ends, even though the file has NOT > been modified!!! Note that this only happens if you have the setting > turned on to

Re: Python rocks

2007-06-03 Thread Hendrik van Rooyen
"Mark Carter" <[EMAIL PROTECTED]> wrote: > Josiah Carlson wrote: > > What kind of scoping did you desire? > > Well, I had in mind so that if you defined a function, but wanted to > access a global var, that you didn't have to use the global keyword. Not > much of a biggie, I guess. You can ac

Re: Python rocks

2007-06-03 Thread Mark Carter
Alex Martelli wrote: > Mark Carter <[EMAIL PROTECTED]> wrote: > Yes, GMP is a pain to compile (especially on Mac OS X), but I believe > Just mentioning this in case you want to give Scheme another chance Thanks. I'll take a look at it. I think I've decided to finish off my little in project in

Re: Python rocks

2007-06-03 Thread Mark Carter
Alex Martelli wrote: > Josiah Carlson <[EMAIL PROTECTED]> wrote: > >>> pitfall of Python is knowing whether an operation is destructive or not. >> If it returns None, it probably changes the content of an object. > > A reasonable heuristic, but with lots of exceptions, alas: > somedict.get(so

Re: Trouble killing a process on windows

2007-06-03 Thread Tim Golden
Thomas Nelson wrote: [... re Access Denied error on trying to TerminateProcess ...] [Tim Golden] >> I suppose you might have to adjust your token privs to include, >> say the Debug priv. This is designed to let you take control >> of any process (and terminate it, or whatever). If it looks >> lik

Re: subexpressions (OT: math)

2007-06-03 Thread Steven D'Aprano
On Sun, 03 Jun 2007 09:02:11 +0200, Leonhard Vogt wrote: >> Angles are a ratio of two lengths, and are therefore dimensionless units. >> So the square root of an angle is just another angle, in the same units, >> and it requires no special geometric interpretation: the square root of 25 >> degree

ANN: eric4 4.0.0 release

2007-06-03 Thread Detlev Offenbach
Hi, I am proud to announce the availability of the first official release of eric4. eric4 is the successor of the well known eric3 Python development environment. What is eric4? -- eric4 is an Integrated Development Environment for the Python (and Ruby) language. It comes with all bat

Re: How to control the creation of an instance?

2007-06-03 Thread KingMax
On Jun 3, 2:17 pm, 7stud <[EMAIL PROTECTED]> wrote: > On Jun 2, 10:31 pm, lialie <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > suppose i have a free_object list[Sample1, Smaple2]. when create a > > new object sample(*args, **kwds), if free_object_list isn't empty, just > > pop one from free_ob

Lindsay Lohan jessica Alba Scarlett Johansson

2007-06-03 Thread Christina Aguilera
Lindsay Lohan jessica Alba Scarlett Johansson Christina Aguilera www.alphasearch.gr-- http://mail.python.org/mailman/listinfo/python-list

Re: c[:]()

2007-06-03 Thread [EMAIL PROTECTED]
On 30, 22:48, "Warren Stringer" <[EMAIL PROTECTED]> wrote: > I want to call every object in a tupple, like so: > > #-- > def a: print 'a' > def b: print 'b' > c = (a,b) > > >>>c[:]() # i wanna > > TypeError: 'tupple' object is not callable > > >>>c[0]()

Re: Python 2.5.1 broken os.stat module

2007-06-03 Thread Joe Salmeri
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> The short explaination of this issue is that the timestamp shown when >> you do a dir on a file that is on an NTFS volume changes by an hour >> when DST starts and also when DST ends, even though the file has NOT >>

Re: c[:]()

2007-06-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > On 30, 22:48, "Warren Stringer" <[EMAIL PROTECTED]> wrote: >> I want to call every object in a tupple, like so: >> >> #-- >> def a: print 'a' >> def b: print 'b' >> c = (a,b) >> >> >>>c[:]() # i wanna >

Why Python?

2007-06-03 Thread Chris Stewart
What is it about Python that makes it such a suitable language for you? For instance, why would you use it over something similarly portable as Java, or PHP? I know personally, in my small exposure to Python, I can see it as a great learning tool for a basic introduction to programming and even

Re: c[:]()

2007-06-03 Thread [EMAIL PROTECTED]
On 3, 18:44, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, > > >bla-bla-bla > > it is easy to read and understandable. > > And has the same issue as a list comprehension if all you want is the side > effect of the calls: a useless temporary list full of `None`\s

Re: Python rocks

2007-06-03 Thread Alex Martelli
Mark Carter <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > >>> pitfall of Python is knowing whether an operation is destructive or not. > >> If it returns None, it probably changes the content of an object. > > > > A reasonable heuristic, bu

Re: Python rocks

2007-06-03 Thread Alex Martelli
Mark Carter <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > Mark Carter <[EMAIL PROTECTED]> wrote: > > > Yes, GMP is a pain to compile (especially on Mac OS X), but I believe > > > Just mentioning this in case you want to give Scheme another chance > > Thanks. I'll take a look at it. You

Re: Why Python?

2007-06-03 Thread Mohammad Tayseer
Why you should use Python http://spellcoder.com/blogs/tayseer/archive/2007/04/08/why_you_should_use_python.aspx Chris Stewart <[EMAIL PROTECTED]> wrote: What is it about Python that makes it such a suitable language for you? For instance, why would you use it over something similarly portable a

Re: Python rocks

2007-06-03 Thread George Sakkis
On Jun 2, 4:58 pm, [EMAIL PROTECTED] (Aahz) wrote: > In article <[EMAIL PROTECTED]>, > George Sakkis <[EMAIL PROTECTED]> wrote: > > > > >I had probably stumbled on many/most of the common pitfalls usually > >mentioned (e.g.http://www.ferg.org/projects/python_gotchas.html, > >http://zephyrfalcon.o

Python 2.5 and stdin

2007-06-03 Thread hg
Hi, I have upgraded to 2.5 and one of my program no longre functions: In a thread run function, I attempts to get a "raw_input('')" and get the error *** Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python2.5/threading.py", line

Re: Why Python?

2007-06-03 Thread Arsham Shirvani
What is it about Python that makes it such a suitable language for you? For instance, why would you use it over something similarly portable as Java, or PHP? I know personally, in my small exposure to Python, I can see it as a great learning tool for a basic introduction to programming a

Re: getting rid of leading zeros in float expotential

2007-06-03 Thread [EMAIL PROTECTED]
On 3, 11:47, [EMAIL PROTECTED] wrote: > Hi! I'm wondering whether there's an easy way to remove unnecessary > leading zeros from my floating point number. > > realS = float(-1.25e-5) > imgS = float(-7.6e4) > > print complex(realS, imgS) > > >> (-1.25e-005-76000j) > > I would like it to look li

Re: subexpressions (OT: math)

2007-06-03 Thread [EMAIL PROTECTED]
On 3, 14:05, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 03 Jun 2007 09:02:11 +0200, Leonhard Vogt wrote: > >> bla-bla > > Hmmm... perhaps that's why the author of the "units" program doesn't > treat angles as dimensionless when taking square roots. > > Given that, I withdraw my claim

Re: Python 2.5.1 broken os.stat module

2007-06-03 Thread Terry Reedy
"Joe Salmeri" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | ""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message | news:[EMAIL PROTECTED] | >> The short explaination of this issue is that the timestamp shown when | >> you do a dir on a file that is on an NTFS volume changes by

Re: Python 2.5.1 broken os.stat module

2007-06-03 Thread Martin v. Löwis
> It appears that you may have missed part of my tests. Sorry it was such a > long reply but I was trying to provide a lot of detail so that others had a > clear understanding of what was going on. Please understand that it is *extremely* tedious to follow your messages. It would have been much

Re: int vs long

2007-06-03 Thread jay
Hi Dan, Paul, and Kaens, Thanks very much for replying to my question. I appreciate you all taking the time to answer this for me! Jay > On 02 Jun 2007 20:18:02 -0700, Paul Rubin > <"http://phr.cx"@nospam.invalid> wrote: >> Dan Bishop <[EMAIL PROTECTED]> writes: >> > Note that recent versio

Re: subexpressions (OT: math)

2007-06-03 Thread Gary Herron
[EMAIL PROTECTED] wrote: > On 3, 14:05, Steven D'Aprano <[EMAIL PROTECTED]> > wrote: > >> On Sun, 03 Jun 2007 09:02:11 +0200, Leonhard Vogt wrote: >> bla-bla >> Hmmm... perhaps that's why the author of the "units" program doesn't >> treat angles as dimensionless when

Re: Cookie: Not understanding again

2007-06-03 Thread mosscliffe
On 2 Jun, 11:50, David Wahler <[EMAIL PROTECTED]> wrote: > On Jun 2, 9:32 am, mosscliffe <[EMAIL PROTECTED]> wrote: > > > David, > > > Thanks for your help. > > > I spent all last night trying to get it to work, but I can not work > > out how to force mycookieinto the response header. The most > >

Re: subexpressions (OT: math)

2007-06-03 Thread [EMAIL PROTECTED]
On 3, 21:43, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > angle is dimensionless unit. > > Of course not! Angles have units, commonly either degrees or radians. > > However, sines and cosines, being ratios of two lengths, are unit-less.> To > understand it: sin() ca

Check for descriptors (in C)

2007-06-03 Thread Gabriel Genellina
For most types, there are macros like PyXxxx_Check and PyXxxx_CheckExact. But not for descriptors, and I want to test if a certain object is a descriptor or not. May I define PyMethodDescr_Check, by example, along the lines of similar checks, or the fact that they are not already defined implies th

Re: subexpressions (OT: math)

2007-06-03 Thread [EMAIL PROTECTED]
On 3, 22:07, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > angle is a ratio of two length and > dimensionless.http://en.wikipedia.org/wiki/Angle#Units_of_measure_for_angles > > only dimensionless values can be a argument of a sine and exponent! > Are you discordant? if you are discordant

Re: int vs long

2007-06-03 Thread Dan Bishop
On Jun 2, 11:55 pm, kaens <[EMAIL PROTECTED]> wrote: > On 02 Jun 2007 20:18:02 -0700, Paul Rubin > > <"http://phr.cx"@nospam.invalid> wrote: > > Dan Bishop <[EMAIL PROTECTED]> writes: > > > Note that recent versions of Python automatically promote the results > > > of integer arithmetic to long if

Re: int vs long

2007-06-03 Thread Paul Rubin
Dan Bishop <[EMAIL PROTECTED]> writes: > If you ever do, it's trivial to write your own enumerate(): > def enumerate(seq): > index = 0 > for item in seq: > yield (index, item) > index += 1 That's a heck of a lot slower than the builtin, and if you're running it often enough

Is 1 large Regex faster than 3 smaller ones?

2007-06-03 Thread erikcw
Hi, I need to match 3 small strings in a small text file (about 200 words of text). Would it be faster to write 1 compiled regex that matches all 3 substrings in one go, or to use 3 separate regular expressions to do the same job? Thanks! Erik -- http://mail.python.org/mailman/listinfo/python-

Re: monitoring the filesystem for changes

2007-06-03 Thread rohit
hello well in my implementation of readdirectorychangesw i am using threading that is multiple programs run simultaneously each program monitoring one drive for changes. is their a way around this...one program for all drives? thanks rohit -- http://mail.python.org/mailman/listinfo/python-list

Re: iterblocks cookbook example

2007-06-03 Thread Steve Howell
--- Raymond Hettinger <[EMAIL PROTECTED]> wrote: > ISTM, this is a common mailing list problem because > it is fun > to solve, not because people actually need it on a > day-to-day basis. > It comes up in the real world for me once very couple months or so. It's usually when I need to manipulate

MoinMoin configuration

2007-06-03 Thread kyosohma
Hi, I am working on a new site about Python to help document some of the modules that don't have much for documentation. Anyway, I chose to use MoinMoin because it has very easy-to-use code display with line numbers that toggle on and off. The question I have is how do I configure MoinMoin to for

Re: monitoring the filesystem for changes

2007-06-03 Thread Tim Golden
rohit wrote: > hello > well in my implementation of readdirectorychangesw i am using > threading that is multiple programs run simultaneously each program > monitoring one drive for changes. > is their a way around this...one program for all drives? > thanks You could use the ReadDirectoryChangesW

how can I get the name of a method inside it?

2007-06-03 Thread \"S�bastien Vincent\"
I would like to know if it's possible to retrieve the name of a method when you're inside it. For example, in the following script, I would like to assign _s so that it prints "you are in method1". *** class Obj1: def __init__(self): ... def

Re: Detecting an active exception

2007-06-03 Thread Nick Craig-Wood
NeBlackCat <[EMAIL PROTECTED]> wrote: > I've now also looked at this from a traceback and stack frame walking > perspective as well and it seems impossible, ie. it see,s impossible to > create a function AmIHandlingAnException() which would behave as follows: > >try: >a=a+1 >e

Re: how can I get the name of a method inside it?

2007-06-03 Thread montyphyton
> I would like to know if it's possible to retrieve the name of a method when > you're inside it. For example, in the following script, I would like to > assign _s so that it prints "you are in method1". > > > *** > class Obj1: > def __init__(self): >

Re: how can I get the name of a method inside it?

2007-06-03 Thread Alex Martelli
"Sébastien Vincent" wrote: > I would like to know if it's possible to retrieve the name of a method when > you're inside it. For example, in the following script, I would like to > assign _s so that it prints "you are in method1". > > > *** > class Obj1: >

*Naming Conventions*

2007-06-03 Thread Thorsten Kampe
Okay, I hear you saying 'not another naming conventions thread'. I've read through Google and the 'naming conventions' threads were rather *spelling conventions* threads. I'm not interested in camelCase versus camel_case or anything mentioned in 'PEP 8 -- Style Guide for Python Code'. What I'

Re: c[:]()

2007-06-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: >>> [using `map()`] >> And has the same issue as a list comprehension if all you want is the side >> effect of the calls: a useless temporary list full of `None`\s is build. > > functoins can return a values, and you get it. I don't think that it >

Re: *Naming Conventions*

2007-06-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Thorsten Kampe wrote: > Recently I wrote this code and noticed that I was completely lost in > giving these objects names to describe and distinguish them: > > for validanswer in validanswers: > if myAnswers.myanswer in myAnswers.validAnswers[validanswer]: > M

Re: *Naming Conventions*

2007-06-03 Thread Steve Howell
--- Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > for validanswer in validanswers: > if myAnswers.myanswer in > myAnswers.validAnswers[validanswer]: > MyOptions['style'] = validanswer > I can at least sympathize with your problem, although I don't have a great solution for you. I o

Re: subexpressions (OT: math)

2007-06-03 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Leonhard Vogt <[EMAIL PROTECTED]> wrote: >>> Yes, I understand that, but what is the geometrical >>> meaning of the square root of an arc length? >> >> That's a different question to your original question, which was asking >> about the square root of an angle. >

WSGI/wsgiref: modifying output on windows ?

2007-06-03 Thread [EMAIL PROTECTED]
Hi, I am currently trying to port my web software AFoC to Windows and have hit a strange problem: it seams that binary files (PNG images in this case) get distorted by wsgiref. (I have tried both the CGIHandler with both Xitami and Apache2 and WSGIServer). My application is retu

Re: subexpressions (OT: math)

2007-06-03 Thread Steve Howell
What's the square root of -1 radians? :) Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center. http://autos.yahoo.com/green_center/ -- http://mail.p

Re: Is 1 large Regex faster than 3 smaller ones?

2007-06-03 Thread Roy Smith
In article <[EMAIL PROTECTED]>, erikcw <[EMAIL PROTECTED]> wrote: > Hi, > > I need to match 3 small strings in a small text file (about 200 words > of text). > > Would it be faster to write 1 compiled regex that matches all 3 > substrings in one go, or to use 3 separate regular expressions to d

Re: Is 1 large Regex faster than 3 smaller ones?

2007-06-03 Thread John Machin
On Jun 4, 4:52 am, erikcw <[EMAIL PROTECTED]> wrote: > Hi, > > I need to match 3 small strings in a small text file (about 200 words > of text). > > Would it be faster to write 1 compiled regex that matches all 3 > substrings in one go, or to use 3 separate regular expressions to do > the same job?

another thread on Python threading

2007-06-03 Thread [EMAIL PROTECTED]
Hi, I've recently been working on an application[1] which does quite a bit of searching through large data structures and string matching, and I was thinking that it would help to put some of this CPU-intensive work in another thread, but of course this won't work because of Python's GIL. There's

Re: another thread on Python threading

2007-06-03 Thread Steve Howell
--- "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > One random idea is to for Python 3000, make the > equivalent of > __slots__ the default, *but* instead gather > the set of attributes from all member variables set > in __init__. Are you suggesting to do this at startup time or runtime? The

Re: another thread on Python threading

2007-06-03 Thread [EMAIL PROTECTED]
On Jun 3, 5:52 pm, Steve Howell <[EMAIL PROTECTED]> wrote: > The pitfall here is that to reduce code duplication, > you might initialize certain variables in a method > called by __init__, because your object might want to > return to its initial state. This is a good point. I was thinking that

Re: *Naming Conventions*

2007-06-03 Thread Ninereeds
On Jun 4, 5:03 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > for validanswer in validanswers: > if myAnswers.myanswer in myAnswers.validAnswers[validanswer]: > MyOptions['style'] = validanswer First, for small loops with loop variables whose meaning is obvious from context, the most

Dict naming, global vs local imports, etc. [was Re: *Naming Conventions*]

2007-06-03 Thread George Sakkis
On Jun 3, 4:32 pm, Steve Howell <[EMAIL PROTECTED]> wrote: > I also still waste brain cycles on naming > dictionaries. Sometimes I name the dictionary after > the values it stores, sometimes after the keys it > uses, and sometimes after both. I was in the same boat but now I've pretty much settl

Re: subexpressions (OT: math)

2007-06-03 Thread Steven D'Aprano
On Sun, 03 Jun 2007 11:26:40 -0700, [EMAIL PROTECTED] wrote: > if you are discordant read more :P : > sine is a dimensionless value. > if we expand sine in taylor series sin(x) = x - (x^3)/6 + (x^5)/120 > etc. > you can see that sin can be dimensionless only if x is dimensionless > too. > > I am

Re: subexpressions (OT: math)

2007-06-03 Thread Wildemar Wildenburger
Gary Herron wrote: > Of course not! Angles have units, commonly either degrees or radians. > > However, sines and cosines, being ratios of two lengths, are unit-less. > >> To understand it: sin() can't have dimensioned argument. It is can't >> to be - sin(meters) >> >> > No it's sin(rad

Re: *Naming Conventions*

2007-06-03 Thread Dan Bishop
On Jun 3, 11:03 pm, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > Okay, > > I hear you saying 'not another naming conventions thread'. I've read > through Google and the 'naming conventions' threads were rather > *spelling conventions* threads. > > I'm not interested in camelCase versus camel_case or

Re: *Naming Conventions*

2007-06-03 Thread Steve Howell
--- Dan Bishop <[EMAIL PROTECTED]> wrote: > > * Loop indices often have single-letter names > (typically i/j/k or x/ > y), or names that are the singular form of the list > name (e.g., "for > ballot in self._ballots"). For iterating over > files, I use "line". > You are in good company with "i"

RE: c[:]()

2007-06-03 Thread Warren Stringer
> Anyway, the code below defines a simple "callable" list; it just calls > each contained item in turn. Don't bother to use [:], it won't work. > > py> class CallableList(list): > ... def __call__(self): > ... for item in self: > ... item() > ... > py> def a(): print "a" > ... > py> d

Re: subexpressions (OT: math)

2007-06-03 Thread Gary Herron
Wildemar Wildenburger wrote: > Gary Herron wrote: > >> Of course not! Angles have units, commonly either degrees or radians. >> >> However, sines and cosines, being ratios of two lengths, are unit-less. >> >> >>> To understand it: sin() can't have dimensioned argument. It is can't >>> t

example: 40286 -> 68204

2007-06-03 Thread Shihpin
Hi all, Is there a fuction that reverse the digits of a number? Many thanks, Shihpin Lin -- http://mail.python.org/mailman/listinfo/python-list

Re: subexpressions (OT: math)

2007-06-03 Thread Lloyd Zusman
"Steven D'Aprano" <[EMAIL PROTECTED]> writes: > On Sun, 03 Jun 2007 11:26:40 -0700, [EMAIL PROTECTED] wrote: > >> if you are discordant read more :P : >> sine is a dimensionless value. >> if we expand sine in taylor series sin(x) = x - (x^3)/6 + (x^5)/120 >> etc. >> you can see that sin can be dim

Re: example: 40286 -> 68204

2007-06-03 Thread Brian van den Broek
Shihpin said unto the world upon 06/03/2007 08:23 PM: > Hi all, > > Is there a fuction that reverse the digits of a number? > > Many thanks, > > Shihpin Lin > This does it: def reversed_int(i): > ... return int(''.join(reversed(str(i > ... reversed_int(12345) > 54321

Re: example: 40286 -> 68204

2007-06-03 Thread Yongjian Xu
Don't think there is one in builtin for that and might have to convert str <-> int to do that too, such as int(str(i)[::-1]) ... Jim On 6/3/07, Shihpin <[EMAIL PROTECTED]> wrote: Hi all, Is there a fuction that reverse the digits of a number? Many thanks, Shihpin Lin -- http://mail.python.

Re: Check for descriptors (in C)

2007-06-03 Thread Alex Martelli
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > For most types, there are macros like PyXxxx_Check and > PyXxxx_CheckExact. But not for descriptors, and I want to test if a > certain object is a descriptor or not. May I define > PyMethodDescr_Check, by example, along the lines of similar checks, or

Re: int vs long

2007-06-03 Thread Alex Martelli
Paul Rubin wrote: > Dan Bishop <[EMAIL PROTECTED]> writes: > > If you ever do, it's trivial to write your own enumerate(): > > def enumerate(seq): > > index = 0 > > for item in seq: > > yield (index, item) > > index += 1 > > That's a heck of a lo

Re: subexpressions (OT: math)

2007-06-03 Thread Alex Martelli
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On 3, 22:07, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > angle is a ratio of two length and > >dimensionless.http://en.wikipedia.org/wiki/Angle#Units_of_measure_for_ang > >les > > > > only dimensionless values can be a argument of a sin

Re: *Naming Conventions*

2007-06-03 Thread Michael Hoffman
Thorsten Kampe wrote: > for validanswer in validanswers: > if myAnswers.myanswer in myAnswers.validAnswers[validanswer]: > MyOptions['style'] = validanswer I usually try to avoid using "my" because I find it obscures a better understanding of what is really going -- Michael Hoffman

Re: *Naming Conventions*

2007-06-03 Thread Michael Hoffman
Michael Hoffman wrote: > Thorsten Kampe wrote: > >> for validanswer in validanswers: >> if myAnswers.myanswer in myAnswers.validAnswers[validanswer]: >> MyOptions['style'] = validanswer > > I usually try to avoid using "my" because I find it obscures a better > understanding of what

Re: Multiple inheritence for exceptions?

2007-06-03 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Useful or a bad idea? > > I have a module that defines a number of exceptions which inherit from > various built-ins like KeyError, ValueError etc. I'm considering defining > an abstract module exception like MyModuleError, and having all my real > exc

Re: Roundup, smtplib, TLS and MS Exchange

2007-06-03 Thread carlistixx
Thanks for your response. I tried modifying the Roundup code as suggested: class SMTPConnection(smtplib.SMTP): ''' Open an SMTP connection to the mailhost specified in the config ''' def __init__(self, config): smtplib.SMTP.__init__(self, config.MAILHOST) self.set_debu

excel library without COM

2007-06-03 Thread james_027
Hi, is there any library to help me write excel files without using win com? because i'll be working on linux platform. At the same time I could want to perform some formatting, merging of cells. adding sheets and etc ... Thanks james -- http://mail.python.org/mailman/listinfo/python-list

Re: monitoring the filesystem for changes

2007-06-03 Thread momobear
> You could use the ReadDirectoryChangesW in overlapped > mode. I've never tried it, so I don't know how > robust it would be. Why is it a problem to have > "multiple programs" running? And is that simply > multiple threads, or multiple processes? I used overlapped in my program, it runs about 1 we

Re: another thread on Python threading

2007-06-03 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I've recently been working on an application[1] which does quite a bit > of searching through large data structures and string matching, and I > was thinking that it would help to put some of this CPU-intensive work > in another thread, but of course this won't work becau

Re: subexpressions (OT: math)

2007-06-03 Thread Erik Max Francis
Gary Herron wrote: > Of course not! Angles have units, commonly either degrees or radians. ... > I don't know of any name for the units of "sqrt of angle", but that > doesn't invalidate the claim that the value *is* a dimensioned > quantity. In lieu of a name, we'd have to label such a q

Re: subexpressions (OT: math)

2007-06-03 Thread Erik Max Francis
Gary Herron wrote: > No, not end-of-story. Neither of us are being precise enough here. To > quote from your second link: > "Although the radian is a unit of measure, it is a dimensionless > quantity." > > But NOTE: Radians and degrees *are* units of measure., however those > units are dime

Re: Python 2.5.1 broken os.stat module

2007-06-03 Thread Joe Salmeri
> | > You are misinterpreting what you are seeing. Windows is not claiming > | > that the modification time changes when DST starts. Instead, it is > | > claiming that the *same* time now has a *different* textual > | > representation, because the computer now has moved to a different > | > time z

Re: Python 2.5.1 broken os.stat module

2007-06-03 Thread Joe Salmeri
> Please understand that it is *extremely* tedious to follow your > messages. It would have been much better if they had been short and > to the point. Sometimes it seems that it is impossible to please people. When messages are short then people complain that they did not get sufficient details

Python, Dutch, English, Chinese, Japanese, etc.

2007-06-03 Thread Steve Howell
The never-ending debate about PEP 3131 got me thinking about natural languages with respect to Python, and I have a bunch of mostly simple observations (some factual, some anecdotal). I present these mostly as food for thought, but I do make my own continent-by-continent recommendations at the bot

Re: subexpressions (OT: math)

2007-06-03 Thread Steve Howell
--- Alex Martelli <[EMAIL PROTECTED]> wrote: > > I blame the > Babylonians for that > confusion just as much as for the clunky base-60 > that intrudes in our > ordinary time reckoning...! > I apologize for helping to start this whole ridiculous thread, although I hope some people have been ente

Re: c[:]()

2007-06-03 Thread Terry Reedy
"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] || Warren Stringer wanted to call the functions just for the side effects | without interest in the return values. So building a list of return | values which is immediately thrown away is a waste of time and

Re: example: 40286 -> 68204

2007-06-03 Thread Shihpin
Brian, Thanks! I will try it when I come home, > > Shihpin Lin > > This does it: > > def reversed_int(i): > > ... return int(''.join(reversed(str(i > > ... > reversed_int(12345) > > 54321 > > Best, > > Brian vdB -- http://mail.python.org/mailman/listinfo/python-list

Re: Error message if there is a space in the source directory

2007-06-03 Thread lukefrancomusic
Wow, great!! That worked like a charm. Sorry about the excessive commenting, when looking it over I could see how that would be annoying. Thank you Peter! Luke -- http://mail.python.org/mailman/listinfo/python-list

Third PyConBrasil takes place in August 2007

2007-06-03 Thread Rodrigo Senra
We are glad to announce the Third PyConBrasil organised by the Brazilian Python Community. The event will take place from 2007-08-30 to 2007-09-01 at Joinville city in Santa Catarina State (SC) in the Brazil's south region. The event home page is http://pyconbrasil.com.br/ We apologize b

Re: excel library without COM

2007-06-03 Thread kyosohma
On Jun 3, 7:59 pm, james_027 <[EMAIL PROTECTED]> wrote: > Hi, > > is there any library to help me write excel files without using win > com? because i'll be working on linux platform. At the same time I > could want to perform some formatting, merging of cells. adding sheets > and etc ... > > Thank

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-03 Thread Ross Ridge
Steve Howell <[EMAIL PROTECTED]> wrote: >about Japan: >major linguistic influences: Chinese, English, >Dutch English and Dutch are minor linguistic influences. >kanji = Chinese characters >hiragana and katakana -- syllabic scripts >Latin alphabet often used in modern Japanese (se

Re: can this be implemented?

2007-06-03 Thread Gabriel Genellina
En Sat, 02 Jun 2007 20:54:29 -0300, greenflame <[EMAIL PROTECTED]> escribió: > When I first learned about programming, I started with BASIC, QBASIC > to be more accurate. While I was at that stage, I learned about the > INPUT command. I used it abundantly. > > Ok so now for the actual issue. >

Re: example: 40286 -> 68204

2007-06-03 Thread attn . steven . kuo
On Jun 3, 5:23 pm, Shihpin <[EMAIL PROTECTED]> wrote: > Hi all, > > Is there a fuction that reverse the digits of a number? > > Many thanks, > > Shihpin Lin One can use int, str and a slice: print int(str(40286)[::-1]) -- Hope this helps, Steven -- http://mail.python.org/mailman/listinfo/pyth

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-03 Thread Steve Howell
--- Ross Ridge <[EMAIL PROTECTED]> wrote: > >Asia: > > > > Python should be *completely* internationalized > for > >Mandarin, Japanese, and possibly Hindi and Korean. > >Not just identifiers. I'm talking the entire > >language, keywords and all. > > > btw. Mandarin is a spoken dialect Chines

Re: excel library without COM

2007-06-03 Thread Waldemar Osuch
On Jun 3, 6:59 pm, james_027 <[EMAIL PROTECTED]> wrote: > is there any library to help me write excel files without using win > com? One option is: https://secure.simplistix.co.uk/svn/xlwt/trunk -- http://mail.python.org/mailman/listinfo/python-list

`yield` in a `try/finally` block, pre-Python 2.5

2007-06-03 Thread Adam Atlas
I'm trying to emulate the Python 2.5 behaviour (PEP 342) of generator functions where the `yield` statement is in a `try/finally` block. Basically, where the `finally` block is guaranteed to run even if the generator doesn't finish running: it simply runs when the generator is garbage-collected. Do

Re: `yield` in a `try/finally` block, pre-Python 2.5

2007-06-03 Thread yuce
I had the same problem, you can see: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/130004 for a solution. Happy hacking, Yuce On Jun 4, 8:23 am, Adam Atlas <[EMAIL PROTECTED]> wrote: > I'm trying to emulate the Python 2.5 behaviour (PEP 342) of generator > functions where the `yield`

Re: excel library without COM

2007-06-03 Thread yuce
i think this one works pretty nice: http://www.python.org/pypi/xlrd Happy hacking, Yuce On Jun 4, 3:59 am, james_027 <[EMAIL PROTECTED]> wrote: > Hi, > > is there any library to help me write excel files without using win > com? because i'll be working on linux platform. At the same time I > c

Re: subexpressions (OT: math)

2007-06-03 Thread Wildemar Wildenburger
Gary Herron wrote: >> The radian is defined as the ratio of an arc of circumfence of a circle >> to the radius of the circle and is therefore *dimensionless*. End of story. >> http://en.wikipedia.org/wiki/Radian and esp. >> http://en.wikipedia.org/wiki/Radian#Dimensional_analysis >> >> >>

magic names in python

2007-06-03 Thread per9000
Hi, I recently started working a lot more in python than I have done in the past. And I discovered something that totally removed the pretty pink clouds of beautifulness that had surrounded my previous python experiences: magic names (I felt almost as sad as when I discovered the strange pink worm

  1   2   >