Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Kay Schluehr
On 22 Sep., 23:17, Erik Max Francis <[EMAIL PROTECTED]> wrote: > The attribute and method (not made distinct in Io; they're called > "slots") is much the same as with Python; the current instance is > checked for the object, then its parents, then _its_ parents, and so on. Repeating the same poin

Re: subprocess -popen - reading stdout from child - hangs

2007-09-22 Thread Suresh Babu Kolla
[EMAIL PROTECTED] wrote: > Let's say I have this Python file called loop.py: > > import sys > print 'hi' > sys.stdout.flush() > while 1: > pass > > And I want to call it from another Python process and read the value > 'hi'. How would I do it? > > So far I have tried this: > proc = su

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread [EMAIL PROTECTED]
On Sep 22, 10:23?pm, [EMAIL PROTECTED] wrote: > On Sep 22, 9:10 pm, Paul Rubin wrote: > > > Certainly xgcd should be in the math library or somewhere similar. > > It does feel odd to have modular exponentiation in the core but no > other number-theoretic stuff in core+lib

Re: Factory function with keyword arguments

2007-09-22 Thread George Sakkis
On Sep 22, 10:53 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > I'm writing a factory function that needs to use keywords in the produced > function, not the factory. Here's a toy example: > > def factory(flag): > def foo(obj, arg): > if flag: > # use th

Python plugins for netbeans 6 IDE?

2007-09-22 Thread Kenneth McDonald
Do any such exist? And do you find them worthwhile? I couldn't see any browsing the netbeans pages, but that doesn't mean they're not out there... Thanks, Ken -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Paddy
On Sep 22, 8:29 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Sat, 22 Sep 2007 14:50:12 +, Paddy wrote: > > Sorry Carl, > > I think *you* may not have much need for bitwise operators but others, > > including myself do. No matter what the usage found, I would think > > replacing bitwise operat

Re: subprocess -popen - reading stdout from child - hangs

2007-09-22 Thread [EMAIL PROTECTED]
On Sep 22, 11:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Let's say I have this Python file called loop.py: > > import sys > print 'hi' > sys.stdout.flush() > while 1: > pass > > And I want to call it from another Python process and read the value > 'hi'. How would I do it? > > So

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Well okay, I take that back---I wouldn't mind *writing* it; I just > wouldn't expect to get much speed from *running* it. I don't see why not. It's just the basic Python long arithmetic which is coded in C. I tested it against gmpy (carefully written asm code and tu

subprocess -popen - reading stdout from child - hangs

2007-09-22 Thread [EMAIL PROTECTED]
Let's say I have this Python file called loop.py: import sys print 'hi' sys.stdout.flush() while 1: pass And I want to call it from another Python process and read the value 'hi'. How would I do it? So far I have tried this: >>> proc = subprocess.Popen('python >>> /home/chiefinnovator/loo

Re: An Editor that Skips to the End of a Def

2007-09-22 Thread TheFlyingDutchman
On Sep 20, 8:47 pm, "W. Watson" <[EMAIL PROTECTED]> wrote: > How about in the case of MS Win? > Try Wing IDE at http://www.wingware.com. It can run and debug programs and has a free version. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread richyjsm
On Sep 22, 9:10 pm, Paul Rubin wrote: > Certainly xgcd should be in the math library or somewhere similar. It does feel odd to have modular exponentiation in the core but no other number-theoretic stuff in core+libraries. Perhaps a proposal on python-ideas is in order..

Re: Factory function with keyword arguments

2007-09-22 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > def factory(flag): > if flag: kw = 'spam' > else: kw = 'ham' > def foo(obj, arg): > kwargs = dict([(kw, arg)]) > return obj.method(**kwargs) > return foo Untested: def factory(flag): def foo(obj, arg):

Factory function with keyword arguments

2007-09-22 Thread Steven D'Aprano
I'm writing a factory function that needs to use keywords in the produced function, not the factory. Here's a toy example: def factory(flag): def foo(obj, arg): if flag: # use the spam keyword to method() return obj.method(spam=arg) else: #

newb: glob on windows os.renames creates many nested folders

2007-09-22 Thread crybaby
when I do this in my python code and run it in windows xp, it creates ctemp//.../.../../ so on and creates file t. Not file starting with the name complist and ending with .txt (complist*.txt). Any idea why this may be? glob only works in *nix not on windows? os.renames(glob.glob('complist*.

Preemption in python

2007-09-22 Thread Kurtis Heimerl
Hi, I'm developing my first python application, a multi-threaded cell phone gadget on ubuntu 7.10. I've just split off my first thread, and I've noticed something extremely strange: There doesn't seem to be any preemption. There are currently two threads, one that pings a storage service to see if

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Paul Rubin
[EMAIL PROTECTED] writes: > And who is it who uses this functionality? I use it but I agree it's easy to implement given the underlying bignum arithmetic. > It's useful in elementary number theory, sure, but I'd argue that if > there are going to be number theoretical functions in the core then

Re: find difference in days from YYYYMMDD to YYYYMMDD

2007-09-22 Thread chaelon
On Sep 22, 5:37 am, Konstantinos Pachopoulos <[EMAIL PROTECTED]> wrote: > Hi, > does any body now any such algorith? to find difference in days from > MMDD to MMDD? > Or just an algorithm, that converts MMDD to seconds since the epoch? > > Thanks Seen some complex answers here. Let's

Small changes in side library

2007-09-22 Thread [EMAIL PROTECTED]
Hi, all! May be this question have been already discussed, but I found nothing closer :-/ I have the side library which provides wide set of different functions, but I'm going to replace some of them with mine and provided such 'modified' library thought my project. The following way works well f

Re: Odd files; just left behind?

2007-09-22 Thread Robert Kern
Robin Becker wrote: > Robert Kern wrote: > ... >> They're a cache. > > they're actually the files that get used by the installed extension in > this case (MySQLdb). Yes. They are extracted from the zipfile at runtime and left there so they don't have to be extracted again. That's why I calle

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread George Sakkis
On Sep 22, 3:29 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Sat, 22 Sep 2007 14:50:12 +, Paddy wrote: > > Sorry Carl, > > I think *you* may not have much need for bitwise operators but others, > > including myself do. No matter what the usage found, I would think > > replacing bitwise operat

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread richyjsm
On Sep 22, 7:50 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Everybody forgets that pow can take three arguments, except of course for > those who use that functionality and would be mighty peeved if it went > away. And who is it who uses this functionality? It's useful in

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Steven D'Aprano
On Sat, 22 Sep 2007 14:09:13 -0700, Paul Rubin wrote: >> Nevertheless, def is never a real anonymous function constructor. > > Well, def constructs a function with a name, but the function can stay > around after the name goes away, after which I'd say the function is > nameless. One could other

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Steven D'Aprano
On Sat, 22 Sep 2007 18:09:49 +, richyjsm wrote: > On that subject, I'd suggest that the pow() builtin (not the ** operator > - just the pow() function) should also be a candidate for removal... Help on built-in function pow in module __builtin__: pow(...) pow(x, y[, z]) -> number Wi

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread richyjsm
On Sep 22, 7:04 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Sat, 22 Sep 2007 21:17:38 +, Bryan Olson wrote: > > The operator module offers pow(). Is there any good reason for > > pow() as a built-in? > > The `operator.pow()` is just the function for ``**``, it lacks the > opti

Threading preemption questions

2007-09-22 Thread Kurtis Heimerl
Hi, I'm developing my first python application, a multi-threaded cell phone gadget on ubuntu 7.10. I've just split off my first thread, and I've noticed something extremely strange: There doesn't seem to be any preemption. There are currently two threads, one that pings a storage service to see if

database persistence with mysql, sqlite

2007-09-22 Thread coldpizza
Hi, I want to run a database query and then display the first 10 records on a web page. Then I want to be able to click the 'Next' link on the page to show the next 10 records, and so on. My question is how to implement paging, i.e. the 'Next/Prev' NN records without reestablishing a database con

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Marc 'BlackJack' Rintsch
On Sat, 22 Sep 2007 21:17:38 +, Bryan Olson wrote: > The operator module offers pow(). Is there any good reason for > pow() as a built-in? The `operator.pow()` is just the function for ``**``, it lacks the optional third argument of the built in `pow()`. Ciao, Marc 'BlackJack' Rints

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Grant Edwards
On 2007-09-22, Carl Banks <[EMAIL PROTECTED]> wrote: > On Sat, 22 Sep 2007 12:57:35 +, Grant Edwards wrote: >> On 2007-09-22, Carl Banks <[EMAIL PROTECTED]> wrote: >>> Of course it would be. The reason I mention it is that automatic >>> convertibility is a key factor in whether a change can ma

Re: unicode categories -- regex

2007-09-22 Thread koara
> At the moment, you have to generate a character class for this yourself, > e.g. > ... Thank you Martin, this is exactly what i wanted to know. -- http://mail.python.org/mailman/listinfo/python-list

Re: too many values with string.split

2007-09-22 Thread Alain
Shawn Minisall a écrit : > I'm trying to unpack a list of 5 floats from a list read from a file and > python is telling me 5 variables are too many for the string.split > statement. Anyone have any other idea's? NOTE: the only reason I > convert it to a float instead of just leaving it as a st

Re: I could use some help making this Python code run faster using only Python code.

2007-09-22 Thread Marc 'BlackJack' Rintsch
On Sat, 22 Sep 2007 13:00:27 -0700, Python Maniac wrote: > On Sep 21, 11:39 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Fri, 21 Sep 2007 16:25:20 -0700, Python Maniac wrote: >> >> > Well D code is compiled into machine code that runs via a VM. >> >> About which D are we talking h

Re: too many values with string.split

2007-09-22 Thread Marc 'BlackJack' Rintsch
On Sat, 22 Sep 2007 17:00:47 -0400, Shawn Minisall wrote: > I'm trying to unpack a list of 5 floats from a list read from a file and > python is telling me 5 variables are too many for the string.split > statement. Please post the *real* message which I suspect is something like 'too many value

Re: An Editor that Skips to the End of a Def

2007-09-22 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Bjoern Schliessmann wrote: > Lawrence D'Oliveiro wrote: > >> After two decades of putting up with vi just to ensure >> compatibility with every proprietary *nix system I might come >> across, let me just say ... >> >> USE EMACS! > > Nah. Use vim. Every other text

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > Bryan Olson wrote: >> One surprising result was that more of the Python >> programmers surveyed use bitwise operators than are aware >> of the exponentiation operator, which C does not offer. > > On that subject, I'd suggest that the pow() builtin (not the ** > operator

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Erik Max Francis
Kay Schluehr wrote: > I checked out Io once and I disliked it. I expected Io's prototype OO > being just a more flexible variant of class based OO but Io couples a > prototype very closely to its offspring. When A produces B and A.f is > modified after production of B also B.f is modified. A contr

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Paul Rubin
Bryan Olson <[EMAIL PROTECTED]> writes: > How anonymous is that function when we can see that its name is 'h'? h is out of scope after compose returns, so the function is anonymous in the sense that there is no symbol bound to the function, through which you can refer to it. > import math >

too many values with string.split

2007-09-22 Thread Shawn Minisall
I'm trying to unpack a list of 5 floats from a list read from a file and python is telling me 5 variables are too many for the string.split statement. Anyone have any other idea's? NOTE: the only reason I convert it to a float instead of just leaving it as a string in the loop is because I ha

Re: frange() question

2007-09-22 Thread Carsten Haese
On Sat, 2007-09-22 at 18:21 +, John J. Lee wrote: > Carsten Haese <[EMAIL PROTECTED]> writes: > > The second half of my post illustrates a difference of opinion about > > what constitutes a generator function. You state that frange() is not a > > generator function because it doesn't use yield,

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Bryan Olson
Paul Rubin wrote: > Bryan Olson <[EMAIL PROTECTED]> writes: >> [EMAIL PROTECTED] wrote: >>> There are already anonymous functions in Python. >>> lambda x, y, z: x + y + z >>> is the same as: >>> def _(x, y, z): return x + y + z >> They are the same only in special cases: >> The special identif

Re: An Editor that Skips to the End of a Def

2007-09-22 Thread Stefan Behnel
W. Watson wrote: > Bruno Desthuilliers wrote: >> W. Watson a écrit : >>> How about in the case of MS Win? >>> >>> Ben Finney wrote: (Please don't top-post. Instead, reply below each point to which you're responding, removing quoted text irrelevant to your response.) >> >> Wayne,

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Terry Reedy
"Carl Banks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | | Is it worth it to make such a change? It would remove a lot of operators | (11 by my count), vastly simplifying syntax, Which, IMHO, is no small | thing. New numerical types would have fewer operations to support. P

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Carl Banks
On Sat, 22 Sep 2007 14:50:12 +, Paddy wrote: > Sorry Carl, > I think *you* may not have much need for bitwise operators but others, > including myself do. No matter what the usage found, I would think > replacing bitwise operators by function calls a retrograde step. Well, if people are going

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Carl Banks
On Sat, 22 Sep 2007 12:57:35 +, Grant Edwards wrote: > On 2007-09-22, Carl Banks <[EMAIL PROTECTED]> wrote: >> Of course it would be. The reason I mention it is that automatic >> convertibility is a key factor in whether a change can make it into >> Python 3. > > It matters not whether fugly

Re: I could use some help making this Python code run faster using only Python code.

2007-09-22 Thread Python Maniac
On Sep 21, 12:56 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > George Sakkis <[EMAIL PROTECTED]> wrote: > > It has to do with the input string length; try multiplying it by 10 or > > 100. Below is a more complete benchmark; for largish strings, the imap > > version is the fastest among those using

Re: I could use some help making this Python code run faster using only Python code.

2007-09-22 Thread Python Maniac
On Sep 21, 11:39 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 21 Sep 2007 16:25:20 -0700, Python Maniac wrote: > > On Sep 21, 3:02 pm, "Matt McCredie" <[EMAIL PROTECTED]> wrote: > > >> Isn't D compiled to machine code? I would expect it to win hands down. > >> That is, unless i

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Bryan Olson
Cristian wrote: > [...] Specifically, he's having trouble > thinking of functions as first order data (don't worry, I haven't > confused him with such terminology yet). [...] > And, after we finally > get a hold of first order functions, we appreciate its incorporation > into languages. It would b

Re: find difference in days from YYYYMMDD to YYYYMMDD

2007-09-22 Thread Zentrader
On Sep 22, 2:37 am, Konstantinos Pachopoulos <[EMAIL PROTECTED]> wrote: > Hi, > does any body now any such algorith? to find difference in days from > MMDD to MMDD? > Or just an algorithm, that converts MMDD to seconds since the epoch? > > Thanks For some reason, to-seconds-since-epoch

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Paul Rubin
Carl Banks <[EMAIL PROTECTED]> writes: > If anyone says, "But that takes away an easy test for oddness (x&1)!", > or, "But you can multiply powers of two using left shift! Isn't that > cool?", I'm not buying it. Those are gimmicks. Arithmetic operations > should be done with arithmetic operat

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Paul Rubin
Bryan Olson <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > There are already anonymous functions in Python. > > lambda x, y, z: x + y + z > > is the same as: > > def _(x, y, z): return x + y + z > > They are the same only in special cases: > The special identifier "_" is used in t

Re: frange() question

2007-09-22 Thread John J. Lee
Carsten Haese <[EMAIL PROTECTED]> writes: > On Sat, 2007-09-22 at 07:27 +, John J. Lee wrote: >> Carsten Haese <[EMAIL PROTECTED]> writes: >> >> > On Thu, 2007-09-20 at 18:55 +, John J. Lee wrote: >> >> Functions are never generators, senso stricto. There are "generator >> >> functions",

Properties and Objects...

2007-09-22 Thread George V. Neville-Neil
I have been reading the mailing list and I am unfortunately going to open up discussion I've seen twice in the last two years but which still bugs me, so please accept my apologies in advance. I have been working on a set of modules that make objects which look like network packets (http://pcs.sf.

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread richyjsm
On Sep 22, 11:13 am, Bryan Olson <[EMAIL PROTECTED]> wrote: > One surprising result was that more of the Python > programmers surveyed use bitwise operators than are aware > of the exponentiation operator, which C does not offer. On that subject, I'd suggest that the pow() builtin (not the ** oper

Re: Who can develop the following Python script into working application ?

2007-09-22 Thread Diez B. Roggisch
Andrey Khavryuchenko schrieb: > DBR> And as you said yourself: > > DBR> """ > DBR> Frankly speaking I would prefer to pay for your kind assistance > DBR> as it may take me to much time to learn some Python and understand the > DBR> following script. > DBR> """ > > DBR> Now, again: http://w

Re: Video from image

2007-09-22 Thread Diez B. Roggisch
azrael schrieb: > I'd like to ask you if you know a module that makes it possible to > create a number of images and than to use them as frames and finaly > export them to a video file pymedia Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Who can develop the following Python script into working application ?

2007-09-22 Thread http://members.lycos.co.uk/dariusjack/
On Sep 22, 4:25 pm, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote: > DBR> And as you said yourself: > > DBR> """ > DBR> Frankly speaking I would prefer to pay for your kind assistance > DBR> as it may take me to much time to learn some Python and understand the > DBR> following script. > DBR

Re: unicode categories -- regex

2007-09-22 Thread Martin v. Löwis
> So how do i include this information in regular pattern search? Any > ideas? At the moment, you have to generate a character class for this yourself, e.g. py> chars = [unichr(i) for i in range(sys.maxunicode)] py> chars = [c for c in chars if unicodedata.category(c)=='Po'] py> expr = u'[\\' + u

Video from image

2007-09-22 Thread azrael
I'd like to ask you if you know a module that makes it possible to create a number of images and than to use them as frames and finaly export them to a video file -- http://mail.python.org/mailman/listinfo/python-list

Re: Help for Otsu implementation from C

2007-09-22 Thread azrael
Thanks Man, I did it. It works fantastic. On Sep 19, 9:33 pm, azrael <[EMAIL PROTECTED]> wrote: > I know. The translation is not so important to me, because this is > going to just a little function that is working in the last step of > the whole proces. The whole implementation wont be published

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Matthew Woodcraft
Cristian <[EMAIL PROTECTED]> wrote: > To me, the biggest setback for new programmers is the different > syntax Python has for creating functions. Instead of the common (and > easy to grasp) syntax of foo = bar Python has the def foo(): syntax. [...] > in a program like Python there doesn't seem

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread [EMAIL PROTECTED]
On Sep 21, 10:44?pm, Carl Banks <[EMAIL PROTECTED]> wrote: > Anyone with me here? (I know the deadline for P3 PEPs has passed; this > is just talk.) Are you a loony? Python doesn't have enough bit operations. I'm always using the gmpy module's bit functions: digits(...) digits(x[,b

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > There are already anonymous functions in Python. > > lambda x, y, z: x + y + z > > is the same as: > > def _(x, y, z): return x + y + z They are the same only in special cases: The special identifier "_" is used in the interactive interpreter to store the r

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Marc 'BlackJack' Rintsch
On Sat, 22 Sep 2007 06:58:57 -0700, Kay Schluehr wrote: > On Sep 22, 1:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Sat, 22 Sep 2007 02:44:35 -0700, Kay Schluehr wrote: >> > I checked out Io once and I disliked it. I expected Io's prototype OO >> > being just a more flexible va

unicode categories -- regex

2007-09-22 Thread koara
Hello all -- my question regards special meta characters for the re module. I saw in the re module documentation about the possibility to abstract to any alphanumeric unicode character with '\w'. However, there was no info on constructing patterns for other unicode categories, such as purely alphab

Re: frange() question

2007-09-22 Thread Carsten Haese
On Sat, 2007-09-22 at 07:27 +, John J. Lee wrote: > Carsten Haese <[EMAIL PROTECTED]> writes: > > > On Thu, 2007-09-20 at 18:55 +, John J. Lee wrote: > >> Functions are never generators, senso stricto. There are "generator > >> functions", which *return* (or yield) generators when you cal

Re: can I run pythons IDLE from a command line??

2007-09-22 Thread Thomas Jollans
On Saturday 22 September 2007, [EMAIL PROTECTED] wrote: > Hi, > Is their a version of pythons IDLE that will run in a dos command > line? > The reason is that I would like to be able to run python code > interactively from my parable by connecting to my desktop using remote > command line or a teln

can I run pythons IDLE from a command line??

2007-09-22 Thread [EMAIL PROTECTED]
Hi, Is their a version of pythons IDLE that will run in a dos command line? The reason is that I would like to be able to run python code interactively from my parable by connecting to my desktop using remote command line or a telnet program. -- http://mail.python.org/mailman/listinfo/python-list

Re: Zope review

2007-09-22 Thread Bryan Olson
Sean Tierney wrote: >>From Twisted's website "Twisted is a networking engine written in > Python, supporting numerous protocols. It contains a web server, > numerous chat clients, chat servers, mail servers, and more. > > Given that Zope is also a written in python, supports numerous > protocols,

Re: Killing A Process By PID

2007-09-22 Thread Arvind Singh
> file('/var/lock/Application.lock', 'w').write(str(os.getpid())) > > > > Which to be honest appears to run just fine, when I look in that file > > it always contains the correct process ID, for instance, 3419 or something > > like that. > > > I honestly doubt that. The I/O is buffered and you nee

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Bryan Olson
Carl Banks wrote: > Not many people are bit-fiddling these days. One of the main uses of bit > fields is flags, but that's not often done in Python because of keyword > arguments and dicts, which are lot more versatile. Another major use, > talking to hardware, is not something oft done in Pyt

Re: Building Python with VC8 on x64 Vista

2007-09-22 Thread Martin v. Löwis
> 1>py_dyn_test.obj : error LNK2001: unresolved external symbol > _Py_NoneStruct Could it be that py_dyn_test.obj is a x86 (not AMD64) object file? Run dumpbin. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: uninstall python2.5 on debian

2007-09-22 Thread Martin v. Löwis
> I have tried make uninstall and searched the web, but that did not help me. > I guess rm -Rf python2.5 is not a wise thing to do. It's part of the solution. There is no automated install procedure; you have to manually remove everything that got installed. In /bin, it's most files that have 2.5

Re: find difference in days from YYYYMMDD to YYYYMMDD

2007-09-22 Thread tokland
On 22 sep, 11:37, Konstantinos Pachopoulos <[EMAIL PROTECTED]> wrote: > does any body now any such algorith? to find difference in days from > MMDD to MMDD? Once I needed the same and I wrote: def days_difference(s1, s2): splitdate = lambda s: time.strptime(s, "%Y%m%d")[:3] str2d

Re: Zope review

2007-09-22 Thread Sean Tierney
>From Twisted's website "Twisted is a networking engine written in Python, supporting numerous protocols. It contains a web server, numerous chat clients, chat servers, mail servers, and more. Given that Zope is also a written in python, supports numerous protocols, contains a webserver, has sever

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Paddy
Sorry Carl, I think *you* may not have much need for bitwise operators but others, including myself do. No matter what the usage found, I would think replacing bitwise operators by function calls a retrograde step. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Scott David Daniels
Ron Adam wrote: > > > Scott David Daniels wrote: >> Cristian wrote: >>> On Sep 21, 3:44 pm, Ron Adam <[EMAIL PROTECTED]> wrote: >>> I think key may be to discuss names and name binding with your friend. >> >> Here's an idea: >> >> import math >> >> def sin_integral(start, finish, dx): ... >>

Re: Who can develop the following Python script into working application ?

2007-09-22 Thread Andrey Khavryuchenko
DBR> And as you said yourself: DBR> """ DBR> Frankly speaking I would prefer to pay for your kind assistance DBR> as it may take me to much time to learn some Python and understand the DBR> following script. DBR> """ DBR> Now, again: http://www.guru.com/ There you can get devlopers for D

Re: Odd files; just left behind?

2007-09-22 Thread Robin Becker
Robert Kern wrote: ... > > They're a cache. they're actually the files that get used by the installed extension in this case (MySQLdb). .. >> >> it would seem simpler to have the .so files inside the site-packages and >> there's >> the question of why this folder has to be obfusca

Re: Sets in Python

2007-09-22 Thread sapsi
Thank you everyone for the assistance and for the very informative discussion Regards SM -- http://mail.python.org/mailman/listinfo/python-list

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Kay Schluehr
On Sep 22, 1:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Sat, 22 Sep 2007 02:44:35 -0700, Kay Schluehr wrote: > > I checked out Io once and I disliked it. I expected Io's prototype OO > > being just a more flexible variant of class based OO but Io couples a > > prototype very cl

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Grant Edwards
On 2007-09-22, Carl Banks <[EMAIL PROTECTED]> wrote: >> If you don't want to use the bitwise operations, then ignore >> them. Presto! Simpler syntax. > > Until people no longer need to read code written by others, this argument > is utter bull. > > It's completely besides the point, anyways. T

Re: Writing Object Data to Disk

2007-09-22 Thread Marc 'BlackJack' Rintsch
On Sat, 22 Sep 2007 17:13:14 +0530, Amit Kumar Saha wrote: > BTW, do we have something like array of objects here? Like someone already said: lists. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: xml-rpc timeout

2007-09-22 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steve Holden wrote: > Timeouts shouldn't be a normal feature of TCP communications. On the contrary, they should. How else are you going to detect that the other side has died? -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: Writing Object Data to Disk

2007-09-22 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Amit Kumar Saha wrote: >> > From: Lawrence D'Oliveiro <[EMAIL PROTECTED]> > >> > In message <[EMAIL PROTECTED]>, >> > Amit Kumar Saha wrote: >> > >> > > I would like to know if "Pickling" the class object is the only >> > way of writing it to disk for persistent st

Re: Re: Writing Object Data to Disk

2007-09-22 Thread Amit Kumar Saha
> > From: Lawrence D'Oliveiro <[EMAIL PROTECTED]> > > In message <[EMAIL PROTECTED]>, > > Amit Kumar > > Saha wrote: > > > > > I would like to know if "Pickling" the class object is the only > > way of > > > writing it to disk for persistent storage. > > > > Wouldn't it be better to use a languag

Re: Writing Object Data to Disk

2007-09-22 Thread John Machin
On 22/09/2007 7:16 PM, Bjoern Schliessmann wrote: > Amit Kumar Saha wrote: >> I have a Python class with data members, say: >> >> class Foo: >> def __init__(self): >> >> self.a=7 >> self.b[]={1,3,4} > ^^ > This is invalid syntax. So are the braces. -- http://m

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Carl Banks
On Sat, 22 Sep 2007 02:32:30 -0700, Paul Rubin wrote: > Carl Banks <[EMAIL PROTECTED]> writes: >> That's it, lost me already. You ever see the kinds of programs >> mechanical engineers write? It isn't software. > > They do a lot of number crunching. Certainly they can appreciate higher > order

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Marc 'BlackJack' Rintsch
On Sat, 22 Sep 2007 02:44:35 -0700, Kay Schluehr wrote: > I checked out Io once and I disliked it. I expected Io's prototype OO > being just a more flexible variant of class based OO but Io couples a > prototype very closely to its offspring. When A produces B and A.f is > modified after productio

Re: find difference in days from YYYYMMDD to YYYYMMDD

2007-09-22 Thread John Machin
On 22/09/2007 7:37 PM, Konstantinos Pachopoulos wrote: > Hi, > does any body now any such algorith? to find difference in days from > MMDD to MMDD? The literal answer to your question is, unsurprisingly, "Yes". Now, what do you really want/need: (a) details of an algorithm so that you

Re: find difference in days from YYYYMMDD to YYYYMMDD

2007-09-22 Thread Diez B. Roggisch
Konstantinos Pachopoulos schrieb: > Hi, > does any body now any such algorith? to find difference in days from > MMDD to MMDD? > Or just an algorithm, that converts MMDD to seconds since the epoch? See the modules datetime and time in the standard library. Diez -- http://mail.python

Re: Who can develop the following Python script into working application ?

2007-09-22 Thread Diez B. Roggisch
http://members.lycos.co.uk/dariusjack/ schrieb: > On Sep 21, 1:26 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> >> >>> Please help and let me know your terms. >> There are websites dedicated to this - like e.g. >> >> http://www.guru.com/ >> >> Make an offer there. >> >> Diez > > Ok Diez, >

Re: calling the function of one class from another class

2007-09-22 Thread Furkan Kuru
On 9/22/07, Mridula Ramesh <[EMAIL PROTECTED]> wrote: > > hi. > > i currently have code structured like this: > > classA(): > > def __init__(): > > .. > > .. > > > > def fnc1(): > > > > > > > > > > classB():

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Kay Schluehr
On Sep 22, 10:40 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Sat, 22 Sep 2007 00:47:37 -0700, Kay Schluehr wrote: > > On 22 Sep., 08:56, Paul Rubin wrote: > >> Kay Schluehr <[EMAIL PROTECTED]> writes: > >> > If you feel you can transform it into another u

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Paul Rubin
Carl Banks <[EMAIL PROTECTED]> writes: > That's it, lost me already. You ever see the kinds of programs > mechanical engineers write? It isn't software. They do a lot of number crunching. Certainly they can appreciate higher order functions like integrate(f, x0, x1) to integrate the function f

find difference in days from YYYYMMDD to YYYYMMDD

2007-09-22 Thread Konstantinos Pachopoulos
Hi, does any body now any such algorith? to find difference in days from MMDD to MMDD? Or just an algorithm, that converts MMDD to seconds since the epoch? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: An Editor that Skips to the End of a Def

2007-09-22 Thread Paul Rubin
[EMAIL PROTECTED] (John J. Lee) writes: > > I think mousing takes more mental work than typing, > I'm not sure this is a matter for debate, as much as physical > measurement. I don't know of any way to physically measure mental work. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Bjoern Schliessmann
Carl Banks wrote: > On Sat, 22 Sep 2007 05:19:42 +, Grant Edwards wrote: >> I do. > > Your anecdotal evidence is noted and given all the consideration > it's due. Being funny, or being arrogant? Many today's network protocols work with bit flags. It is /not/ anecdotal. >> I do it all the t

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Carl Banks
On Fri, 21 Sep 2007 23:38:38 -0700, Paul Rubin wrote: > Carl Banks <[EMAIL PROTECTED]> writes: >> Especially someone like an >> engineer (in the classical sense), who isn't building versatile >> software packages, won't need to resort to functional programming much. > > http://www.math.chalmers.s

Re: Writing Object Data to Disk

2007-09-22 Thread Bjoern Schliessmann
Amit Kumar Saha wrote: > I have a Python class with data members, say: > > class Foo: > def __init__(self): > > self.a=7 > self.b[]={1,3,4} ^^ This is invalid syntax. > I would like to know if "Pickling" the class object is the only > way of writing it to disk

Re: Newbie completely confused

2007-09-22 Thread Roel Schroeven
Jeroen Hegeman schreef: > ...processing all 2 files found > --> 1/2: ./test_file0.txt > Now reading ... > DEBUG readLines A took 0.093 s > ...took 8.85717201233 seconds > --> 2/2: ./test_file0.txt > Now reading ... > DEBUG readLines A took 3.917 s > ...took 12.8725550175 seconds > > So the first t

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-22 Thread Marc 'BlackJack' Rintsch
On Sat, 22 Sep 2007 00:47:37 -0700, Kay Schluehr wrote: > On 22 Sep., 08:56, Paul Rubin wrote: >> Kay Schluehr <[EMAIL PROTECTED]> writes: >> > If you feel you can transform it into another unambigous grammar >> > mixing statements and expressions it's up to you. >> >> W

  1   2   >