Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Peter Maas
muldoon schrieb:
>Now, what forum would you recommend? Any help would be appreciated.

alt.culture.us.*

-- 
---
Peter Maas,  M+R Infosysteme,  D-52070 Aachen,  Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
---
-- 
http://mail.python.org/mailman/listinfo/python-list


Newbie: Explain My Problem

2005-06-29 Thread ChuckDubya
Code:

#The Guess My Number Game

import random
num = ""
guess = ""
counter = 7
num = random.randrange(1, 100)
print "I'm thinking of a whole number from 1 to 100."
print "You have ", counter, " chances left to guess the number."
print
guess = int(raw_input("Your guess is: "))
while counter != 0:
if guess == num:
print "You guessed the number, ", num, " in ", counter-6, "
guesses!"
elif guess > num:
counter = counter - 1
print
print "The number is less than your guess."
print "You have ", counter, " chances left to guess the
number."
guess = int(raw_input("Your guess is: "))
else:
counter = counter - 1
print
print "The number is greater than your guess."
print "You have", counter, " chances left to guess the number."
guess = (raw_input("Your guess is "))
if counter == 0:
print "You idiot, my number was", num,"!"
print "YOU LOSE!"
raw_input("Hit the enter key to exit.")


Two things wrong happen:
- Dialogue switches from saying "number is greater" to "number is
less", regardless of guess
- Lets user guess when user has no more guesses left in "counter"
variable.

Please explain to me what's wrong with my program.

-- 
http://mail.python.org/mailman/listinfo/python-list


How to connect python and Mysql?

2005-06-29 Thread praba kar

Dear All,

  I am using python2.4 and Mysql 4.0.20.  Now I am
want to connect python and mysql. I have problem to
install Mysql-python-1.2.0 interface into my machine.
When I try to install this interface the following
error restrict to install fully.

/System/Links/Executables/ld: cannot find
-lmysqlclient_r
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

So If anybody knows regarding this kindly mail me


regards
PRabahar






__
Free antispam, antivirus and 1GB to save all your messages
Only in Yahoo! Mail: http://in.mail.yahoo.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie: Explain My Problem

2005-06-29 Thread rjreeves
Hi Chuck

1. Missing an int(.. on one of the guess=

print "You have", counter, " chances left to guess the number."

guess = int(raw_input("Your guess is "))

Thus ensuring guess is consistent with it content type

2. Need a break when the guess=num
  if guess == num:
 print "You guessed the number, ", num, " in ", counter-6, "
guesses!"
 break

To stop from looping in the while when counter is NOT zero but the
number has been found.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie: Explain My Problem

2005-06-29 Thread rjreeves
Hi Chuck

1. Missing an int(.. on one of the guess=

print "You have", counter, " chances left to guess the number."

guess = int(raw_input("Your guess is "))

Thus ensuring guess is consistent with it content type

2. Need a break when the guess=num
  if guess == num:
 print "You guessed the number, ", num, " in ", counter-6, "
guesses!"
 break

To stop from looping in the while when counter is NOT zero but the
number has been found.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie: Explain My Problem

2005-06-29 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 29/06/2005 03:11:
> Code:
> 
> #The Guess My Number Game
> 
> import random
> num = ""
> guess = ""
> counter = 7
> num = random.randrange(1, 100)
> print "I'm thinking of a whole number from 1 to 100."
> print "You have ", counter, " chances left to guess the number."
> print
> guess = int(raw_input("Your guess is: "))
> while counter != 0:
> if guess == num:
> print "You guessed the number, ", num, " in ", counter-6, "
> guesses!"
> elif guess > num:
> counter = counter - 1
> print
> print "The number is less than your guess."
> print "You have ", counter, " chances left to guess the
> number."
> guess = int(raw_input("Your guess is: "))
> else:
> counter = counter - 1
> print
> print "The number is greater than your guess."
> print "You have", counter, " chances left to guess the number."
> guess = (raw_input("Your guess is "))
> if counter == 0:
> print "You idiot, my number was", num,"!"
> print "YOU LOSE!"
> raw_input("Hit the enter key to exit.")
> 
> 
> Two things wrong happen:
> - Dialogue switches from saying "number is greater" to "number is
> less", regardless of guess
> - Lets user guess when user has no more guesses left in "counter"
> variable.
> 
> Please explain to me what's wrong with my program.
> 

Well, you have some logic problems, and they are harder to see because 
of some structural problems.

Notice that in your elif and else branches you repeat logic? Or 
rather, almost repeat logic :-) (You left of the conversion to int on 
one of the calls to raw_input.)

You also had the problem that if the user was right, they'd be told so 
quite a few times ;-)

And, you weren't keeping track of the guesses properly.

Compare yours with the code below. I've moved things around, 
eliminated the duplication (and near duplication), removed the 
pointless initial assignments to num and guess, closed the infinite 
loop, and built the strings differently.

import random

counter = 7
num = random.randrange(1, 100)

print "I'm thinking of a whole number from 1 to 100."

while counter != 0:
 print "You have %s chances left to guess the number." %counter
 guess = int(raw_input("Your guess is: "))
 counter = counter - 1

 if guess == num:
 print "You guessed the number, %s in %s guesses!" %(num, 
7-counter)
 break # else it will print success msg forever

 elif guess > num:
 print "\nThe number is less than your guess."

 else:
 print "\nThe number is greater than your guess."

if counter == 0:
 print "You idiot, my number was %s!" %num
 print "YOU LOSE!"
 raw_input("Hit the enter key to exit.")


This still assumes a co-operative user. (Try entering "one" and see 
what happens.) "1 chances" looks goofy, too. You might want to think 
about fixing that.

Best,

Brian vdB

-- 
http://mail.python.org/mailman/listinfo/python-list


Reading output from a child process non-blockingly

2005-06-29 Thread Yuan HOng
In my program I have to call an external program and parse its output.
For that I use the os.popen2 function, and then read the output
stream.

But the complexity is that the external program gives back its output
in a piecemeal manner, with long delays between the outputs. In the
main program I want to therefore read the output in a non-blocking
manner, to read as many bytes as the child process is spitting out.

The question is, how can I achieve that?

I tried use select.select on the output stream returned by os.popen2,
but it returns a readable file descriptor only after the whole child
process ends.

Here is a script simulating the external program:

test.py:
import sys, time
print 'hello\n'*500
sys.stdout.flush()
time.sleep(100)
print 'world\n'*500 

And here is what I am tring to do in the main program to read its output:

import os, select
cmd = 'python test.py'
pin, pout = os.popen2(cmd)
while not select.select([pout], [], [], some_timeout)[0]:
  pass
pout.readline()

I hope to get the first return very soon, before the external program
sleeps, but instead only after the whole program exits do I get any
output.

Can anyone give me a hint?

-- 
Hong Yuan

大管家网上建材超市
www.homemaster.cn
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: strange __call__

2005-06-29 Thread Michael Hoffman
Rahul wrote:
> Consider the following:
> def a(x):
>  return x+1
> 
> def b(f):
>   def g(*args,**kwargs):
> for arg in args:
> print arg
> return f(*args,**kwargs)
>   return g
> 
> a.__call__ = b(a.__call__)
> 
> now calling a(1) and a.__call__(1) yield 2 different results!!
> i.e. for functions a(1) doesnt seem to be translated to a.__call__ if
> you assign a new value to a.__call__?

I don't know why this happens, but setting the __call__ attribute of a 
is a pretty strange thing to do. Why not just set a instead? The 
original function a(x) will still be stored as a closure in what is 
returned from b().

If this is of purely academic interest then the answer is I don't know. :)
-- 
Michael Hoffman
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to compare two directories?

2005-06-29 Thread Michael Hoffman
could ildg wrote:
> I want to compare 2 directories,
> and find If all of theire sub-folders and files and sub-files are identical.
> If not the same, I want know which files or folders are not the same.
> I know filecmp moudle has cmpfiles function and a class named dircmp,
> they may help, but I wonder if there is a ready-to-use function in python 
> libs?

That's a good start. Why doesn't dircmp work for you?
-- 
Michael Hoffman
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Set/Get attribute syntatic sugar

2005-06-29 Thread Michael Hoffman
Peter Hansen wrote:
> Elmo Mäntynen wrote:
> 
>> Maybe funny, but a bit too cocky for my taste. Robert kern is propably
>> right about what he really meant so don't be too hasty in the future,
>> right?). 
> 
> Elmo, it's probably neither cocky nor funny, but before you pass 
> judgment you should Google this group for "time machine" and read 
> awhile.  (I was merely attempting to parrot a traditional response that 
> is given around here when someone asks for something which is already 
> present in the language.)
> 
> And whether I misinterpreted the (ambiguous) question or not, my 
> response provides the required information to put together a solution to 
> the OP's question.  It would just require one extra level of 
> indirection, so to speak, to do what Robert suggests he might have wanted.

I didn't understand the original question either until Robert Kern 
guessed what the OP was talking about.
-- 
Michael Hoffman
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary to tuple

2005-06-29 Thread bruno modulix
Erik Max Francis wrote:
> bruno modulix wrote:
> 
>> Err... don't you spot any useless code here ?-)
>>
>> (tip: dict.items() already returns a list of (k,v) tuples...) 
> 
> But it doesn't return a tuple of them.  Which is what the tuple call
> there does.

Of course, but the list-to-tuple conversion is not the point here. The
useless part might be more obvious in this snippet:

my_list = [(1, 'one'), (2, 'two'), (3, 'three')]
my_tup = tuple([(k, v) for k, v in my_list])


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie: Explain My Problem

2005-06-29 Thread Roel Schroeven
[EMAIL PROTECTED] wrote:

> Code:
> 
[snip]

> else:
> counter = counter - 1
> print
> print "The number is greater than your guess."
> print "You have", counter, " chances left to guess the number."
> guess = (raw_input("Your guess is "))

The above line is incorrect: it should be
 guess = int(raw_input("Your guess is "))

-- 
If I have been able to see further, it was only because I stood
on the shoulders of giants.  -- Isaac Newton

Roel Schroeven
-- 
http://mail.python.org/mailman/listinfo/python-list


Regarding MySQLdb

2005-06-29 Thread praba kar
Dear All
   After installation of Mysql-Python Interface.
I try to import MySQLdb but I got below error
How to correct this error.

regards
Praba

>>> import MySQLdb
Traceback (most recent call last):
  File "", line 1, in ?
  File "MySQLdb/__init__.py", line 27, in ?
import _mysql
ImportError: libmysqlclient.so.12: cannot open shared
object file: No such file or directory
>>> import _mysql
Traceback (most recent call last):
  File "", line 1, in ?
ImportError: libmysqlclient.so.12: cannot open shared
object file: No such file or directory
>>



__
How much free photo storage do you get? Store your friends 'n family snaps for 
FREE with Yahoo! Photos http://in.photos.yahoo.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie: Help Figger Out My Problem

2005-06-29 Thread bruno modulix
[EMAIL PROTECTED] wrote:
> Thanks to all who replied.  I did not ask for other iterations of my
> program. I asked what was wrong with it.

Please understand that usenet is not a commercial support service.
Everyone is free to answer how he likes. Or not to answer at all...

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to connect python and Mysql?

2005-06-29 Thread bruno modulix
praba kar wrote:
> Dear All,
> 
>   I am using python2.4 and Mysql 4.0.20.  Now I am
> want to connect python and mysql. I have problem to
> install Mysql-python-1.2.0 interface into my machine.
> When I try to install this interface the following
> error restrict to install fully.
> 
> /System/Links/Executables/ld: cannot find
> -lmysqlclient_r
> collect2: ld returned 1 exit status
> error: command 'gcc' failed with exit status 1

This is not a Python problem, but what...

Your linker doesn't find the librairy libmysqlclient_r.so. Check if this
lib is installed on your system, and if yes if it's located somewhere
where your linker can find it.

> So If anybody knows regarding this kindly mail me
post on usenet, get the answer on usenet !-)

HTH
-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: COM problem .py versus .exe

2005-06-29 Thread Tim Golden
[Greg Miller]
| Hello again, I put the executable on the "virgin" PC today.  
| I am using
| the wmi(b) that you gave me.  The error that I am receiving now is:
| 
| File "autoStart.pyc", line 241, in test
| File "wmib.pyc", line 157, in ?
| File "win32com\client\__init__.pyc", line 73, in GetObject
| File "win32com\client\__init__.pyc", line 88, in Moniker
| com_error: (-2147221020, 'Invalid syntax', None, None)
| 
| any thoughts on this error?  Thanks again for the help.

Well that's a real pain! Is there any way you can run the
un-py2exed script on the virgin PC. (I guess not, as I
suppose the idea is not to have a Python installation).
Perhaps you could do it with a non-installed Moveable
Python?

http://www.voidspace.org.uk/python/movpy/


In any case, what are the differences between
the PC on which it works and the one on which it
doesn't? Win2K vx WinXP?
I'm trying to see if the problem is down to
py2exe, or is to do with something in the module
itself.

TJG


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which kid's beginners programming - Python or Forth?

2005-06-29 Thread gabriele renzi
BORT ha scritto:
> All,
> 
> The Forth-Python pull was heading to a conclusion just like "Tastes
> Great" vs. "Less Filling" or Ford-Chevy.  However, friendly folks at
> comp.lang.forth pointed me to Amazon.com and _Mindstorms: Children,
> Computers, and Powerful Ideas_
> by Seymour Papert.  The book is by Logo's inventor and, according to
> the reviews, addresses the larger goal I most want to achieve.


I thought you were limiting the choice to python/forth.
Logo is a nice dialect of lisp, so I think you're making a good choice ;)

But I'd consider Squeak. It is the best educational-but-not-only 
environment I've seen (which does not mean there are not better, but 
I've seen quite a bit of them)

Squeak not only has programming at the hand but it also provide you with 
a complete educational system, with music, painting, animations etc. And 
there is nothing that could get a kid involved like making a rabbit explode.


> I now want to read the book.  Period.  However, my kids both love Legos
> which uses a Logo implementation for their robotics toys.  I could
> probably capture both the 10 yr old AND the 7 yr old if we can spring
> for the $200 Lego Mindstorm set.  Sort of blows away my specification
> of "free," but...
> 
> In my earlier browsing, I eliminated Logo early on, thinking we would
> hit its capability ceiling too quickly and then backtrack in order to
> make a transition to a "REAL" language.
> 
> uh... I've been browsing on Logo tonight and, even without the Lego
> robots, I may go that route.  Shoot, I thought Logo was just moving
> hokey sprites in increasingly complex patterns until I saw the book
> list at:
> 
> http://el.media.mit.edu/logo-foundation/products/books.html
> 
> Hmm...  When all is said and done, maybe the choice is kind of like
> physical exercise.  I can spend weeks choosing the most effective work
> out and diet combination.  But, until I cut back on biggie size grease
> brugers with double shakes and get off of the couch every now and then,
> the choice of workout is moot.  In fact, one I use is better than the
> "best" that I don't use.
> 
> Gentle folk of comp.lang.python, I heartily thank you all for your
> input.  I think I'm taking the boys through the door marked "Logo."  We
> may be back this way, though.  We will likely need MORE in the nebulous
> future.  I am impressed with the outpouring of support here!
> 
> Thanks to all!
> 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Favorite non-python language trick?

2005-06-29 Thread Mandus
Sun, 26 Jun 2005 08:35:58 +0200 skrev Peter Otten:
> Steven D'Aprano wrote:
>
>> On Sat, 25 Jun 2005 21:30:26 +0200, Peter Otten wrote:
>> 
>>> Mandus wrote:
>>> 
 By using the builtin reduce, I
 move the for-loop into the c-code which performs better.
>>> 
>>> No. There is no hope of ever writing fast code when you do not actually
>>> measure its performance.
>> 
>> Good grief! You've been spying on Mandus! How else could you possibly know
>> that he doesn't measure performance? Are you running a key-logger on his
>> machine? *wink*
>
> His mentioning reduce() as a performance panacea was a strong indication
> even without looking over his shoulders. He filled in some conditions in a
> later post, but "[U]sing reduce ... performs better [than a for-loop]" is
> just wrong.

Ok - so sometimes reduce() for convenience (nha, that's just me...),
sometimes for performance. In some cases clever use of map/reduce/etc.
have given a good speedup - say  4 times that of for-loops. But going to
C can give 10 to 100 times speed up over that again... So it depends how
important the performance is. Going to C/Fortran is always a bit more
hassel, while reduce is something you can stick in your interactive
session to finish the work rather before than after lunch :)

[snip]
>
>> Isn't it reasonable to just say, "I use join because it is faster than
>> adding strings" without being abused for invalid optimization?
>
> OK, I am making a guess: "".join(strings) is more often faster than
> naive string addition than reduce() wins over a for-loop.

you're probably right.

> I don't think my pointed comment qualifies as "abuse", by the way.

neither think I.


-- 
Mandus - the only mandus around.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: COM problem .py versus .exe

2005-06-29 Thread Thomas Heller
"Tim Golden" <[EMAIL PROTECTED]> writes:

> [Greg Miller]
> | Hello again, I put the executable on the "virgin" PC today.  
> | I am using
> | the wmi(b) that you gave me.  The error that I am receiving now is:
> | 
> | File "autoStart.pyc", line 241, in test
> | File "wmib.pyc", line 157, in ?
> | File "win32com\client\__init__.pyc", line 73, in GetObject
> | File "win32com\client\__init__.pyc", line 88, in Moniker
> | com_error: (-2147221020, 'Invalid syntax', None, None)
> | 
> | any thoughts on this error?  Thanks again for the help.
>
> Well that's a real pain!

Doesn't this look like the WMI service (or how it's called) is not
installed?

Thomas
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: strange __call__

2005-06-29 Thread Andreas Kostyrka
Just a guess, but setting "__X__" special methods won't work in most cases
because these are usually optimized when the class is created.

It might work if a.__call__ did exist before (because class a: contained
a __call__ definition).

Andreas

On Wed, Jun 29, 2005 at 09:15:45AM +0100, Michael Hoffman wrote:
> Rahul wrote:
> > Consider the following:
> > def a(x):
> >  return x+1
> > 
> > def b(f):
> >   def g(*args,**kwargs):
> > for arg in args:
> > print arg
> > return f(*args,**kwargs)
> >   return g
> > 
> > a.__call__ = b(a.__call__)
> > 
> > now calling a(1) and a.__call__(1) yield 2 different results!!
> > i.e. for functions a(1) doesnt seem to be translated to a.__call__ if
> > you assign a new value to a.__call__?
> 
> I don't know why this happens, but setting the __call__ attribute of a 
> is a pretty strange thing to do. Why not just set a instead? The 
> original function a(x) will still be stored as a closure in what is 
> returned from b().
> 
> If this is of purely academic interest then the answer is I don't know. :)
> -- 
> Michael Hoffman
> -- 
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: COM problem .py versus .exe

2005-06-29 Thread Tim Golden
[Thomas Heller]
| 
| "Tim Golden" <[EMAIL PROTECTED]> writes:
| 
| > [Greg Miller]
| > | Hello again, I put the executable on the "virgin" PC today.  
| > | I am using
| > | the wmi(b) that you gave me.  The error that I am 
| receiving now is:
| > | 
| > | File "autoStart.pyc", line 241, in test
| > | File "wmib.pyc", line 157, in ?
| > | File "win32com\client\__init__.pyc", line 73, in GetObject
| > | File "win32com\client\__init__.pyc", line 88, in Moniker
| > | com_error: (-2147221020, 'Invalid syntax', None, None)
| > | 
| > | any thoughts on this error?  Thanks again for the help.
| >
| > Well that's a real pain!
| 
| Doesn't this look like the WMI service (or how it's called) is not
| installed?
| 
| Thomas

I don't think that's it; (a) because I've seen this issue before
on my own machine, although I don't remember what the cause was!
and (b) because unless the OP's on Win9x/NT I think it very
unlikely that WMI isn't up-and-running.

TJG


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie: Explain My Problem

2005-06-29 Thread John Machin
[EMAIL PROTECTED] wrote:
[snip]
> while counter != 0:
> if guess == num:
[snip]

Others have told you already what was wrong with your program. Here's a 
clue on how you could possibly help yourself:

1. Each time around your loop, print the values of the interesting 
objects, in this case counter and guess.
E.g. before the "if" statement above, put something like this:
print "guess = %r, counter = %r" % (guess, counter)
That would have shown "guess" containing a string e.g.
guess = '42', counter = 4
instead of an integer e.g.
guess = 42, counter = 4

2. Examine the logic carefully. The answer to your second problem was 
just staring you in the face -- you hadn't pulled the ripcord after the 
counter became zero.

Cheers,
John


-- 
http://mail.python.org/mailman/listinfo/python-list


map vs. list-comprehension

2005-06-29 Thread Mandus
Hi there,

inspired by a recent thread where the end of reduce/map/lambda in Python was
discussed, I looked over some of my maps, and tried to convert them to
list-comprehensions.

This one I am not sure how to conver:

Given three tuples of length n, b,i and d, I now do:

map(lambda bb,ii,dd: bb+ii*dd,b,i,d)

which gives a list of length n. 

Anyone have an idea what the equivalent list comprehension will be?

take care,
-- 
Mandus - the only mandus around.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Modules for inclusion in standard library?

2005-06-29 Thread Simon Brunning
On 6/28/05, John Roth <[EMAIL PROTECTED]> wrote:
> I'd definitely like to see ctypes. I can agree with the segfault
> issue, but I think that some design work would eliminate that.

I'm not sure that it would. Ctypes allows you, as one colleague
memorably put it, to "poke the operating system with a stick". You are
always going to be able to use ctypes to provoke spectacular crashes
of the kind that you can never get with 'ordinary' Python.

Having said that, I'd like to see ctypes in the standard library
anyway, with a suitably intimidating warning in the docs about the
trouble you can get yourself into with it.

-- 
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: map vs. list-comprehension

2005-06-29 Thread F. Petitjean
Le Wed, 29 Jun 2005 09:46:15 + (UTC), Mandus a écrit :
> Hi there,
>
> inspired by a recent thread where the end of reduce/map/lambda in Python was
> discussed, I looked over some of my maps, and tried to convert them to
> list-comprehensions.
>
> This one I am not sure how to conver:
>
> Given three tuples of length n, b,i and d, I now do:
>
> map(lambda bb,ii,dd: bb+ii*dd,b,i,d)
>
> which gives a list of length n. 

res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ]

Hoping that zip will not be deprecated.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: PyDev 0.9.5 released

2005-06-29 Thread Edvard Majakari
Dave Cook <[EMAIL PROTECTED]> writes:

>> PyDev - Python IDE (Python Development Enviroment for Eclipse) version
>> 0.9.5 has just been released.
>
> Does it work with the newly released Eclipse 3.1?

Seems to work for me (but I've only coded one smallish Python program with it)

--
# Edvard Majakari   Software Engineer
# PGP PUBLIC KEY available  Soli Deo Gloria!

$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt(60281449,'es'),2,4),"\n";
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Boss wants me to program

2005-06-29 Thread Edvard Majakari
phil <[EMAIL PROTECTED]> writes:

>  From 30 years of application development experience I will tell you
> NOT HUMBLY, that Python is easily the most productive, the most read-write
> and the most elegant of any of the above.  Handsdown better than Java, the
> runner up in that group.

I don't want to start a flamewar here - but I would like to point out that not
only the language you use affects productivity, but also tools that support
working with the language affect a lot too. For example, I once thought I
would start writing any documents longer than say, two A4 pages with lout
(I've used LaTeX so far). However, realising how much more supporting tools,
add-ons and utilities LaTeX had, I stayed with that (moreover, some of the
other people already new LaTeX but didn't know lout).

Recently I participated in creating a visual FSM editor as Eclipse plugin. I
hadn't used Eclipse before, but seeing how easy it was to create tests,
refactor code (bicyclerepairman is not even close to features offered by
Eclipse) and use gazillion other tools designed to improve Java productivity
made me realise the language has a really, really great selection of tools and
utilities available.

Now, I earn my bread by coding Python and I do like coding in Python the most,
but sometimes I think I would have been better off with Java - not because of
the language, but because of the environment and sheer selection of tools
available.

Let me emphasize a little more. Even though Python itself is great, I think we
don't have quite yet tools that offer

* Industrial-grade reverse-engineering tool (ie. automatic UML diagram
  generation out of code) which also supports creating classes/interfaces out
  of UML diagrams, and modifies the other automatically when the other changes

* Automatic unit test case generation (pydev is going to this direction, I
  think)

* Decent code coverage tools - and I don't mean statement coverage, but path
  coverage or multi-condition coverage

Just see how many handy tools there are for Java if you use Eclipse:

http://eclipse-plugins.2y.net/eclipse/plugins.jsp

(Yes, I know that many of those plugins are not related to any language but
Eclipse and that some of the plugins are specifically Python related, but most
of the good stuff is for Java Development)

Pydev looks really promising, though. With Eclipse, I think it is a very good
alternative to commercial Python IDEs and could mature to the Other Way(TM)
for developing Python programs (the other is, of course, vi(m)/(X)Emacs)

--
# Edvard Majakari   Software Engineer
# PGP PUBLIC KEY available  Soli Deo Gloria!

$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt(60281449,'es'),2,4),"\n";
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: map vs. list-comprehension

2005-06-29 Thread Björn Lindström
"F. Petitjean" <[EMAIL PROTECTED]> writes:

> res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ]
>
> Hoping that zip will not be deprecated.

Nobody has suggested that. The ones that are planned to be removed are
lambda, reduce, filter and map. Here's GvR's blog posting that explains
the reasons:

http://www.artima.com/weblogs/viewpost.jsp?thread=98196

-- 
Björn Lindström <[EMAIL PROTECTED]>
Student of computational linguistics, Uppsala University, Sweden
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on Guido's ITC audio interview

2005-06-29 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Markus Wankus 
<[EMAIL PROTECTED]> writes
>Have you ever tried anything that provides real, usable refactoring 
>like Eclipse does with Java?  I guarantee if you used it more than a 
>few times your view would most likely change.

I was forced to use Eclipse recently. Dreadful. I really disliked it. I 
never got as far as wanting to refactor things. I couldn't wait to stop 
using it.

>The fact is, code evolves.  You simply cannot write high-quality 
>software in one pass.

Total agreement. My point is that productivity gains from refactoring 
tools are the least of your worries. Hiring good staff that know how to 
write, test and debug software is very much more important than the 
amount of time a refactoring tool will save.

Stephen
-- 
Stephen Kellett
Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html
Computer Consultancy, Software Development
Windows C++, Java, Assembler, Performance Analysis, Troubleshooting
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: PyDev 0.9.5 released

2005-06-29 Thread Stephen Toledo-Brown
Dave Cook wrote:

> On 2005-06-28, Fabio Zadrozny <[EMAIL PROTECTED]> wrote:
>>PyDev - Python IDE (Python Development Enviroment for Eclipse) version 
>>0.9.5 has just been released.

> Does it work with the newly released Eclipse 3.1?

It's worked with previous release candidates.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Better console for Windows?

2005-06-29 Thread Thorsten Kampe
* Richie Hindle (2005-06-28 14:44 +0100)
> [Christos, on widening the Windows Command Prompt]
>> Hm... right-click the cmd.exe window's title bar (or click on the
>> top-left icon, or press Alt-Space), go to Properties, Layout tab, Window
>> Size, Width.
> 
> Just to take this thread *completely* off-topic: does anyone know of a way
> to scroll a Command Prompt window using the keyboard?

[Shift+PageUp/Down]: rxvt (Cywin). Unfortunately only per page; if you
want to scroll one line you have to use the scrollbar.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reading output from a child process non-blockingly

2005-06-29 Thread ilochab


Yuan HOng ha scritto:
> In my program I have to call an external program and parse its output.
> For that I use the os.popen2 function, and then read the output
> stream.
>
> But the complexity is that the external program gives back its output
> in a piecemeal manner, with long delays between the outputs. In the
> main program I want to therefore read the output in a non-blocking
> manner, to read as many bytes as the child process is spitting out.
>
> The question is, how can I achieve that?
> 

What about using a thread to control the child process?

Licia

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Modules for inclusion in standard library?

2005-06-29 Thread Thomas Heller
Simon Brunning <[EMAIL PROTECTED]> writes:

> On 6/28/05, John Roth <[EMAIL PROTECTED]> wrote:
>> I'd definitely like to see ctypes. I can agree with the segfault
>> issue, but I think that some design work would eliminate that.
>
> I'm not sure that it would. Ctypes allows you, as one colleague
> memorably put it, to "poke the operating system with a stick". You are
> always going to be able to use ctypes to provoke spectacular crashes
> of the kind that you can never get with 'ordinary' Python.

Right.

> Having said that, I'd like to see ctypes in the standard library
> anyway, with a suitably intimidating warning in the docs about the
> trouble you can get yourself into with it.

To me, this sounds that *at least* a PEP would be needed to convince
Guido.  Or, to record the reasoning why it cannot be included.

Thomas
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Open running processes

2005-06-29 Thread Tim Golden
[DeRRudi]
| It is a wxWindow app. It is a kind of datamanager. it is possible to
| minimize it to the systray.
| 
| hmm.. i've thought of an solution using memorymapping. see if it
| works.. don't know if it is the 'best' or 'safest' way.. but ok.

Did your idea work out? If it didn't (or if it did!) could you
post some code? I'd be interested in seeing a working solution to
this.

TJG


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
The two machines are both running Windows XP, the desktop is running XP
Pro, the "virgin" PC is running XP embedded.  I would say the biggest
difference is that the embedded machine has only the py2exe executable
running/installed, while the desktop has the full python24
installation.  I get no build errors when compiling the executable, and
all other parts of the application run correctly.  I'll try the
non-installed moveable python and see what happens.  The idea of the
executable is that in the machines first release, we didn't have time
to work the bugs out of the executable, so we released with the python
code ( pyc's ) intact.  I didn't have this problem on the first release
as we weren't interested in displaying the file version of the .dll.
With this improved version of the product the request has come down to
have all software package versions displayed, so that is why I am now
attempting to extract the file version of the dll.  Thanks again for
everyone's assistance.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Modules for inclusion in standard library?

2005-06-29 Thread Gregory Piñero
I'd like to see some database API's to the most common databases
included.  It would make Python much more useful for web development. 
I've come across situations where a web host supports python and
supports MySQL yet it's taken me days to get the MySQLAPI installed
with running setup in my home directory etc.  And I don't know what
options you have if you don't have shell access?

It definately seems to me that some API's to popular database would be
conducive to a "batteries included" approach.

-Greg

On 6/29/05, Thomas Heller <[EMAIL PROTECTED]> wrote:
> Simon Brunning <[EMAIL PROTECTED] > writes:
> 
> > On 6/28/05, John Roth <[EMAIL PROTECTED] > wrote:
> >> I'd definitely like to see ctypes. I can agree with the segfault
> >> issue, but I think that some design work would eliminate that.
> >
> > I'm not sure that it would. Ctypes allows you, as one colleague
> > memorably put it, to "poke the operating system with a stick". You are
> > always going to be able to use ctypes to provoke spectacular crashes
> > of the kind that you can never get with 'ordinary' Python.
> 
> Right.
> 
> > Having said that, I'd like to see ctypes in the standard library
> > anyway, with a suitably intimidating warning in the docs about the
> > trouble you can get yourself into with it.
> 
> To me, this sounds that *at least* a PEP would be needed to convince
> Guido.  Or, to record the reasoning why it cannot be included.
> 
> Thomas
> --
> http://mail.python.org/mailman/listinfo/python-list 
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python/IDLE - text in different colours

2005-06-29 Thread Bill Davy
Thank you Nathan, but that does not quite address my question.  I want to 
have code in Python so

make_the_prompt_string(Red)
make_print_output(Green)
while True:
s = raw_input("This prompt (which is really several lines long) will be 
in red: ")
Foo(s)
print "And the result is in Green so the user can see it"

"Nathan Pinno" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
>
>  Bill.
>
>  The way is the click on view, then click script checker, or something 
> like
> that. It will color code the text for you.
>
>  Nathan
>  "Bill Davy" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>  > To make life easier for my users, I'd like to colour my prompt string
> (as
>  > handed to raw_input()) a different colour to that produced by print.
> I'm
>  > using Python 2.4.1 and IDLE 1.1.1 on Windows XP.  Is it possible, and 
> if
> so,
>  > how?
>  > tia,
>  > Bill
>  >
>  >
>
>
>
> -- 
>
>
> 
> Posted via UsenetRevolution.com - Revolutionary Usenet
> ** HIGH RETENTION ** Specializing in Large Binaries Downloads **
> http://www.UsenetRevolution.com 


-- 
http://mail.python.org/mailman/listinfo/python-list


RE: COM problem .py versus .exe

2005-06-29 Thread Tim Golden
[Greg Miller]
| 
| The two machines are both running Windows XP, the desktop is 
| running XP Pro, the "virgin" PC is running XP embedded.

Well my first thought was: maybe XP Embedded has cut out
WMI. A quick Google around suggests that it's still there,
but maybe there's some restrictions in what you can give
it as a moniker. My module puts sensible defaults in,
rather than using the most minimalistic moniker. You
can pass a ready-made moniker in:


import wmi
wmi._DEBUG = 1
moniker = "winmgmts:"

c = wmi.WMI (moniker=moniker)
for i in c.Win32_Printer (): print i.Caption


You might try that to see if it gets round things.

| I didn't have this problem on the 
| first release
| as we weren't interested in displaying the file version of the .dll.
| With this improved version of the product the request has come down to
| have all software package versions displayed, so that is why I am now
| attempting to extract the file version of the dll.  Thanks again for
| everyone's assistance.

There was some talk a while back about including the win32
calls to get file versions into the pywin32 packages. Might
be worth checking to see if it's happened. Or using ctypes,
of course. If WMI is this much trouble, and only for this one
piece of info, definitely worth looking elsewhere.

TJG



This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Modules for inclusion in standard library?

2005-06-29 Thread bruno modulix
George Sakkis wrote:
>>"bruno modulix" <[EMAIL PROTECTED]> wrote:
> 
> 
>>George Sakkis wrote:
>>
>>>I'd love to see IPython replace the standard interpreter.
>>
>>I dont.
> 
> 
> Care to say why ?

Sorry...

it was about the "replace", not about IPython itself nor about IPython
becoming part of the stdlib.

IPython is a great *advanced* REPL, but most of the time, I just don't
need its advanced features (I usually run the REPL as an emacs
subprocess), and moreover, beginners already have enough to learn !-)

regards
-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: COM problem .py versus .exe

2005-06-29 Thread Tim Golden
[Tim Golden]
| [Greg Miller]
| 
| | I didn't have this problem on the 
| | first release
| | as we weren't interested in displaying the file version of the .dll.
| | With this improved version of the product the request has 
| come down to
| | have all software package versions displayed, so that is 
| why I am now
| | attempting to extract the file version of the dll.  Thanks again for
| | everyone's assistance.
| 
| There was some talk a while back about including the win32
| calls to get file versions into the pywin32 packages. Might
| be worth checking to see if it's happened. Or using ctypes,
| of course. If WMI is this much trouble, and only for this one
| piece of info, definitely worth looking elsewhere.
| 
| TJG

In fact, check out the win32api.GetFileVersionInfo function.


import os, sys
import win32api

win32api.GetFileVersionInfo (os.path.join (sys.exec_prefix, "python24.dll"), 
"\\")


You'll have to look in the demos directory for examples
and in the docs, but maybe this will save you a bit of grief.

TJG


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: map vs. list-comprehension

2005-06-29 Thread Mandus
29 Jun 2005 10:04:40 GMT skrev F. Petitjean:
> Le Wed, 29 Jun 2005 09:46:15 + (UTC), Mandus a écrit :
>> Hi there,
>>
>> inspired by a recent thread where the end of reduce/map/lambda in Python was
>> discussed, I looked over some of my maps, and tried to convert them to
>> list-comprehensions.
>>
>> This one I am not sure how to conver:
>>
>> Given three tuples of length n, b,i and d, I now do:
>>
>> map(lambda bb,ii,dd: bb+ii*dd,b,i,d)
>>
>> which gives a list of length n. 
>
> res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ]

aha - thanks! I wasn't aware of zip. Guess I have to put python in a
nutshell on my nightstand (again) :-)

seem to be a tad slower than the map, but nothing serious. Guess it's
the extra zip.

>
> Hoping that zip will not be deprecated.

hopefully not...

-- 
Mandus - the only mandus around.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Boss wants me to program

2005-06-29 Thread phil

> I don't want to start a flamewar here -
> 

No heat, no flames. Everyone's cool


> Let me emphasize a little more. Even though Python itself is great, I think we
> don't have quite yet tools that offer
> 

Ya know, I just don't know enough about javaworld.
The language I do not like.

I wonder what percentage of the tools you refer to are
Eclipse and not Java per se.  ?? I don't know.
The really big bucks of IBM sent Eclipse through the roof.

Python reminds me more of Linux.  Incredible no of packages,
kinda disjointed, docs pretty bad, not integrated.
But amazing stuff if you have the stomach for it.
(seen pygame?)
Maybe Python will get a daddy someday.

Comes down to preference.  Isn't it absolutely amazing how many
choices we have. Remember the 70's - Cobol, ASM, C, Basic.CICS(shudder)

I am pleased that folks on a Python list feel free to praise
other technologies.  That's neat.



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Creating Python wrapper for DLL

2005-06-29 Thread Tim
Thanks guys, I'll take a look!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
I put you code snippet into my code, running it from the desktop PC
gave me the following output ( I added a print statement ):

. . . winmgmts:
T i.Caption is  \\rocps00101\ROCPR001
T i.Caption is  \\ROCPS00101\ROCPR024
T i.Caption is  \\ROCPS00101\ROCPR070
T i.Caption is  \\rocps00101\ROCPR143

so that appears to work great, I took out the for i in
c.Win32_Printer statement, built the executable, but still get the
exact same error on the embedded PC.  It errors as soon as the import
wmib call is made, so it never gets to:

 wmi._DEBUG = 1
moniker = "winmgmts:"

c = wmi.WMI (moniker=moniker)

that you recommended.  I also copied my python24 directory from the
desktop PC to the embedded PC.  Then added the path variable for
Python.  I ran the win32com\client\makepy.py file using our target dll.
 That seemed to work okay.  I got the expected output.  That didn't
seem to make a difference to the executable, same error was generated.
WMIB.pyc is in the library.zip file that py2exe builds, so I know that
it is getting into the executable correctly.  I will check around to
see if the win32 calls you were referring to made it into the pywin32
package.  I'll also look at ctypes again, I had originally looked at
using ctypes but your wmi package simplified things so much.  Thanks
again for you help.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread A.M. Kuchling
On Wed, 29 Jun 2005 03:14:26 -, 
Grant Edwards <[EMAIL PROTECTED]> wrote:
>> cool because you have to bet a lot of money. Anyway, if you
>> insist on making distinctions between the backwoods of
>> apalachia and european aristocracy,
>
> What, you think they sound the same?

I think that backwoods American speech is more archaic, and therefore is
possibly closer to historical European speech.  Susan Cooper uses this as a
minor plot point in her juvenile novel "King of Shadows", which is about a
20th-century Southern kid who goes back to Elizabethan times and ends up
acting with Shakespeare; his accent ensures that he doesn't sound *too*
strange in 16th-century London.

--amk
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: map vs. list-comprehension

2005-06-29 Thread Carl Banks
F. Petitjean wrote:
> Le Wed, 29 Jun 2005 09:46:15 + (UTC), Mandus a écrit :
> > Hi there,
> >
> > inspired by a recent thread where the end of reduce/map/lambda in Python was
> > discussed, I looked over some of my maps, and tried to convert them to
> > list-comprehensions.
> >
> > This one I am not sure how to conver:
> >
> > Given three tuples of length n, b,i and d, I now do:
> >
> > map(lambda bb,ii,dd: bb+ii*dd,b,i,d)
> >
> > which gives a list of length n.
>
> res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ]
>
> Hoping that zip will not be deprecated.


Notice that zip doesn't do any functional stuff--it merely manipulates
data structures--so it ought not to be lumped in with map, filter, and
reduce.

Fear not, people: just as the BDFL does not indiscriminately add
features, also he does not indiscriminately remove them.  zip, though
it feels a little exotic, is very useful and serves a purpose that no
language feature serves(*), so rest assured it's not going to
disappear.

(*) Excepting izip, of course, which is more useful than zip and
probably should also be a builtin.


-- 
Carl Banks

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: COM problem .py versus .exe

2005-06-29 Thread Tim Golden
[Greg Miller]
| 
| I put you code snippet into my code, running it from the desktop PC
| gave me the following output ( I added a print statement ):
| 
| . . . winmgmts:
| T i.Caption is  \\rocps00101\ROCPR001
| T i.Caption is  \\ROCPS00101\ROCPR024
| T i.Caption is  \\ROCPS00101\ROCPR070
| T i.Caption is  \\rocps00101\ROCPR143
| 
| so that appears to work great, I took out the for i in
| c.Win32_Printer statement, built the executable, but still get the
| exact same error on the embedded PC.  

| It errors as soon as the import wmib call is made, so it never gets to:
| 
|  wmi._DEBUG = 1
| moniker = "winmgmts:"

Curious. Within the import, there is one call to GetObject ("winmgmts:")
(line 157, if you're interested) to provide the constants (courtesy of 
some code by Thomas H). I can only assume that it's that which is failing. 
Which, in itself, suggests that for some reason WMI is available on the 
target machine.

| I will check around to
| see if the win32 calls you were referring to made it into the pywin32
| package.  

The example in my later post definitely works against pywin32 build 204.

TJG


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Modules for inclusion in standard library?

2005-06-29 Thread Chris Cioffi
One of my votes would be for something like:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303481 or
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303770.
 
We use something like these in the stdlib already (time_struct), but don't supply a ready solution for people to implement their own.  FWIW, I'm writing all my new DB code to return tuples with named elements just to improve the readability of my programs.

 
Anyplace where a normal positional tuple is returned could be improved with named attribute access and this wouldn't break existing code like switching to a return object would.
 
On 27/06/05, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote:
Hello,at the moment python-dev is discussing including Jason Orendorff's path moduleinto the standard library.
Do you have any other good and valued Python modules that you would think arebug-free, mature (that includes a long release distance) and useful enough tobe granted a place in the stdlib?For my part, ctypes seems like a suggestion to start with.
Reinhold--http://mail.python.org/mailman/listinfo/python-list-- "Obviously crime pays, or there'd be no crime." -- G. Gorden Liddy 
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-29 Thread Roy Smith
Andrew Durdin <[EMAIL PROTECTED]> wrote:
> Corrected version:
> 
> result = [(lambda: expr0), lambda: expr1][bool(cond)]()

I'd go one step further.  Most people expect the first item to correspond 
to True and the second one to correspond to False.  So:

result = [(lambda: expr0), lambda: expr1][bool(not cond)]()

or perhaps even better:

result = [(lambda: expr0), lambda: expr1][1 - bool(cond)]()

or, if you prefer a slightly more deranged version:

result = [(lambda: expr0), lambda: expr1][bool(cond) - 1]()
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie: Explain My Problem

2005-06-29 Thread Robert Kern
John Machin wrote:
> [EMAIL PROTECTED] wrote:
> [snip]
> 
>>while counter != 0:
>>if guess == num:
> 
> [snip]
> 
> Others have told you already what was wrong with your program. Here's a 
> clue on how you could possibly help yourself:
> 
> 1. Each time around your loop, print the values of the interesting 
> objects, in this case counter and guess.
> E.g. before the "if" statement above, put something like this:
> print "guess = %r, counter = %r" % (guess, counter)
> That would have shown "guess" containing a string e.g.
> guess = '42', counter = 4
> instead of an integer e.g.
> guess = 42, counter = 4
> 
> 2. Examine the logic carefully. The answer to your second problem was 
> just staring you in the face -- you hadn't pulled the ripcord after the 
> counter became zero.

3. Sign up for the Python-tutor list. (Okay, that's not quite "helping 
yourself," but it's still good advice, I think).

http://mail.python.org/mailman/listinfo/tutor

-- 
Robert Kern
[EMAIL PROTECTED]

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
line 157 is in fact where the traceback says the failure is:

File "autoStart.py", line 241, in test
File "wmib.pyc", line 157, in ?
File "win32com\client\__init__.pyc", line 73, in GetObject
File "win32com\client\__init__.pyc", line 88, in Moniker
com_error: (-2147221020, 'Invalid syntax', None, None )

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Tim Golden
[A.M. Kuchling]
| I think that backwoods American speech is more archaic, and 
| therefore is possibly closer to historical European speech.  
| Susan Cooper uses this as a minor plot point in her juvenile 
| novel "King of Shadows", which is about a 20th-century 
| Southern kid who goes back to Elizabethan times and ends up
| acting with Shakespeare; his accent ensures that he doesn't 
| sound *too* strange in 16th-century London.

Aha! Bit of North American parochialism there. The fact
that he's a "Southern kid" doesn't say "from the southern
states of North America" to everyone. All right, in fact
it's clear from the context, but I just fancied having a
jab.

In fact, I rather like the fact that he can truthfully
claim to come from Falmouth, which his hearers (including
Queen Elizabeth!) understand to mean the town in the West
Country [of England] whereas in fact he means the town
in Carolina (apparently).

TJG


| 
| --amk
| -- 
| http://mail.python.org/mailman/listinfo/python-list
| 
| __
| __
| This e-mail has been scanned for all viruses by Star. The
| service is powered by MessageLabs. For more information on a proactive
| anti-virus service working around the clock, around the globe, visit:
| http://www.star.net.uk
| __
| __
| 


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to connect python and Mysql?

2005-06-29 Thread Andy Dustman
Post your question here:
http://sourceforge.net/forum/forum.php?forum_id=70461

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: COM problem .py versus .exe

2005-06-29 Thread Tim Golden
[Greg Miller]
| line 157 is in fact where the traceback says the failure is:
| 
| File "autoStart.py", line 241, in test
| File "wmib.pyc", line 157, in ?
| File "win32com\client\__init__.pyc", line 73, in GetObject
| File "win32com\client\__init__.pyc", line 88, in Moniker
| com_error: (-2147221020, 'Invalid syntax', None, None )

OK; I'm now officially stumped on the WMI front. If the
target machine can't cope with a GetObject ("winmgmts:")
then I'm guessing you're not going to be able to do anything
useful with WMI on it.

Any luck with the GetFileVersionInfo?

TJG


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-29 Thread Scott David Daniels
Roy Smith wrote:
> Andrew Durdin <[EMAIL PROTECTED]> wrote:
>>Corrected version:
>>result = [(lambda: expr0), lambda: expr1][bool(cond)]()
Sorry, I thought cond was a standard boolean.
Better is:
 result = [(lambda: true_expr), lambda: false_expr][not cond]()

--Scott David Daniels
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


XMLRPC and non-ascii characters

2005-06-29 Thread Joxean Koret
Hi to all!

I'm having troubles to make my XMLRPC application working with non
ASCII characters.

Example:

1.- In one terminal run the following script:

---XMLRPC Server-
import SimpleXMLRPCServer

server = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost",8003))
def test():
return "Test with the non ascii character 'ñ'"

server.register_function(test)
server.serve_forever()
---XMLRPC Server-

2.- In a second terminal run this:

---XMLRPC Client-
import xmlrpclib

server = xmlrpclib.Server(("localhost", 8003))
server.test()

---XMLRPC Client-

When you runs the XMLRPC Client script the following error is raised:

Traceback (most recent call last):
  File "", line 1, in ?
  File "/usr/lib/python2.3/xmlrpclib.py", line 1032, in __call__
return self.__send(self.__name, args)
  File "/usr/lib/python2.3/xmlrpclib.py", line 1319, in __request
verbose=self.__verbose
  File "/usr/lib/python2.3/xmlrpclib.py", line 1083, in request
return self._parse_response(h.getfile(), sock)
  File "/usr/lib/python2.3/xmlrpclib.py", line 1217, in _parse_response
p.feed(response)
  File "/usr/lib/python2.3/xmlrpclib.py", line 528, in feed
self._parser.Parse(data, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 5,
column 50

Any ideas of what can I do?

Regards,
Joxean Koret


signature.asc
Description: Esta parte del mensaje está firmada	digitalmente
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: map vs. list-comprehension

2005-06-29 Thread George Sakkis
"Carl Banks" <[EMAIL PROTECTED]> wrote in message

> Fear not, people: just as the BDFL does not indiscriminately add
> features, also he does not indiscriminately remove them.  zip, though
> it feels a little exotic, is very useful and serves a purpose that no
> language feature serves(*), so rest assured it's not going to
> disappear.
>
> (*) Excepting izip, of course, which is more useful than zip and
> probably should also be a builtin.

One of the envisioned changes in Python 3000
(http://www.python.org/peps/pep-3000.html) is to return iterators
instead of lists in several contexts (e.g. dict.keys(), dict.items()),
so perhaps zip will stand for what itertools.izip is today.

George

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: XMLRPC and non-ascii characters

2005-06-29 Thread Fredrik Lundh
Joxean Koret wrote:

> I'm having troubles to make my XMLRPC application working with non
> ASCII characters.

you cannot just pass in 8-bit strings in arbitrary encodings and expect the XML-
RPC layer to automagically figure out what you're doing.

you can either use the encoding option to the ServerProxy constructor to tell
the proxy what encoding to assume for 8-bit strings:

proxy = ServerProxy(uri, encoding="iso-8859-1")

(see

http://www.python.org/doc/current/lib/module-xmlrpclib.html

for details)

or you can do things the right way and use Unicode strings for non-ASCII text.

 



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
Unfortunately I have a "fire" to put out with a patch to the existing
machine code, I'll get back to looking into the problem a little later.
 Thanks very much for you assistance with this!  I really didn't look
into the GetFileVersionInfo, can I assume that is a cytypes function?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MySQLdb reconnect

2005-06-29 Thread Damjan
> Does MySQLdb automatically reconnect if the connection to the database is
> broken?

It seems so.

> I'm asking this since I have a longrunning Python precess that is
> connected to Mysql-4.1.11, and I execute "set names utf8" when I connect
> to it.
> 
> But after running a day the results from the python program were displayed
> as if the "set names utf8" was not executed i.e. I got question marks
> where utf-8 cyrillics should've appeared. After restarting the Python
> program everything was ok, just as when I first started it.

This is the sollution I've come to:

try:
# This will fail on MySQL < 4.1
db = MySQLdb.connect(godot.dbhost, godot.dbuser, godot.dbpass,
godot.dbname, use_unicode=1, init_command="set names utf8")
except MySQLdb.OperationalError:
db = MySQLdb.connect(godot.dbhost, godot.dbuser, godot.dbpass,
godot.dbname, use_unicode=1)
db.charset = 'utf8'


-- 
damjan
-- 
http://mail.python.org/mailman/listinfo/python-list


Python syntax high-lighting and preservation on web

2005-06-29 Thread Gregory Piñero
Hey guys,

Does anyone know where I can pick up a style sheet (css) and/or other
files/programs I might need to display python code on my website with
tab preservation(or replace with spaces) and colored syntax?  I want
something similar to the python code on a page like this:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303770

(I think this is a python-list question although maybe it belongs in a
css group?)  I figure some of you guys would have experience with
this.

-

Giving this issue some more thought, I suppose I could make or find a
css file anywhere that would work.  The hard part would be getting all
of the div and class tags added to my python code.  So I think what I
really need is a program that will do that, or advice on how to begin
writing such a program.  (It might make a good wordpress plugin too)

Thanks,
'
Greg
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: COM problem .py versus .exe

2005-06-29 Thread Tim Golden
[Greg Miller]
| Unfortunately I have a "fire" to put out with a patch to the existing
| machine code, I'll get back to looking into the problem a 
| little later.
|  Thanks very much for you assistance with this!  I really didn't look
| into the GetFileVersionInfo, can I assume that is a cytypes function?

No, it's a function in the win32api module of the pywin32 extensions.
(Although I imagine you could wrap it via ctypes, if you felt that
way inclined). Did my earlier post make it through to the newsgroup/Google? 
It came through on the mailing list. Just in case, here is the code again:


import os, sys
import win32api

dll_filepath = os.path.join (sys.exec_prefix, "python24.dll")
for k, v in win32api.GetFileVersionInfo (dll_filepath, "\\").items ():
  print k, "=>", v



Good luck with the firefighting.
TJG


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: XMLRPC and non-ascii characters

2005-06-29 Thread Richard Brodie

"Joxean Koret" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> I'm having troubles to make my XMLRPC application working with non
> ASCII characters.

I don't think XMLRPC has a mechanism for specifying an encoding other
than UTF-8 (and that only by default). If you recode to that, you'll
probably be OK.


-- 
http://mail.python.org/mailman/listinfo/python-list


Got an interesting problem. (platform ruuning issue)

2005-06-29 Thread Jeffrey Maitland
when running scripts they seem to work fine on ia-32 but I get
segfault on ia-64 what the heck should I be looking for?

I did notice that it seems to work ok only for certain scripts but any
script that imports MySQLdb or glob seems to make this occur.

Thanks Jeff
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python syntax high-lighting and preservation on web

2005-06-29 Thread Daniel Dittmar
Gregory Piñero wrote:
> Hey guys,
> 
> Does anyone know where I can pick up a style sheet (css) and/or other
> files/programs I might need to display python code on my website with
> tab preservation(or replace with spaces) and colored syntax?  I want
> something similar to the python code on a page like this:

see http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298

css only won't help you as someone has to insert the span tags so that 
the style sheet has something to match.

Daniel
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reading output from a child process non-blockingly

2005-06-29 Thread Thomas Guettler
Am Wed, 29 Jun 2005 16:08:54 +0800 schrieb Yuan HOng:

> In my program I have to call an external program and parse its output.
> For that I use the os.popen2 function, and then read the output
> stream.
[cut]
> I tried use select.select on the output stream returned by os.popen2,
> but it returns a readable file descriptor only after the whole child
> process ends.

Select is the right module for this. But it only works on file descriptors
on unix.

What happens, if you run the external command on the shell like this:

ext_prog > out.log &

Check out.log with "tail" or "less +F". Do you see the data appear
in small chunks? If not, the application detects that stdout is not
a tty and you only get data if the buffer is full or if the application
ends.

If out.log gets filled in chunks you want to read, you can read this file
as long as the application is running. Remember the size of the file after
each read and use fd.seek() to read only the new data after opening it
again. This should work on windows, too.

HTH,
  Thomas

-- 
Thomas Güttler, http://www.thomas-guettler.de/


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to find Windows "Application data" directory??

2005-06-29 Thread pyguy2
I had a post yesterday on just that. Anyways,  I  always love it when
what can be a really annoying problem, reduces into as something simple
and elegant  like a python dict. (in general, I find dictionaries
rock).

I remember a similar eureka, when some time ago I  found it really neat
that split w/no args works on whitespace words. Or, things like min and
sort actually travel down levels of data structures for you. Or,  when
one realizes things like "in" works on all sorts of sequences even
filehandes, or you can treat gzipped files just like normal files, or
coolness of cStringIO,  or startswith and endsmith methods on strings,
or . . .

Hmm, I wonder if there is a page of the little python coolnesses. I
recall one of python annoyances.

john

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Got an interesting problem. (platform ruuning issue)

2005-06-29 Thread John Abel
Jeffrey Maitland wrote:

>when running scripts they seem to work fine on ia-32 but I get
>segfault on ia-64 what the heck should I be looking for?
>
>I did notice that it seems to work ok only for certain scripts but any
>script that imports MySQLdb or glob seems to make this occur.
>
>Thanks Jeff
>  
>
That sounds to me like an issue with compiled libraries.  Does cli mysql 
work on the machine ( would verify a working libmysqlclient_r )?  I'm 
guessing glob fails due to it's dependence on re, and the os specific 
parts of os?

J
-- 
http://mail.python.org/mailman/listinfo/python-list


python broadcast socket

2005-06-29 Thread ronpro
I'm sort of new to both Python and socket programming so I appologize ahead of 
time if this is a dumb question.  I have found that the following code works on 
windows but on linux I get an exception.

import socket
s = socket.socket( socket.AF_INET, socket.SOCK_DGRAM )
s.connect( ( '', 1617 ) )

The exception I get is:

socket.error: (13, 'permission denied')


I have tried this on three Linux machines.  All firewall software is disabled.


Thanks for you time and patience.

Ron

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python syntax high-lighting and preservation on web

2005-06-29 Thread Gregory Piñero
This is perfect!  Thanks!


On 6/29/05, Daniel Dittmar <[EMAIL PROTECTED]> wrote:
> Gregory Piñero wrote:
> > Hey guys,
> >
> > Does anyone know where I can pick up a style sheet (css) and/or other
> > files/programs I might need to display python code on my website with
> > tab preservation(or replace with spaces) and colored syntax?  I want
> > something similar to the python code on a page like this:
> 
> see http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298 
> 
> css only won't help you as someone has to insert the span tags so that
> the style sheet has something to match.
> 
> Daniel
> --
> http://mail.python.org/mailman/listinfo/python-list 
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
I didn't see the earlier post, thanks for the resend.  The firefighting
is just about over, I have to find the machine owner to get permission
to try the code.  Then back to the dll version battle.  If I can keep
away from dealing with the ctypes code I will.  I'll see how this works
for me.  Thanks again.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: tkinter radiobutton

2005-06-29 Thread William Gill
I did some more digging based on your code, and discovered list 
comprehensions.  They didn't register the first time I skimmed the 
language reference and tutorial.  It's obvious the more I learn, the 
more I need to relearn what I think I know.  I need to study 
comprehensions, but they open up lots of opportunities for simpler, 
clearer code.

 >>return row == var.get()
Oops!  I saw this as soon as I sent it, but knew you would get my point.

 > var.set(-1)
Though both ways may seem roughly equivalent today, I'd bet that in 6 
months

...
var.set(-1) # initialize as no choice
...

will be clearer.

Thanks again!

Bill

Peter Otten wrote:
> William Gill wrote:
> 
> 
>>Also, does 'row == var.get() for var in self.variables' perform the
>>comparison row == var.get() for each item in self.variables?  I would
>>have had to write:
>>
>>for var in self.variables:
>>return row == var.get()
> 
> 
> Or rather
> 
> result = []
> for var in self.variables:
> result.append(row == var.get())
> return tuple(result)
> 
> This can be rewritten to a 'list comprehension'
> 
> return tuple([row == var.get() for var in self.variables])
> 
> and, since Python 2.4, to the 'generator expression' that I used and which
> avoids building the intermediate list. Both constructs also feature an
> if-clause, see
> 
> http://docs.python.org/tut/node7.html#SECTION00714
> http://docs.python.org/tut/node11.html#SECTION000
> 
> 
>>p.s.  I tweaked
>>
>>rbn = tk.Radiobutton(self, text=text, variable=var, value=y)
>>to
>>rbn = tk.Radiobutton(self, text=text, variable=var, value=y+1)
>>
>>and
>>
>>return tuple(row == var.get() for var in self.variables)
>>to
>>return tuple(row+1 == var.get() for var in self.variables)
>>
>>so that the Radiogrid doesn't initialize w/row 1 selected, and
>>accomodates cases where nothing is selected in any column.
> 
>  
> Another option would have been to initialize the variables
> 
> ...
> var = tk.IntVar()
> var.set(-1)
> if trace_write:
> ...
> 
> Peter
> 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python broadcast socket

2005-06-29 Thread Grant Edwards
On 2005-06-29, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote:

> I'm sort of new to both Python and socket programming so I
> appologize ahead of time if this is a dumb question.  I have
> found that the following code works on windows but on linux I
> get an exception.
>
> import socket
> s = socket.socket( socket.AF_INET, socket.SOCK_DGRAM )
> s.connect( ( '', 1617 ) )
>
> The exception I get is:
>
> socket.error: (13, 'permission denied')

Sending broadcast packets is a dangerous thing and not
something a normal user should be able to do. In a real OS,
it's a restricted operation and you need special privledges.

Under Linux, you need to be root to send a broadcase packet.

-- 
Grant Edwards   grante Yow!  How's the wife? Is
  at   she at home enjoying
   visi.comcapitalism?
-- 
http://mail.python.org/mailman/listinfo/python-list


MS Compiler to build Python 2.3 extension

2005-06-29 Thread garyrob
Hello,

I have no Microsoft compilers on my hard disk. I recenly built a C API
Python extension for Python 2.3 on OS X, and now I need to build it for
Windows.

When I start Python 2.3 on Windows, it says it was built with "MS C
v.1200". I'm not sure how that maps to current Microsoft compiler
products.

Someone who works with me (at another location) has MS Visual Studio
Pro 6.0 which he isn't using and can send to me. Will that do the
trick? Or do I need to buy another package?

Thanks,
Gary

--

Gary Robinson
CTO [of a very tiny company]
Emergent Music, LLC
[EMAIL PROTECTED]
207-942-3463
Company: http://emergentmusic.com
Blog:http://www.garyrobinson.net

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which kid's beginners programming - Python or Forth?

2005-06-29 Thread Rocco Moretti
BORT wrote:

> Gentle folk of comp.lang.python, I heartily thank you all for your
> input.  I think I'm taking the boys through the door marked "Logo."  We
> may be back this way, though.  We will likely need MORE in the nebulous
> future.  I am impressed with the outpouring of support here!

Others in the thread mentioned it briefly, but when you do come back to 
the door marked "Python", someone has eased the transition slightly:

http://pylogo.org/

'''PyLogo is a Logo interpreter written in Python. Its implementation is 
small, and is based on the language as implemented by UCBLogo. The Logo 
language is a learning language, intended for children for which more 
"complete" languages aren't appropriate. Many of Logos language design 
choices are driven by this, and differ from Python.'''

Although given it's 0.1 version status, it may be a little rough around 
the edges.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Steven D'Aprano
On Tue, 28 Jun 2005 11:27:40 -0700, muldoon wrote:

> Americans consider having a "British accent" a sign of sophistication
> and high intelligence. Many companies hire salespersons from Britain to
> represent their products,etc. Question: When the British hear an
> "American accent," does it sound unsophisticated and dumb?

Which American accent? 

Texan? Georgian cracker or Maine fisherman? New York taxi driver? Bill
Clinton or Jesse Jackson or George W Bush? California Valley girl,
Arkansas redneck or boyz from th' hood? Paris Hilton or Queen Latifah?

> Be blunt. We Americans need to know. Should we try to change the way we
> speak? Are there certain words that sound particularly goofy? Please
> help us with your advice on this awkward matter.

Speaking as an Australia, the typical "film voice" (eg Harrison
Ford, Tom Cruise, etc) doesn't sound unsophisticated. In fact, when we
hear it, it doesn't sound like an accent at all, such is the influence of
Hollywood. (Which is linguistically impossible, of course, since *every*
way of speaking is by definition an accent.) The Hollywood voice is a
mixture of West Coast and very light mid-Western.

But as for the rest of you, yes, you sound -- strange. It depends on the
specific regional accent. At best, just different. At worst, dumber than a
box of hammers. Which is of course unfair: there is no connection between
accent and intelligence. But by gum, some accents just sound dumber than
others. My fiancee, from Ireland, has worked and lived in the USA for half
her life, and to her you all sound like Kermit the Frog and Miss Piggy.

Lest anyone gets offended, I should point out that every English-speaking
country have accents which are considered by others to mark the speaker as
a thick yokel. In Ireland, they look down on Kerrymen. In England, even
Yorkshiremen look down on Summerset, Devon and Dorset accents. And there
is nothing as thick-sounding as a broad Ocker Aussie accent.

But don't worry, there is one thing we all agree on throughout the
English-speaking world: you Americans don't speak English.

There are a few things that you can do to help:

Herb starts with H, not E. It isn't "ouse" or "ospital" or "istory". It
isn't "erb" either. You just sound like tossers when you try to pronounce
herb in the original French. And the same with homage.

Taking of herbs, there is no BAY in basil. And oregano sounds like Ray
Romano, not oh-reg-ano.

And please, fillet of fish only has a silent T if you are speaking French.

Aluminium is al-u-min-ium, not alum-i-num.

Scientists work in a la-bor-atory, not a lab-rat-ory, even if they have
lab rats in the laboratory.

Fans of the X-Men movies and comics will remember Professor Charles
Xavier. Unless you are Spanish (Kh-avier), the X sounds like a Z: Zaviour.
But never never never Xecks-Aviour or Eggs-Savior.

Nuclear. Say no more.


-- 
Steven.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MS Compiler to build Python 2.3 extension

2005-06-29 Thread Richie Hindle

[Gary]
> I recenly built a C API Python extension for Python 2.3
> on OS X, and now I need to build it for Windows.  Will
> [MS Visual Studio Pro 6.0] do the trick?

Yes.  That's exactly the compiler that Python 2.3 itself, and most 2.3
extensions, were built with.

-- 
Richie Hindle
[EMAIL PROTECTED]

-- 
http://mail.python.org/mailman/listinfo/python-list


Programmers Contest: Fit pictures on a page

2005-06-29 Thread hicinbothem
GLOSSY: The Summer Programmer Of The Month Contest is underway!
Deadline is September 30, 2005
http://dinsights.com/POTM

I love taking digital pictures, but that nice glossy photo paper
is expensive!   So when my lovely wife asks for prints of a bunch
of pictures, I always try and fit them onto a single piece of paper.

The summer POTM challenges you to write a program that will place up to
26 pictures on a sheet of paper with the least amount of leftover
space.

The Programmer Of The Month (POTM) is a just-for-fun programming
contest with an active forum and over 1100 members (we usually
get 40-50 entries for each POTM challenge).  Supported languages
include C/C++/Perl/Ruby/PHP/Python/awk/shell.
Emphasis is on the algorithms and the joy of programming.

If it sounds like fun, please visit at http://dinsights.com/POTM ...
=Fred (a.k.a. The POTM-MASTER)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: whois like functionality on Windows?

2005-06-29 Thread Peter Hansen
Gerrit Muller wrote:
> thanks for your suggestion. I did indeed look broader than whois, and 
> reverse DNS maybe a better description. Unfortunately I did try the 
> socket.gethostbyaddr("194.109.137.226"), but the result was a 
> disappointing "host not found", both at home on an XP machine as well as 
> at work on a NT machine. Your comments stimulated me too experiment with 
> this apporach, and I discovered that unresolved IP addresses in my old 
> logfiles return "host not found". However many IP addresses in my new 
> logfile can be translated successfully! Apparantly there are IP 
> addresses that cannot be reversely resolved by the DNS servers. I did 
> translate these addresses manually so far via the whois service. So you 
> definitely helped me a lot, but I keep interested in a complementary 
> whois solution.

If the address doesn't get mapped to a name by a DNS server, I strongly 
suspect you will get nowhere with whois, or much else.  Not all IP 
addresses have corresponding domain names: many are dynamic addresses 
assigned on the fly to arbitrary customers of (for example) cable modem 
service providers, and they're often not interested in providing any 
reverse mapping for them.  Some do (for example, mine is 
pc-136-15.scpe.powergate.ca right now), but many don't...

I'm sure there's a way to identify the domain of the owner of a block of 
addresses in which a given IP resides.  I don't know what it is.

-Peter
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Boss wants me to program

2005-06-29 Thread Chinook
On Wed, 29 Jun 2005 08:11:43 -0400, phil wrote
(in article <[EMAIL PROTECTED]>):

> 
> Comes down to preference.  Isn't it absolutely amazing how many
> choices we have. Remember the 70's - Cobol, ASM, C, Basic.CICS(shudder)
> 

And please, no eulogies (especially for CICS) - being reminded of them is bad 
for my heart :~)  I once did a engineering modeling system in IBM 1130 
assembler that ran with overlays in 32K memory, because FORTRAN was too 
hoggish.  Input was the console keyboard and output was a CalComp plotter. 

> 
> Python reminds me more of Linux.  Incredible no of packages,
> kinda disjointed, docs pretty bad, not integrated.
> But amazing stuff if you have the stomach for it.
> (seen pygame?)
> Maybe Python will get a daddy someday.
> 

Seriously, having been involved in several (so called) high-level 
productivity languages over the years on both IBM and HP (3000 series), I am 
really enamored with Python (not to mention being on the user end :~).  
However, as you say ("needs a daddy") it is still for the most part in 
hackerdom evolution, and will not be a "mainstream" development platform 
until a Sun/IBM/whatever takes it under-wing with that intention in an open 
environment (the "suits" have to be convinced they can gain big time 
otherwise).  Can that happen in the Open-Source arena - I'm not convinced it 
can because such is more akin to a staging ground at present.

And what would be really cool is that if the same thing happened with Linux - 
it evolved to an elegant OS X like GUI without losing the intuitive 
underbelly.  

Just any "daddy" won't do though.  The least beneficial would be the path of 
DOS (sorry, I'm not a MS fan :~)).  A major problem is that business thinking 
(i.e. the "suits") is overly monopolistic to the point of 
counter-productivity.  Rather than an evolving open mainstream development 
platform (i.e. technical productivity competition) and commercial products 
emanating from such, the "suits" are focused on milking anything they can get 
their hands on with only short-term bonuses in mind.  I guess it all gets 
down to human nature (or as Pogo said ...).

Enough, before I really get carried away.

Lee C




-- 
http://mail.python.org/mailman/listinfo/python-list


Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Dan Sommers
On Wed, 29 Jun 2005 03:14:26 -,
Grant Edwards <[EMAIL PROTECTED]> wrote:

> On 2005-06-28, James Stroud <[EMAIL PROTECTED]> wrote:
>> I think James Bond did it for Americans. He always wore a
>> dinner jacket and played a lot of backarack--which is only
>> cool because you have to bet a lot of money. Anyway, if you
>> insist on making distinctions between the backwoods of
>> apalachia and european aristocracy,

> What, you think they sound the same?

As a recent transplant to Appalachia, I have heard that some linguists
speculate that because of the region's cultural isolation, perhaps the
locals here do actually speak as they did (and as their ancestors in
England did) a few hundred years ago.

Regards,
Dan

-- 
Dan Sommers

-- 
http://mail.python.org/mailman/listinfo/python-list


re:Open running processes

2005-06-29 Thread DeRRudi
Well it doesnt work yet, but its gonna! ;)
i've tested it with a little app. There is my main app (called it
server) wich contains a thread. This thread listens to a mm (memory
mapping) when an other program sets a flag
(finished_producing_event.set() ) it just calls self.iconize(false)

I'm not sure what pieces of code i have to post here.. posting all of
it makes it too large i believe :)

>From server:


ID_MESSAGECH = wxNewId()

def EVT_RESULT(win, func):
  win.Connect(-1, -1, ID_MESSAGECH, func)
  
class ResultEvent(wxPyEvent):
  
def __init__(self):
wxPyEvent.__init__(self)
self.SetEventType(ID_MESSAGECH)
 
class listener(Thread):
  def __init__(self, frame):
Thread.__init__(self)
self.frame = frame
self.setDaemon(1)

self.stopped = False

#shared_memory = mmap.mmap (0, common.SHARED_MEMORY_SIZE,
common.SHARED_MEMORY_NAME)
#ready_to_consume_event = events.Win32Event
(common.READY_TO_CONSUME)
#finished_producing_event = events.Win32Event
(common.FINISHED_PRODUCING)

  def run(self):
while not self.stopped:
try:
finished_producing_event.wait()
wxPostEvent(self.frame,ResultEvent(None))
except Exception,e:
print "Error: " , e

  def stop(self):
self.stopped = True



within the frame: 
[code:1:080343f1b1]
listen = listener(self)
listen.start()

EVT_RESULT(self, self.OnChange)

def OnChange(self, event):
shared_memory.seek(0)
tekstding = shared_memory.readline()
if(tekstding.strip() ==
"maximize"):
self.Iconize(False)
self.Show(False)
elif(tekstding.strip() ==
"minimize"):
self.Iconize(True)
self.Show(True)
self.panel.tekst.SetValue(tekstding)
[/code:1:080343f1b1]

Hope you can see now how it works! Greetz

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Open running processes

2005-06-29 Thread Tim Golden
[DeRRudi]
| Well it doesnt work yet, but its gonna! ;)
| i've tested it with a little app. There is my main app (called it
| server) wich contains a thread. This thread listens to a mm (memory
| mapping) when an other program sets a flag
| (finished_producing_event.set() ) it just calls self.iconize(false)
| 
| I'm not sure what pieces of code i have to post here.. posting all of
| it makes it too large i believe :)
| 
| >From server:

[.. snip ..]


| def OnChange(self, event):
| shared_memory.seek(0)
| tekstding = shared_memory.readline()
| if(tekstding.strip() ==
| "maximize"):
| self.Iconize(False)
| self.Show(False)
| elif(tekstding.strip() ==
| "minimize"):
| self.Iconize(True)
| self.Show(True)
| self.panel.tekst.SetValue(tekstding)
| [/code:1:080343f1b1]
| 
| Hope you can see now how it works! Greetz

Interesting; but do you need to use shared memory at all?
Why not simply have two events; one for maximise, the
other for minimising? 

TJG


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Set/Get attribute syntatic sugar

2005-06-29 Thread szport
Yes, I mean this thing.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reading output from a child process non-blockingly

2005-06-29 Thread Dan Sommers
On Wed, 29 Jun 2005 15:45:20 +0200,
Thomas Guettler <[EMAIL PROTECTED]> wrote:

> Check out.log with "tail" or "less +F". Do you see the data appear in
> small chunks? ...

You'll need "tail -f", I think.

Regards,
Dan

-- 
Dan Sommers

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python/IDLE - text in different colours

2005-06-29 Thread TouTaTis
"Bill Davy" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> To make life easier for my users, I'd like to colour my prompt string
> (as handed to raw_input()) a different colour to that produced by
> print.  I'm using Python 2.4.1 and IDLE 1.1.1 on Windows XP.  Is it
> possible, and if so, how?
> tia,
> Bill 
> 
> 

Communicating with a Program

Say we want the shell to distinguish more clearly, the output of external 
programs from the input prompt, the commands, and the shell feedback. We 
want the output of external programs to be indented and displayed in a 
different colour than the other text.

Setting the colour of the text is fairly easy using ANSI terminal escape 
sequences. For instance, to set the text colour to dark red, write "
[31;2m" to the terminal (where  is the escape code — in emacs use 
"C-q ESC" to write ). We can reset the output colour using "
0m".

Printing the output of external programs in dark red, we can do using the 
execute() function:

def runCommand(command):
print 'Running:', command

# set output colour:
sys.stdout.write("[31;2m") ; sys.stdout.flush()

os.system(command)

# reset output colour
sys.stdout.write("[0m")  

(Here we need to flush the stdout file to make sure that the escape code 
is written to the terminal before the output of the program) 

http://www.daimi.au.dk/~mailund/scripting2005/lecture-notes/process-
management.html

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Debugger Confusion

2005-06-29 Thread Rex Eastbourne
Thanks!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: map vs. list-comprehension

2005-06-29 Thread Scott David Daniels
Mandus wrote:
> 29 Jun 2005 10:04:40 GMT skrev F. Petitjean:
> 
>>Le Wed, 29 Jun 2005 09:46:15 + (UTC), Mandus a écrit :
>>
>>res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ]
> 
> seem to be a tad slower than the map, but nothing serious. Guess it's
> the extra zip.
You could try timing it using itertools.izip rather than zip.

--Scott David Daniels
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Set/Get attribute syntatic sugar

2005-06-29 Thread szport
> e = 'i_am_an_attribute'
> o.(e) = 10
> o.i_am_an_attribute == 10

Yes I mean this thing: to write

o.(e) = 10

or 

o.[e] = 10

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which kid's beginners programming - Python or Forth?

2005-06-29 Thread Aahz
In article <[EMAIL PROTECTED]>,
BORT <[EMAIL PROTECTED]> wrote:
>
>Gentle folk of comp.lang.python, I heartily thank you all for your
>input.  I think I'm taking the boys through the door marked "Logo."  We
>may be back this way, though.  We will likely need MORE in the nebulous
>future.  I am impressed with the outpouring of support here!
>
>Thanks to all!

You're welcome.  I want to leave you with one parting comment:

I first started programming when I was nine years old, in the mid-1970s.
We used TTYs with a timeshared HP1000 and BASIC.  Given modern computers
and editors I think that any programming language that isn't excessively
baroque will do fine for young people.  They can always unlearn bad
habits later.
-- 
Aahz ([EMAIL PROTECTED])   <*> http://www.pythoncraft.com/

f u cn rd ths, u cn gt a gd jb n nx prgrmmng.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Boss wants me to program

2005-06-29 Thread Adriaan Renting
The question was about someone with limited programming experience
building simple easy to use programs on Windows. This is the niche where
VB and Delphi realy shine. Python with TkInter is kind of o.k., I realy
like Python+PyQt+Eric3+QtDesigner, but currently that only works with a
commercial licence of Qt on Windows, that's why, on Windows, I'd
recommend VB (maybe Delphi) for small projects.
This doesn't mean I would recommend VB for everything. For large
projects C++ or java can both be far superior, depending on needs and
available tools and libraries. I realy like Python for small projects on
Linux. Both VB and Python are easier to learn as the more powerful
languages, the price is that they lack features that make it easier to
manage large and complex projects.

If there is one thing I want to advise, is to get some education, at
least buy a few good books, but only 20+ years of experience can
sometimes substitute for a few good programming classes. If they teach
how to write maintainable code, software design, efficient sorting
algorithms, user interface design, security, etc. then you're on to
something. Courses focussing on a single language often don't teach you
these general programming proinciples.

I think it's important to know how stuff works behind the scenes to some
extent. But I realy like to use all the hard work other people have done
for me.
I prefer QPrinter.print(MyEditor.lines())
to having to push the bits out the LPT myself.

I prefer TMessageBox->Question("Do you realy want to quit")
to having to MOV the bits to my video memory myself.

I realy prefer a WYSIWYG UI design tool
to having to code BUTTON(120, 123, 123, 335, -1, NULL, doButton, "Push",
"push this button")

Why?
Because people already figured out a way to do that, saving me time, so
I can finish my project on schedule or spend my time on something else.

P.S. I share your worries about the dwindling number of people that
actually have the technical know-how to run our increasingly complex
society. I think it has to do with our society mainly rewarding
charismatic people, and a lack of organisation among the more technical
professions. We should have a bar exam for all programmers!
About teaching in the exact sciences: I think we need a more hands-on
applied approach, to some extent this holds for the entire school
system. I'll stop here, or this will become a long OT rant.

Adriaan Renting| Email: [EMAIL PROTECTED]
ASTRON | Phone: +31 521 595 217
P.O. Box 2 | GSM:   +31 6 24 25 17 28
NL-7990 AA Dwingeloo   | FAX:   +31 521 597 332
The Netherlands| Web: http://www.astron.nl/~renting/
>>> phil <[EMAIL PROTECTED]> 06/28/05 8:04 PM >>>
> 
> You are quite correct to point out how much better it is to know what
is
> going on behind the scenes.  But heck, once you know how to extract
square
> roots - you need to let the computer do it!
> 
> GUI interfaces should be the same deal!
> Thomas Bartkus
> 
I think I pretty much agree. I essentially code my own gui builder

but in text files.

I just think it is really important to emphasise the operative
"but once you know how" in your comments.

Then some would counter with "oh, so we should code everthing
in assembler?"  Ouch. No, I will admit there is judgement
required.  Everything should be done the easiest way, with the
qualification that you need to understand how using someone
else's shortcut leaves you vulnerable.

This guy is trying to get started and looking for our advice and
I saw most of the advice leaning towrd VB (aarrgh!) and I thought
I should give him other food for thought.

I'm going to take this opportunity for a short rant.

I believe our society ( I'm an old fart) is drifting toward
a VERY small percentage of people knowing, caring or even
being curious about "how stuff works".  I teach high school
geometry and am APPALLED at the apathy.  I am concerned about
the future of this nation, economically, but spirtually as well.
So, this influences my advice.  Know how your stuff works if
it is reasonable.
Tom Wolfe talked in a book about two kinds of kids.
Those that play video games and those that make video games,
and the numbers of the latter is shrinking.






-- 
http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Debugger Confusion

2005-06-29 Thread Rex Eastbourne
One thing: is it possible to go through the code within emacs? Doing it
on the command line is useful, but it would be very helpful if I could
have a little marker within the emacs buffer that showed me where I am.

Rex

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Debugger Confusion

2005-06-29 Thread Rex Eastbourne
Also, when I try running pdb in my Emacs shell, I get very weird
behavior: for instance, I'll hit 'h' and enter twenty times with no
output. Then, all of a sudden, twenty output messages will pop up.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Boss wants me to program

2005-06-29 Thread phil

> About teaching in the exact sciences: I think we need a more hands-on
> applied approach, to some extent this holds for the entire school
> system.

YES! As a geometry(& trig) teacher, I am going to have them build a
shed, a kite, a sundial. I would love some doable ideas for hands
on which would teach more principles without being major
construction projects.

 


-- 
http://mail.python.org/mailman/listinfo/python-list


PIL question: keeping metadata

2005-06-29 Thread Ivan Herman
A question on using the PIL library. If I take a jpg file then, say, resize it 
and save it
somewhere else, all metadata that is part of the jpg file is lost. This is a 
pity: digital
cameras routinely add metainformation, so does, for example, Photoshop.

Is there any way of keeping this info in PIL? Alternatively, is there a simple 
image
processing package that does it?

Ivan
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to find Windows "Application data" directory??

2005-06-29 Thread Trent Mick
[Paul Rubin wrote]
> "Rune Strand" <[EMAIL PROTECTED]> writes:
> > You have the environment variable APPDATA. You can access it with
> > os.environ().
> 
> Thanks!!  Wow, I'd been hacking away at much messier approaches
> than that.  It's actually os.environ['APPDATA'] ;-)

Note that the APPDATA environment variable is only there on *some* of
the Windows flavours. It is there on Win2k and WinXP. It is not there on
WinME. Dunno about Win95, Win98, WinNT... but you may not care about
those old guys.

Cheers,
Trent

-- 
Trent Mick
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python/IDLE - text in different colours

2005-06-29 Thread Bill Davy
OK, I (sort of) tried that.  Used chr() to avoid issues of which editor and 
rant the following:

import sys

ESC = chr(27)
DarkRed = ESC + "[31;2m"
ResetColour = ESC + "[0m"

print "Initial colour"

sys.stdout.write(DarkRed) ; sys.stdout.flush()

print "Is this dark red?"

sys.stdout.write(ResetColour) ; sys.stdout.flush()

print "Final colour"

The output (in blue, using IDLE) was:

Initial colour
Is this dark red?
Final colour

So, have I missed soemthing?  By the way, in the output there is a little 
square box before the [ in the last two lines.  Does the window Idle sets up 
emulate VT100?

Hey ho, but many thanks.  My user will just have to strain his eyes.
Bill

PS Thanks for the URL.  Interesting.


"TouTaTis" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> "Bill Davy" <[EMAIL PROTECTED]> wrote in
> news:[EMAIL PROTECTED]:
>
>> To make life easier for my users, I'd like to colour my prompt string
>> (as handed to raw_input()) a different colour to that produced by
>> print.  I'm using Python 2.4.1 and IDLE 1.1.1 on Windows XP.  Is it
>> possible, and if so, how?
>> tia,
>> Bill
>>
>>
>
> Communicating with a Program
>
> Say we want the shell to distinguish more clearly, the output of external
> programs from the input prompt, the commands, and the shell feedback. We
> want the output of external programs to be indented and displayed in a
> different colour than the other text.
>
> Setting the colour of the text is fairly easy using ANSI terminal escape
> sequences. For instance, to set the text colour to dark red, write "
> [31;2m" to the terminal (where  is the escape code - in emacs use
> "C-q ESC" to write ). We can reset the output colour using "
> 0m".
>
> Printing the output of external programs in dark red, we can do using the
> execute() function:
>
> def runCommand(command):
>print 'Running:', command
>
># set output colour:
>sys.stdout.write("[31;2m") ; sys.stdout.flush()
>
>os.system(command)
>
># reset output colour
>sys.stdout.write("[0m")
>
> (Here we need to flush the stdout file to make sure that the escape code
> is written to the terminal before the output of the program)
>
> http://www.daimi.au.dk/~mailund/scripting2005/lecture-notes/process-management.html
> 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: strange __call__

2005-06-29 Thread Rahul
Hi.
well if you do dir(a) just after defining 'a' then it does show
'__call__'.
the reason i wanted to do it is that i wanted to see if theres a
uniform way to  wrap a function and callable objects so that for
example i can get some message printed whenever a function or a
function-like-object is called. then i could simply do :

def wrapper(obj):
   g = obj.__call__
   def f(*args,**kwargs):
 for arg in args:print arg
 return g(*args,**kwargs)
   obj.__call__=f
but it seems this will not work for functions :(


Andreas Kostyrka wrote:
> Just a guess, but setting "__X__" special methods won't work in most cases
> because these are usually optimized when the class is created.
>
> It might work if a.__call__ did exist before (because class a: contained
> a __call__ definition).
>
> Andreas
>
> On Wed, Jun 29, 2005 at 09:15:45AM +0100, Michael Hoffman wrote:
> > Rahul wrote:
> > > Consider the following:
> > > def a(x):
> > >  return x+1
> > >
> > > def b(f):
> > >   def g(*args,**kwargs):
> > > for arg in args:
> > > print arg
> > > return f(*args,**kwargs)
> > >   return g
> > >
> > > a.__call__ = b(a.__call__)
> > >
> > > now calling a(1) and a.__call__(1) yield 2 different results!!
> > > i.e. for functions a(1) doesnt seem to be translated to a.__call__ if
> > > you assign a new value to a.__call__?
> >
> > I don't know why this happens, but setting the __call__ attribute of a
> > is a pretty strange thing to do. Why not just set a instead? The
> > original function a(x) will still be stored as a closure in what is
> > returned from b().
> >
> > If this is of purely academic interest then the answer is I don't know. :)
> > --
> > Michael Hoffman
> > -- 
> > http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: PyDev 0.9.5 released

2005-06-29 Thread Fabio Zadrozny
Most things do work, but some still seem to have problems with version 
3.1 (and thus it is still not officially supported - but should be, not 
long from now).

Cheers,

Fabio

Dave Cook wrote:

>On 2005-06-28, Fabio Zadrozny <[EMAIL PROTECTED]> wrote:
>
>  
>
>>PyDev - Python IDE (Python Development Enviroment for Eclipse) version 
>>0.9.5 has just been released.
>>
>>
>
>Does it work with the newly released Eclipse 3.1?
>
>Dave COok
>  
>


-- 
Fabio Zadrozny
--
Software Developer

ESSS - Engineering Simulation and Scientific Software
www.esss.com.br

PyDev - Python Development Enviroment for Eclipse
pydev.sf.net
pydev.blogspot.com


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
I tried the code snippet using win32api.GetFileVersionInfo(), what I
get now is the following when running on the executable machine:

. . . FileFlagsMask => 63
FileType => 2
FileVersionMS => 65536
FileVersionLS => 1
Signature => -17890115
FileSubtype => 0
FileFlags => 0
ProductVersionLS => 1
FileDate => None
ProductVersionMS => 65536
FileOS => 4
StrucVersion => 65536

when I used the wmib.py code on the desktop the return value was a
string "1, 0, 0, 1".
I then parsed through it substituting and removing spaces to come up
with a version string of "1.0.0.1".  Do those values correspond to the
FileVersionLS, FileSubtype, FileFlags, and ProductVersionLS in the
above output?  I can't find too much on the 'net about these output
values.

-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   >